diff options
38 files changed, 757 insertions, 169 deletions
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java index 806283229d98..7e382870b016 100644 --- a/core/java/android/accessibilityservice/AccessibilityService.java +++ b/core/java/android/accessibilityservice/AccessibilityService.java @@ -518,7 +518,9 @@ public abstract class AccessibilityService extends Service { public static final int GLOBAL_ACTION_POWER_DIALOG = 6; /** - * Action to toggle docking the current app's window + * Action to toggle docking the current app's window. + * <p> + * <strong>Note:</strong> It is effective only if it appears in {@link #getSystemActions()}. */ public static final int GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN = 7; diff --git a/packages/SettingsLib/ActivityEmbedding/src/com/android/settingslib/activityembedding/ActivityEmbeddingUtils.java b/packages/SettingsLib/ActivityEmbedding/src/com/android/settingslib/activityembedding/ActivityEmbeddingUtils.java index 36c2bda8b03a..7f17d26b156a 100644 --- a/packages/SettingsLib/ActivityEmbedding/src/com/android/settingslib/activityembedding/ActivityEmbeddingUtils.java +++ b/packages/SettingsLib/ActivityEmbedding/src/com/android/settingslib/activityembedding/ActivityEmbeddingUtils.java @@ -18,7 +18,6 @@ package com.android.settingslib.activityembedding; import android.content.Context; import android.content.Intent; -import android.content.pm.ResolveInfo; import com.android.settingslib.utils.BuildCompatUtils; @@ -37,11 +36,10 @@ public class ActivityEmbeddingUtils { if (BuildCompatUtils.isAtLeastS()) { final Intent intent = new Intent(ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY); intent.setPackage(PACKAGE_NAME_SETTINGS); - final ResolveInfo resolveInfo = - context.getPackageManager().resolveActivity(intent, 0 /* flags */); - return resolveInfo != null - && resolveInfo.activityInfo != null - && resolveInfo.activityInfo.enabled; + final boolean isEmbeddingActivityEnabled = + intent.resolveActivity(context.getPackageManager()) != null; + + return isEmbeddingActivityEnabled; } return false; } diff --git a/packages/SystemUI/res-keyguard/drawable/ic_unlocked_aod.xml b/packages/SystemUI/res-keyguard/drawable/ic_unlocked_aod.xml new file mode 100644 index 000000000000..230a25628c40 --- /dev/null +++ b/packages/SystemUI/res-keyguard/drawable/ic_unlocked_aod.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2021 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="65dp" android:width="46dp" android:viewportHeight="65" android:viewportWidth="46"> + <group android:name="_R_G_L_2_G" android:translateX="23" android:translateY="32.125"> + <path android:name="_R_G_L_2_G_D_0_P_0" + android:fillColor="#FF000000" + android:fillAlpha="1" + android:fillType="nonZero" + android:pathData=" M0 6.13 C0.97,6.13 1.75,5.34 1.75,4.38 C1.75,3.41 0.97,2.63 0,2.63 C-0.97,2.63 -1.75,3.41 -1.75,4.38 C-1.75,5.34 -0.97,6.13 0,6.13c " /> + </group> + <group android:name="_R_G_L_1_G" android:translateX="23" android:translateY="32.125"> + <path android:name="_R_G_L_1_G_D_0_P_0" + android:strokeColor="#FF000000" + android:strokeLineCap="round" + android:strokeLineJoin="round" + android:strokeWidth="1.5" + android:strokeAlpha="1" + android:pathData=" M7.88 -0.62 C7.88,-0.62 7.88,9.38 7.88,9.38 C7.88,10.48 6.98,11.38 5.88,11.38 C5.88,11.38 -5.87,11.38 -5.87,11.38 C-6.98,11.38 -7.87,10.48 -7.87,9.38 C-7.87,9.38 -7.87,-0.62 -7.87,-0.62 C-7.87,-1.73 -6.98,-2.62 -5.87,-2.62 C-5.87,-2.62 5.88,-2.62 5.88,-2.62 C6.98,-2.62 7.88,-1.73 7.88,-0.62c " /> + </group> + <group android:name="_R_G_L_0_G" android:translateX="14" android:translateY="13.5"> + <path android:name="_R_G_L_0_G_D_0_P_0" + android:strokeColor="#FF000000" + android:strokeLineCap="round" + android:strokeLineJoin="round" + android:strokeWidth="1.5" + android:strokeAlpha="1" + android:pathData=" M21.25 14.88 C21.25,14.88 21.25,10.74 21.25,10.74 C21.25,8.59 19.5,7.29 17.44,7.21 C15.24,7.13 13.5,8.47 13.5,10.62 C13.5,10.62 13.5,15.75 13.5,15.75 " /> + </group> +</vector>
\ No newline at end of file diff --git a/packages/SystemUI/res-keyguard/drawable/super_lock_icon.xml b/packages/SystemUI/res-keyguard/drawable/super_lock_icon.xml index c58e2e3266d0..67a70bb39964 100644 --- a/packages/SystemUI/res-keyguard/drawable/super_lock_icon.xml +++ b/packages/SystemUI/res-keyguard/drawable/super_lock_icon.xml @@ -50,6 +50,11 @@ android:state_first="true" android:state_single="true" android:drawable="@drawable/ic_lock_aod" /> + <item + android:id="@+id/unlocked_aod" + android:state_last="true" + android:state_single="true" + android:drawable="@drawable/ic_unlocked_aod" /> <item android:id="@+id/no_icon" @@ -79,4 +84,14 @@ android:fromId="@id/locked" android:toId="@id/locked_aod" android:drawable="@drawable/lock_ls_to_aod" /> + + <transition + android:fromId="@id/unlocked_aod" + android:toId="@id/unlocked" + android:drawable="@drawable/unlocked_aod_to_ls" /> + + <transition + android:fromId="@id/unlocked" + android:toId="@id/unlocked_aod" + android:drawable="@drawable/unlocked_ls_to_aod" /> </animated-selector> diff --git a/packages/SystemUI/res-keyguard/drawable/unlocked_aod_to_ls.xml b/packages/SystemUI/res-keyguard/drawable/unlocked_aod_to_ls.xml new file mode 100644 index 000000000000..3b59ba8815b8 --- /dev/null +++ b/packages/SystemUI/res-keyguard/drawable/unlocked_aod_to_ls.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2021 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<animated-vector xmlns:aapt="http://schemas.android.com/aapt" + xmlns:android="http://schemas.android.com/apk/res/android"> + <aapt:attr name="android:drawable"> + <vector android:height="65dp" android:width="46dp" android:viewportHeight="65" android:viewportWidth="46"> + <group android:name="_R_G"> + <group android:name="_R_G_L_2_G" android:translateX="23" android:translateY="32.125"> + <path android:name="_R_G_L_2_G_D_0_P_0" + android:fillColor="#FF000000" + android:fillAlpha="1" + android:fillType="nonZero" + android:pathData=" M0 6.13 C0.97,6.13 1.75,5.34 1.75,4.38 C1.75,3.41 0.97,2.63 0,2.63 C-0.97,2.63 -1.75,3.41 -1.75,4.38 C-1.75,5.34 -0.97,6.13 0,6.13c " /> + </group> + <group android:name="_R_G_L_1_G" android:translateX="23" android:translateY="32.125"> + <path android:name="_R_G_L_1_G_D_0_P_0" + android:strokeColor="#FF000000" + android:strokeLineCap="round" + android:strokeLineJoin="round" + android:strokeWidth="1.5" + android:strokeAlpha="1" + android:pathData=" M7.88 -0.62 C7.88,-0.62 7.88,9.38 7.88,9.38 C7.88,10.48 6.98,11.38 5.88,11.38 C5.88,11.38 -5.87,11.38 -5.87,11.38 C-6.98,11.38 -7.87,10.48 -7.87,9.38 C-7.87,9.38 -7.87,-0.62 -7.87,-0.62 C-7.87,-1.73 -6.98,-2.62 -5.87,-2.62 C-5.87,-2.62 5.88,-2.62 5.88,-2.62 C6.98,-2.62 7.88,-1.73 7.88,-0.62c " /> + </group> + <group android:name="_R_G_L_0_G" android:translateX="14" android:translateY="13.5"> + <path android:name="_R_G_L_0_G_D_0_P_0" + android:strokeColor="#FF000000" + android:strokeLineCap="round" + android:strokeLineJoin="round" + android:strokeWidth="1.5" + android:strokeAlpha="1" + android:pathData=" M21.25 14.88 C21.25,14.88 21.25,10.74 21.25,10.74 C21.25,8.59 19.5,7.29 17.44,7.21 C15.24,7.13 13.5,8.47 13.5,10.62 C13.5,10.62 13.5,15.75 13.5,15.75 " /> + </group> + </group> + <group android:name="time_group" /> + </vector> + </aapt:attr> + <target android:name="_R_G_L_2_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="pathData" android:duration="333" android:startOffset="0" android:valueFrom="M0 6.13 C0.97,6.13 1.75,5.34 1.75,4.38 C1.75,3.41 0.97,2.63 0,2.63 C-0.97,2.63 -1.75,3.41 -1.75,4.38 C-1.75,5.34 -0.97,6.13 0,6.13c " android:valueTo="M-0.09 8.63 C1.2,8.63 2.25,7.57 2.25,6.28 C2.25,4.99 1.2,3.94 -0.09,3.94 C-1.39,3.94 -2.44,4.99 -2.44,6.28 C-2.44,7.57 -1.39,8.63 -0.09,8.63c " android:valueType="pathType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.372,0 0.203,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_1_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="strokeWidth" + android:duration="333" + android:startOffset="0" + android:valueFrom="1.5" + android:valueTo="2" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.307,0 0.386,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_1_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="pathData" + android:duration="333" + android:startOffset="0" + android:valueFrom="M7.88 -0.62 C7.88,-0.62 7.88,9.38 7.88,9.38 C7.88,10.48 6.98,11.38 5.88,11.38 C5.88,11.38 -5.87,11.38 -5.87,11.38 C-6.98,11.38 -7.87,10.48 -7.87,9.38 C-7.87,9.38 -7.87,-0.62 -7.87,-0.62 C-7.87,-1.73 -6.98,-2.62 -5.87,-2.62 C-5.87,-2.62 5.88,-2.62 5.88,-2.62 C6.98,-2.62 7.88,-1.73 7.88,-0.62c " android:valueTo="M11.25 -0.64 C11.25,-0.64 11.25,13.64 11.25,13.64 C11.25,15.22 9.97,16.5 8.39,16.5 C8.39,16.5 -8.39,16.5 -8.39,16.5 C-9.97,16.5 -11.25,15.22 -11.25,13.64 C-11.25,13.64 -11.25,-0.64 -11.25,-0.64 C-11.25,-2.22 -9.97,-3.5 -8.39,-3.5 C-8.39,-3.5 8.39,-3.5 8.39,-3.5 C9.97,-3.5 11.25,-2.22 11.25,-0.64c " android:valueType="pathType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.372,0 0.203,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="strokeWidth" + android:duration="333" + android:startOffset="0" + android:valueFrom="1.5" + android:valueTo="2.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="pathData" + android:duration="333" + android:startOffset="0" + android:valueFrom="M21.25 14.88 C21.25,14.88 21.25,10.74 21.25,10.74 C21.25,8.59 19.5,7.29 17.44,7.21 C15.24,7.13 13.5,8.47 13.5,10.62 C13.5,10.62 13.5,15.75 13.5,15.75 " android:valueTo="M27.19 14.81 C27.19,14.81 27.19,8.3 27.19,8.3 C27.19,4.92 24.44,2.88 21.19,2.75 C17.74,2.62 15,4.74 15,8.11 C15,8.11 15,15 15,15 " android:valueType="pathType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.347,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="time_group"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="translateX" + android:duration="517" + android:startOffset="0" + android:valueFrom="0" + android:valueTo="1" + android:valueType="floatType" /> + </set> + </aapt:attr> + </target> +</animated-vector>
\ No newline at end of file diff --git a/packages/SystemUI/res-keyguard/drawable/unlocked_ls_to_aod.xml b/packages/SystemUI/res-keyguard/drawable/unlocked_ls_to_aod.xml new file mode 100644 index 000000000000..1c6d0b5193eb --- /dev/null +++ b/packages/SystemUI/res-keyguard/drawable/unlocked_ls_to_aod.xml @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2021 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<animated-vector xmlns:aapt="http://schemas.android.com/aapt" + xmlns:android="http://schemas.android.com/apk/res/android"> + <aapt:attr name="android:drawable"> + <vector android:height="65dp" android:width="46dp" android:viewportHeight="65" android:viewportWidth="46"> + <group android:name="_R_G"> + <group android:name="_R_G_L_2_G" android:translateX="23" android:translateY="32.125"> + <path android:name="_R_G_L_2_G_D_0_P_0" + android:fillColor="#FF000000" + android:fillAlpha="1" + android:fillType="nonZero" + android:pathData=" M-0.09 8.63 C1.2,8.63 2.25,7.57 2.25,6.28 C2.25,4.99 1.2,3.94 -0.09,3.94 C-1.39,3.94 -2.44,4.99 -2.44,6.28 C-2.44,7.57 -1.39,8.63 -0.09,8.63c " /> + </group> + <group android:name="_R_G_L_1_G" android:translateX="23" android:translateY="32.125"> + <path android:name="_R_G_L_1_G_D_0_P_0" + android:strokeColor="#FF000000" + android:strokeLineCap="round" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:strokeAlpha="1" + android:pathData=" M11.25 -0.64 C11.25,-0.64 11.25,13.64 11.25,13.64 C11.25,15.22 9.97,16.5 8.39,16.5 C8.39,16.5 -8.39,16.5 -8.39,16.5 C-9.97,16.5 -11.25,15.22 -11.25,13.64 C-11.25,13.64 -11.25,-0.64 -11.25,-0.64 C-11.25,-2.22 -9.97,-3.5 -8.39,-3.5 C-8.39,-3.5 8.39,-3.5 8.39,-3.5 C9.97,-3.5 11.25,-2.22 11.25,-0.64c " /> + </group> + <group android:name="_R_G_L_0_G" android:translateX="14" android:translateY="13.5"> + <path android:name="_R_G_L_0_G_D_0_P_0" + android:strokeColor="#FF000000" + android:strokeLineCap="round" + android:strokeLineJoin="round" + android:strokeWidth="2.5" + android:strokeAlpha="1" + android:pathData=" M27.19 14.81 C27.19,14.81 27.19,8.3 27.19,8.3 C27.19,4.92 24.44,2.88 21.19,2.75 C17.74,2.62 15,4.74 15,8.11 C15,8.11 15,15 15,15 " /> + </group> + </group> + <group android:name="time_group" /> + </vector> + </aapt:attr> + <target android:name="_R_G_L_2_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="pathData" + android:duration="333" + android:startOffset="0" + android:valueFrom="M-0.09 8.63 C1.2,8.63 2.25,7.57 2.25,6.28 C2.25,4.99 1.2,3.94 -0.09,3.94 C-1.39,3.94 -2.44,4.99 -2.44,6.28 C-2.44,7.57 -1.39,8.63 -0.09,8.63c " android:valueTo="M0 6.13 C0.97,6.13 1.75,5.34 1.75,4.38 C1.75,3.41 0.97,2.63 0,2.63 C-0.97,2.63 -1.75,3.41 -1.75,4.38 C-1.75,5.34 -0.97,6.13 0,6.13c " android:valueType="pathType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.347,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_1_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="strokeWidth" + android:duration="333" + android:startOffset="0" + android:valueFrom="2" + android:valueTo="1.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.516,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_1_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="pathData" + android:duration="333" + android:startOffset="0" + android:valueFrom="M11.25 -0.64 C11.25,-0.64 11.25,13.64 11.25,13.64 C11.25,15.22 9.97,16.5 8.39,16.5 C8.39,16.5 -8.39,16.5 -8.39,16.5 C-9.97,16.5 -11.25,15.22 -11.25,13.64 C-11.25,13.64 -11.25,-0.64 -11.25,-0.64 C-11.25,-2.22 -9.97,-3.5 -8.39,-3.5 C-8.39,-3.5 8.39,-3.5 8.39,-3.5 C9.97,-3.5 11.25,-2.22 11.25,-0.64c " android:valueTo="M7.88 -0.62 C7.88,-0.62 7.88,9.38 7.88,9.38 C7.88,10.48 6.98,11.38 5.88,11.38 C5.88,11.38 -5.87,11.38 -5.87,11.38 C-6.98,11.38 -7.87,10.48 -7.87,9.38 C-7.87,9.38 -7.87,-0.62 -7.87,-0.62 C-7.87,-1.73 -6.98,-2.62 -5.87,-2.62 C-5.87,-2.62 5.88,-2.62 5.88,-2.62 C6.98,-2.62 7.88,-1.73 7.88,-0.62c " android:valueType="pathType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.347,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="strokeWidth" + android:duration="333" + android:startOffset="0" + android:valueFrom="2.5" + android:valueTo="1.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.516,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="pathData" + android:duration="333" + android:startOffset="0" + android:valueFrom="M27.19 14.81 C27.19,14.81 27.19,8.3 27.19,8.3 C27.19,4.92 24.44,2.88 21.19,2.75 C17.74,2.62 15,4.74 15,8.11 C15,8.11 15,15 15,15 " android:valueTo="M21.25 14.88 C21.25,14.88 21.25,10.74 21.25,10.74 C21.25,8.59 19.5,7.29 17.44,7.21 C15.24,7.13 13.5,8.47 13.5,10.62 C13.5,10.62 13.5,15.75 13.5,15.75 " android:valueType="pathType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.347,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="time_group"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="translateX" + android:duration="517" + android:startOffset="0" + android:valueFrom="0" + android:valueTo="1" + android:valueType="floatType" /> + </set> + </aapt:attr> + </target> +</animated-vector>
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index 521ed7844cff..7ac3ca629e3f 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -39,7 +39,6 @@ import android.os.Vibrator; import android.util.DisplayMetrics; import android.util.Log; import android.util.MathUtils; -import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; @@ -67,8 +66,6 @@ import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.ViewController; import com.android.systemui.util.concurrency.DelayableExecutor; -import com.airbnb.lottie.LottieAnimationView; - import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.Objects; @@ -103,10 +100,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme @NonNull private final AccessibilityManager mAccessibilityManager; @NonNull private final ConfigurationController mConfigurationController; @NonNull private final DelayableExecutor mExecutor; - @NonNull private final LayoutInflater mLayoutInflater; private boolean mUdfpsEnrolled; - @Nullable private LottieAnimationView mAodFp; @NonNull private final AnimatedStateListDrawable mIcon; @NonNull private CharSequence mUnlockedLabel; @@ -141,7 +136,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme // for udfps when strong auth is required or unlocked on AOD private boolean mShowAodLockIcon; - private boolean mShowAODFpIcon; + private boolean mShowAodUnlockedIcon; private final int mMaxBurnInOffsetX; private final int mMaxBurnInOffsetY; private float mInterpolatedDarkAmount; @@ -164,8 +159,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme @NonNull @Main DelayableExecutor executor, @Nullable Vibrator vibrator, @Nullable AuthRippleController authRippleController, - @NonNull @Main Resources resources, - @NonNull LayoutInflater inflater + @NonNull @Main Resources resources ) { super(view); mStatusBarStateController = statusBarStateController; @@ -179,7 +173,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme mExecutor = executor; mVibrator = vibrator; mAuthRippleController = authRippleController; - mLayoutInflater = inflater; mMaxBurnInOffsetX = resources.getDimensionPixelSize(R.dimen.udfps_burn_in_offset_x); mMaxBurnInOffsetY = resources.getDimensionPixelSize(R.dimen.udfps_burn_in_offset_y); @@ -261,11 +254,12 @@ public class LockIconViewController extends ViewController<LockIconView> impleme } boolean wasShowingUnlock = mShowUnlockIcon; - boolean wasShowingFpIcon = mUdfpsEnrolled && !mShowUnlockIcon && !mShowLockIcon; + boolean wasShowingFpIcon = mUdfpsEnrolled && !mShowUnlockIcon && !mShowLockIcon + && !mShowAodUnlockedIcon && !mShowAodLockIcon; mShowLockIcon = !mCanDismissLockScreen && !mUserUnlockedWithBiometric && isLockScreen() && (!mUdfpsEnrolled || !mRunningFPS); mShowUnlockIcon = (mCanDismissLockScreen || mUserUnlockedWithBiometric) && isLockScreen(); - mShowAODFpIcon = mIsDozing && mUdfpsEnrolled && !mRunningFPS && mCanDismissLockScreen; + mShowAodUnlockedIcon = mIsDozing && mUdfpsEnrolled && !mRunningFPS && mCanDismissLockScreen; mShowAodLockIcon = mIsDozing && mUdfpsEnrolled && !mRunningFPS && !mCanDismissLockScreen; final CharSequence prevContentDescription = mView.getContentDescription(); @@ -282,14 +276,9 @@ public class LockIconViewController extends ViewController<LockIconView> impleme mView.updateIcon(ICON_UNLOCK, false); mView.setContentDescription(mUnlockedLabel); mView.setVisibility(View.VISIBLE); - } else if (mShowAODFpIcon) { - // AOD fp icon is special cased as a lottie view (it updates for each burn-in offset), - // this state shows a transparent view - mView.setContentDescription(null); - mAodFp.setVisibility(View.VISIBLE); - mAodFp.setContentDescription(mCanDismissLockScreen ? mUnlockedLabel : mLockedLabel); - - mView.updateIcon(ICON_FINGERPRINT, true); // this shows no icon + } else if (mShowAodUnlockedIcon) { + mView.updateIcon(ICON_UNLOCK, true); + mView.setContentDescription(mUnlockedLabel); mView.setVisibility(View.VISIBLE); } else if (mShowAodLockIcon) { if (wasShowingUnlock) { @@ -305,11 +294,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme mView.setContentDescription(null); } - if (!mShowAODFpIcon && mAodFp != null) { - mAodFp.setVisibility(View.INVISIBLE); - mAodFp.setContentDescription(null); - } - if (!Objects.equals(prevContentDescription, mView.getContentDescription()) && mView.getContentDescription() != null) { mView.announceForAccessibility(mView.getContentDescription()); @@ -397,7 +381,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme pw.println(); pw.println(" mShowUnlockIcon: " + mShowUnlockIcon); pw.println(" mShowLockIcon: " + mShowLockIcon); - pw.println(" mShowAODFpIcon: " + mShowAODFpIcon); + pw.println(" mShowAodUnlockedIcon: " + mShowAodUnlockedIcon); pw.println(" mIsDozing: " + mIsDozing); pw.println(" mIsBouncerShowing: " + mIsBouncerShowing); pw.println(" mUserUnlockedWithBiometric: " + mUserUnlockedWithBiometric); @@ -426,13 +410,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme - mMaxBurnInOffsetY, mInterpolatedDarkAmount); float progress = MathUtils.lerp(0f, getBurnInProgressOffset(), mInterpolatedDarkAmount); - if (mAodFp != null) { - mAodFp.setTranslationX(offsetX); - mAodFp.setTranslationY(offsetY); - mAodFp.setProgress(progress); - mAodFp.setAlpha(255 * mInterpolatedDarkAmount); - } - mView.setTranslationX(offsetX); mView.setTranslationY(offsetY); } @@ -445,10 +422,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme mView.setUseBackground(mUdfpsSupported); mUdfpsEnrolled = mKeyguardUpdateMonitor.isUdfpsEnrolled(); - if (!wasUdfpsEnrolled && mUdfpsEnrolled && mAodFp == null) { - mLayoutInflater.inflate(R.layout.udfps_aod_lock_icon, mView); - mAodFp = mView.findViewById(R.id.lock_udfps_aod_fp); - } if (wasUdfpsSupported != mUdfpsSupported || wasUdfpsEnrolled != mUdfpsEnrolled) { updateVisibility(); } @@ -712,8 +685,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme private boolean inLockIconArea(MotionEvent event) { return mSensorTouchLocation.contains((int) event.getX(), (int) event.getY()) - && (mView.getVisibility() == View.VISIBLE - || (mAodFp != null && mAodFp.getVisibility() == View.VISIBLE)); + && mView.getVisibility() == View.VISIBLE; } private boolean isActionable() { diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java index fb4616a832dc..07aec6994bd0 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java @@ -23,6 +23,7 @@ import android.graphics.RectF; import com.android.systemui.Dumpable; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionListener; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.util.ViewController; @@ -44,6 +45,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> extends ViewController<T> implements Dumpable { @NonNull final StatusBarStateController mStatusBarStateController; @NonNull final PanelExpansionStateManager mPanelExpansionStateManager; + @NonNull final SystemUIDialogManager mDialogManager; @NonNull final DumpManager mDumpManger; boolean mNotificationShadeVisible; @@ -52,10 +54,12 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> T view, @NonNull StatusBarStateController statusBarStateController, @NonNull PanelExpansionStateManager panelExpansionStateManager, + @NonNull SystemUIDialogManager dialogManager, @NonNull DumpManager dumpManager) { super(view); mStatusBarStateController = statusBarStateController; mPanelExpansionStateManager = panelExpansionStateManager; + mDialogManager = dialogManager; mDumpManger = dumpManager; } @@ -64,12 +68,14 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> @Override protected void onViewAttached() { mPanelExpansionStateManager.addExpansionListener(mPanelExpansionListener); + mDialogManager.registerListener(mDialogListener); mDumpManger.registerDumpable(getDumpTag(), this); } @Override protected void onViewDetached() { mPanelExpansionStateManager.removeExpansionListener(mPanelExpansionListener); + mDialogManager.registerListener(mDialogListener); mDumpManger.unregisterDumpable(getDumpTag()); } @@ -95,7 +101,8 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> * authentication. */ boolean shouldPauseAuth() { - return mNotificationShadeVisible; + return mNotificationShadeVisible + || mDialogManager.shouldHideAffordance(); } /** @@ -189,4 +196,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> updatePauseAuth(); } }; + + private final SystemUIDialogManager.Listener mDialogListener = + (shouldHide) -> updatePauseAuth(); } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsBpViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsBpViewController.java index 894b29583cc9..3732100a2a06 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsBpViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsBpViewController.java @@ -20,6 +20,7 @@ import android.annotation.NonNull; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; /** @@ -30,8 +31,10 @@ class UdfpsBpViewController extends UdfpsAnimationViewController<UdfpsBpView> { @NonNull UdfpsBpView view, @NonNull StatusBarStateController statusBarStateController, @NonNull PanelExpansionStateManager panelExpansionStateManager, + @NonNull SystemUIDialogManager systemUIDialogManager, @NonNull DumpManager dumpManager) { - super(view, statusBarStateController, panelExpansionStateManager, dumpManager); + super(view, statusBarStateController, panelExpansionStateManager, + systemUIDialogManager, dumpManager); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 1252cc62bd13..3e9d6b0fa362 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -70,6 +70,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -118,6 +119,7 @@ public class UdfpsController implements DozeReceiver { @NonNull private final KeyguardStateController mKeyguardStateController; @NonNull private final StatusBarKeyguardViewManager mKeyguardViewManager; @NonNull private final DumpManager mDumpManager; + @NonNull private final SystemUIDialogManager mDialogManager; @NonNull private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; @Nullable private final Vibrator mVibrator; @NonNull private final FalsingManager mFalsingManager; @@ -552,7 +554,8 @@ public class UdfpsController implements DozeReceiver { @Main Handler mainHandler, @NonNull ConfigurationController configurationController, @NonNull SystemClock systemClock, - @NonNull UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) { + @NonNull UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, + @NonNull SystemUIDialogManager dialogManager) { mContext = context; mExecution = execution; mVibrator = vibrator; @@ -567,6 +570,7 @@ public class UdfpsController implements DozeReceiver { mKeyguardStateController = keyguardStateController; mKeyguardViewManager = statusBarKeyguardViewManager; mDumpManager = dumpManager; + mDialogManager = dialogManager; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mFalsingManager = falsingManager; mPowerManager = powerManager; @@ -815,6 +819,7 @@ public class UdfpsController implements DozeReceiver { mServerRequest.mEnrollHelper, mStatusBarStateController, mPanelExpansionStateManager, + mDialogManager, mDumpManager ); case BiometricOverlayConstants.REASON_AUTH_KEYGUARD: @@ -833,6 +838,7 @@ public class UdfpsController implements DozeReceiver { mSystemClock, mKeyguardStateController, mUnlockedScreenOffAnimationController, + mDialogManager, this ); case BiometricOverlayConstants.REASON_AUTH_BP: @@ -843,6 +849,7 @@ public class UdfpsController implements DozeReceiver { bpView, mStatusBarStateController, mPanelExpansionStateManager, + mDialogManager, mDumpManager ); case BiometricOverlayConstants.REASON_AUTH_OTHER: @@ -854,6 +861,7 @@ public class UdfpsController implements DozeReceiver { authOtherView, mStatusBarStateController, mPanelExpansionStateManager, + mDialogManager, mDumpManager ); default: diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java index 292a904af96e..ac9e92e22569 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java @@ -22,6 +22,7 @@ import android.graphics.PointF; import com.android.systemui.R; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; /** @@ -54,8 +55,10 @@ public class UdfpsEnrollViewController extends UdfpsAnimationViewController<Udfp @NonNull UdfpsEnrollHelper enrollHelper, @NonNull StatusBarStateController statusBarStateController, @NonNull PanelExpansionStateManager panelExpansionStateManager, + @NonNull SystemUIDialogManager systemUIDialogManager, @NonNull DumpManager dumpManager) { - super(view, statusBarStateController, panelExpansionStateManager, dumpManager); + super(view, statusBarStateController, panelExpansionStateManager, systemUIDialogManager, + dumpManager); mEnrollProgressBarRadius = getContext().getResources() .getInteger(R.integer.config_udfpsEnrollProgressBar); mEnrollHelper = enrollHelper; diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmOtherViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmOtherViewController.java index 619873367ee8..97dca0fbdedf 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmOtherViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsFpmOtherViewController.java @@ -20,6 +20,7 @@ import android.annotation.NonNull; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; /** @@ -33,8 +34,10 @@ class UdfpsFpmOtherViewController extends UdfpsAnimationViewController<UdfpsFpmO @NonNull UdfpsFpmOtherView view, @NonNull StatusBarStateController statusBarStateController, @NonNull PanelExpansionStateManager panelExpansionStateManager, + @NonNull SystemUIDialogManager systemUIDialogManager, @NonNull DumpManager dumpManager) { - super(view, statusBarStateController, panelExpansionStateManager, dumpManager); + super(view, statusBarStateController, panelExpansionStateManager, systemUIDialogManager, + dumpManager); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java index 8f4d6f6aa973..3e8a568cb803 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java @@ -31,6 +31,7 @@ import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionListener; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; @@ -86,8 +87,10 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud @NonNull SystemClock systemClock, @NonNull KeyguardStateController keyguardStateController, @NonNull UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, + @NonNull SystemUIDialogManager systemUIDialogManager, @NonNull UdfpsController udfpsController) { - super(view, statusBarStateController, panelExpansionStateManager, dumpManager); + super(view, statusBarStateController, panelExpansionStateManager, systemUIDialogManager, + dumpManager); mKeyguardViewManager = statusBarKeyguardViewManager; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLockScreenShadeTransitionController = transitionController; @@ -217,6 +220,10 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud return false; } + if (mDialogManager.shouldHideAffordance()) { + return true; + } + if (mLaunchTransitionFadingAway) { return true; } diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java index ff14064834d7..2ebcd8531128 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java @@ -121,6 +121,7 @@ import com.android.systemui.scrim.ScrimDrawable; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.SystemUIDialog; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.telephony.TelephonyListenerManager; @@ -236,6 +237,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene protected Handler mMainHandler; private int mSmallestScreenWidthDp; private final Optional<StatusBar> mStatusBarOptional; + private final SystemUIDialogManager mDialogManager; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final DialogLaunchAnimator mDialogLaunchAnimator; @@ -346,7 +348,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene PackageManager packageManager, Optional<StatusBar> statusBarOptional, KeyguardUpdateMonitor keyguardUpdateMonitor, - DialogLaunchAnimator dialogLaunchAnimator) { + DialogLaunchAnimator dialogLaunchAnimator, + SystemUIDialogManager dialogManager) { mContext = context; mWindowManagerFuncs = windowManagerFuncs; mAudioManager = audioManager; @@ -378,6 +381,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mStatusBarOptional = statusBarOptional; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mDialogLaunchAnimator = dialogLaunchAnimator; + mDialogManager = dialogManager; // receive broadcasts IntentFilter filter = new IntentFilter(); @@ -677,7 +681,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mAdapter, mOverflowAdapter, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, mSysUiState, this::onRefresh, mKeyguardShowing, mPowerAdapter, mUiEventLogger, - mStatusBarOptional, mKeyguardUpdateMonitor, mLockPatternUtils); + mStatusBarOptional, mKeyguardUpdateMonitor, mLockPatternUtils, + mDialogManager); dialog.setOnDismissListener(this); dialog.setOnShowListener(this); @@ -2219,10 +2224,12 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene SysUiState sysuiState, Runnable onRefreshCallback, boolean keyguardShowing, MyPowerOptionsAdapter powerAdapter, UiEventLogger uiEventLogger, Optional<StatusBar> statusBarOptional, - KeyguardUpdateMonitor keyguardUpdateMonitor, LockPatternUtils lockPatternUtils) { + KeyguardUpdateMonitor keyguardUpdateMonitor, LockPatternUtils lockPatternUtils, + SystemUIDialogManager systemUiDialogManager) { // We set dismissOnDeviceLock to false because we have a custom broadcast receiver to // dismiss this dialog when the device is locked. - super(context, themeRes, false /* dismissOnDeviceLock */); + super(context, themeRes, false /* dismissOnDeviceLock */, + systemUiDialogManager); mContext = context; mAdapter = adapter; mOverflowAdapter = overflowAdapter; diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java index 31ea2a5781ab..cdcdb519e447 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java @@ -44,6 +44,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.systemui.R; import com.android.systemui.statusbar.phone.SystemUIDialog; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; /** * Base dialog for media output UI @@ -82,8 +83,9 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements } }; - public MediaOutputBaseDialog(Context context, MediaOutputController mediaOutputController) { - super(context); + public MediaOutputBaseDialog(Context context, MediaOutputController mediaOutputController, + SystemUIDialogManager dialogManager) { + super(context, dialogManager); // Save the context that is wrapped with our theme. mContext = getContext(); diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java index ad6901f40d6b..a1e2c57c5c37 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java @@ -56,6 +56,7 @@ import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.phone.ShadeController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import java.util.ArrayList; import java.util.Collection; @@ -80,6 +81,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback { private final ShadeController mShadeController; private final ActivityStarter mActivityStarter; private final DialogLaunchAnimator mDialogLaunchAnimator; + private final SystemUIDialogManager mDialogManager; private final List<MediaDevice> mGroupMediaDevices = new CopyOnWriteArrayList<>(); private final boolean mAboveStatusbar; private final boolean mVolumeAdjustmentForRemoteGroupSessions; @@ -101,7 +103,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback { boolean aboveStatusbar, MediaSessionManager mediaSessionManager, LocalBluetoothManager lbm, ShadeController shadeController, ActivityStarter starter, NotificationEntryManager notificationEntryManager, UiEventLogger uiEventLogger, - DialogLaunchAnimator dialogLaunchAnimator) { + DialogLaunchAnimator dialogLaunchAnimator, SystemUIDialogManager dialogManager) { mContext = context; mPackageName = packageName; mMediaSessionManager = mediaSessionManager; @@ -117,6 +119,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback { mDialogLaunchAnimator = dialogLaunchAnimator; mVolumeAdjustmentForRemoteGroupSessions = mContext.getResources().getBoolean( com.android.internal.R.bool.config_volumeAdjustmentForRemoteGroupSessions); + mDialogManager = dialogManager; } void start(@NonNull Callback cb) { @@ -478,9 +481,10 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback { // We show the output group dialog from the output dialog. MediaOutputController controller = new MediaOutputController(mContext, mPackageName, mAboveStatusbar, mMediaSessionManager, mLocalBluetoothManager, mShadeController, - mActivityStarter, mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mActivityStarter, mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, + mDialogManager); MediaOutputGroupDialog dialog = new MediaOutputGroupDialog(mContext, mAboveStatusbar, - controller); + controller, mDialogManager); mDialogLaunchAnimator.showFromView(dialog, mediaOutputDialog); } diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java index eca8ac90427b..7e2558ceb1e8 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java @@ -28,6 +28,7 @@ import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.systemui.R; import com.android.systemui.dagger.SysUISingleton; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; /** * Dialog for media output transferring. @@ -37,8 +38,9 @@ public class MediaOutputDialog extends MediaOutputBaseDialog { final UiEventLogger mUiEventLogger; MediaOutputDialog(Context context, boolean aboveStatusbar, MediaOutputController - mediaOutputController, UiEventLogger uiEventLogger) { - super(context, mediaOutputController); + mediaOutputController, UiEventLogger uiEventLogger, + SystemUIDialogManager dialogManager) { + super(context, mediaOutputController, dialogManager); mUiEventLogger = uiEventLogger; mAdapter = new MediaOutputAdapter(mMediaOutputController, this); if (!aboveStatusbar) { diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt index b91901de5af3..a7bc85256fcd 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt @@ -25,6 +25,7 @@ import com.android.systemui.animation.DialogLaunchAnimator import com.android.systemui.plugins.ActivityStarter import com.android.systemui.statusbar.notification.NotificationEntryManager import com.android.systemui.statusbar.phone.ShadeController +import com.android.systemui.statusbar.phone.SystemUIDialogManager import javax.inject.Inject /** @@ -38,7 +39,8 @@ class MediaOutputDialogFactory @Inject constructor( private val starter: ActivityStarter, private val notificationEntryManager: NotificationEntryManager, private val uiEventLogger: UiEventLogger, - private val dialogLaunchAnimator: DialogLaunchAnimator + private val dialogLaunchAnimator: DialogLaunchAnimator, + private val dialogManager: SystemUIDialogManager ) { companion object { var mediaOutputDialog: MediaOutputDialog? = null @@ -51,8 +53,9 @@ class MediaOutputDialogFactory @Inject constructor( val controller = MediaOutputController(context, packageName, aboveStatusBar, mediaSessionManager, lbm, shadeController, starter, notificationEntryManager, - uiEventLogger, dialogLaunchAnimator) - val dialog = MediaOutputDialog(context, aboveStatusBar, controller, uiEventLogger) + uiEventLogger, dialogLaunchAnimator, dialogManager) + val dialog = MediaOutputDialog(context, aboveStatusBar, controller, uiEventLogger, + dialogManager) mediaOutputDialog = dialog // Show the dialog. diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputGroupDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputGroupDialog.java index b41e8137c1ec..478b890bf92d 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputGroupDialog.java +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputGroupDialog.java @@ -25,6 +25,7 @@ import android.widget.LinearLayout; import androidx.core.graphics.drawable.IconCompat; import com.android.systemui.R; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; /** * Dialog for media output group. @@ -32,8 +33,8 @@ import com.android.systemui.R; public class MediaOutputGroupDialog extends MediaOutputBaseDialog { MediaOutputGroupDialog(Context context, boolean aboveStatusbar, MediaOutputController - mediaOutputController) { - super(context, mediaOutputController); + mediaOutputController, SystemUIDialogManager dialogManager) { + super(context, mediaOutputController, dialogManager); mMediaOutputController.resetGroupMediaDevices(); mAdapter = new MediaOutputGroupAdapter(mMediaOutputController); if (!aboveStatusbar) { diff --git a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java index 85bf98c09f59..7f130cb203c0 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +++ b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java @@ -16,6 +16,7 @@ package com.android.systemui.recents; +import static com.android.systemui.shared.recents.utilities.Utilities.isTablet; import static com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_NONE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE; @@ -248,8 +249,8 @@ public class ScreenPinningRequest implements View.OnClickListener, .setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); View buttons = mLayout.findViewById(R.id.screen_pinning_buttons); WindowManagerWrapper wm = WindowManagerWrapper.getInstance(); - if (!QuickStepContract.isGesturalMode(mNavBarMode) - && wm.hasSoftNavigationBar(mContext.getDisplayId())) { + if (!QuickStepContract.isGesturalMode(mNavBarMode) + && wm.hasSoftNavigationBar(mContext.getDisplayId()) && !isTablet(mContext)) { buttons.setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); swapChildrenIfRtlAndVertical(buttons); } else { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index f43d9c350d62..d7b4738340e6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -887,7 +887,13 @@ public class KeyguardIndicationController { mStatusBarKeyguardViewManager.showBouncerMessage(message, mInitialTextColorState); } } else { - showBiometricMessage(mContext.getString(R.string.keyguard_unlock)); + if (mKeyguardUpdateMonitor.isUdfpsSupported() + && mKeyguardUpdateMonitor.getUserCanSkipBouncer( + KeyguardUpdateMonitor.getCurrentUser())) { + showBiometricMessage(mContext.getString(R.string.keyguard_unlock_press)); + } else { + showBiometricMessage(mContext.getString(R.string.keyguard_unlock)); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/charging/DwellRippleShader.kt b/packages/SystemUI/src/com/android/systemui/statusbar/charging/DwellRippleShader.kt new file mode 100644 index 000000000000..a1d086b5d768 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/charging/DwellRippleShader.kt @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.statusbar.charging + +import android.graphics.Color +import android.graphics.PointF +import android.graphics.RuntimeShader +import android.util.MathUtils + +/** + * Shader class that renders a distorted ripple for the UDFPS dwell effect. + * Adjustable shader parameters: + * - progress + * - origin + * - color + * - time + * - maxRadius + * - distortionStrength. + * See per field documentation for more details. + * + * Modeled after frameworks/base/graphics/java/android/graphics/drawable/RippleShader.java. + */ +class DwellRippleShader internal constructor() : RuntimeShader(SHADER, false) { + companion object { + private const val SHADER_UNIFORMS = """uniform vec2 in_origin; + uniform float in_time; + uniform float in_radius; + uniform float in_blur; + uniform vec4 in_color; + uniform float in_phase1; + uniform float in_phase2; + uniform float in_distortion_strength;""" + private const val SHADER_LIB = """ + float softCircle(vec2 uv, vec2 xy, float radius, float blur) { + float blurHalf = blur * 0.5; + float d = distance(uv, xy); + return 1. - smoothstep(1. - blurHalf, 1. + blurHalf, d / radius); + } + + float softRing(vec2 uv, vec2 xy, float radius, float blur) { + float thickness_half = radius * 0.25; + float circle_outer = softCircle(uv, xy, radius + thickness_half, blur); + float circle_inner = softCircle(uv, xy, radius - thickness_half, blur); + return circle_outer - circle_inner; + } + + vec2 distort(vec2 p, float time, float distort_amount_xy, float frequency) { + return p + vec2(sin(p.x * frequency + in_phase1), + cos(p.y * frequency * 1.23 + in_phase2)) * distort_amount_xy; + } + + vec4 ripple(vec2 p, float distort_xy, float frequency) { + vec2 p_distorted = distort(p, in_time, distort_xy, frequency); + float circle = softCircle(p_distorted, in_origin, in_radius * 1.2, in_blur); + float rippleAlpha = max(circle, + softRing(p_distorted, in_origin, in_radius, in_blur)) * 0.25; + return in_color * rippleAlpha; + } + """ + private const val SHADER_MAIN = """vec4 main(vec2 p) { + vec4 color1 = ripple(p, + 12 * in_distortion_strength, // distort_xy + 0.012 // frequency + ); + vec4 color2 = ripple(p, + 17.5 * in_distortion_strength, // distort_xy + 0.018 // frequency + ); + // Alpha blend between two layers. + return vec4(color1.xyz + color2.xyz + * (1 - color1.w), color1.w + color2.w * (1-color1.w)); + }""" + private const val SHADER = SHADER_UNIFORMS + SHADER_LIB + SHADER_MAIN + } + + /** + * Maximum radius of the ripple. + */ + var maxRadius: Float = 0.0f + + /** + * Origin coordinate of the ripple. + */ + var origin: PointF = PointF() + set(value) { + field = value + setUniform("in_origin", floatArrayOf(value.x, value.y)) + } + + /** + * Progress of the ripple. Float value between [0, 1]. + */ + var progress: Float = 0.0f + set(value) { + field = value + setUniform("in_radius", + (1 - (1 - value) * (1 - value) * (1 - value))* maxRadius) + setUniform("in_blur", MathUtils.lerp(1f, 0.7f, value)) + } + + /** + * Distortion strength between [0, 1], with 0 being no distortion and 1 being full distortion. + */ + var distortionStrength: Float = 0.0f + set(value) { + field = value + setUniform("in_distortion_strength", value) + } + + /** + * Play time since the start of the effect in seconds. + */ + var time: Float = 0.0f + set(value) { + field = value * 0.001f + setUniform("in_time", field) + setUniform("in_phase1", field * 2f + 0.367f) + setUniform("in_phase2", field * 5.2f * 1.531f) + } + + /** + * A hex value representing the ripple color, in the format of ARGB + */ + var color: Int = 0xffffff.toInt() + set(value) { + field = value + val color = Color.valueOf(value) + setUniform("in_color", floatArrayOf(color.red(), + color.green(), color.blue(), color.alpha())) + } +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java index aa3b3e12b8f8..ad1c23283912 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java @@ -74,7 +74,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp private static final long BIOMETRIC_WAKELOCK_TIMEOUT_MS = 15 * 1000; private static final String BIOMETRIC_WAKE_LOCK_NAME = "wake-and-unlock:wakelock"; private static final UiEventLogger UI_EVENT_LOGGER = new UiEventLoggerImpl(); - private static final int FP_ATTEMPTS_BEFORE_SHOW_BOUNCER = 3; + private static final int FP_ATTEMPTS_BEFORE_SHOW_BOUNCER = 2; @IntDef(prefix = { "MODE_" }, value = { MODE_NONE, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 261b5dbac3d1..5eb35ac74732 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -3262,12 +3262,6 @@ public class NotificationPanelViewController extends PanelViewController { mStatusBarStateController.setState(KEYGUARD); } return true; - case StatusBarState.SHADE: - - // This gets called in the middle of the touch handling, where the state is still - // that we are tracking the panel. Collapse the panel after this is done. - mView.post(mPostCollapseRunnable); - return false; default: return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java index 2823d985102f..2bf16fc9e52c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java @@ -928,7 +928,6 @@ public abstract class PanelViewController { private void abortAnimations() { cancelHeightAnimator(); - mView.removeCallbacks(mPostCollapseRunnable); mView.removeCallbacks(mFlingCollapseRunnable); } @@ -1105,13 +1104,6 @@ public abstract class PanelViewController { return onMiddleClicked(); } - protected final Runnable mPostCollapseRunnable = new Runnable() { - @Override - public void run() { - collapse(false /* delayed */, 1.0f /* speedUpFactor */); - } - }; - protected abstract boolean onMiddleClicked(); protected abstract boolean isDozing(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java index 8df7b452e202..93f9892cf5b0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java @@ -45,6 +45,10 @@ import com.android.systemui.statusbar.policy.KeyguardStateController; /** * Base class for dialogs that should appear over panels and keyguard. + * + * Optionally provide a {@link SystemUIDialogManager} to its constructor to send signals to + * listeners on whether this dialog is showing. + * * The SystemUIDialog registers a listener for the screen off / close system dialogs broadcast, * and dismisses itself when it receives the broadcast. */ @@ -54,8 +58,9 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh "persist.systemui.flag_tablet_dialog_width"; private final Context mContext; - private final DismissReceiver mDismissReceiver; + @Nullable private final DismissReceiver mDismissReceiver; private final Handler mHandler = new Handler(); + @Nullable private final SystemUIDialogManager mDialogManager; private int mLastWidth = Integer.MIN_VALUE; private int mLastHeight = Integer.MIN_VALUE; @@ -66,11 +71,22 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh this(context, R.style.Theme_SystemUI_Dialog); } + public SystemUIDialog(Context context, SystemUIDialogManager dialogManager) { + this(context, R.style.Theme_SystemUI_Dialog, true, dialogManager); + } + public SystemUIDialog(Context context, int theme) { this(context, theme, true /* dismissOnDeviceLock */); } - public SystemUIDialog(Context context, int theme, boolean dismissOnDeviceLock) { + this(context, theme, dismissOnDeviceLock, null); + } + + /** + * @param udfpsDialogManager If set, UDFPS will hide if this dialog is showing. + */ + public SystemUIDialog(Context context, int theme, boolean dismissOnDeviceLock, + SystemUIDialogManager dialogManager) { super(context, theme); mContext = context; @@ -80,6 +96,7 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh getWindow().setAttributes(attrs); mDismissReceiver = dismissOnDeviceLock ? new DismissReceiver(this) : null; + mDialogManager = dialogManager; } @Override @@ -145,6 +162,10 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh mDismissReceiver.register(); } + if (mDialogManager != null) { + mDialogManager.setShowing(this, true); + } + // Listen for configuration changes to resize this dialog window. This is mostly necessary // for foldables that often go from large <=> small screen when folding/unfolding. ViewRootImpl.addConfigCallback(this); @@ -158,6 +179,10 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh mDismissReceiver.unregister(); } + if (mDialogManager != null) { + mDialogManager.setShowing(this, false); + } + ViewRootImpl.removeConfigCallback(this); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java new file mode 100644 index 000000000000..204f710b633a --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.statusbar.phone; + +import androidx.annotation.NonNull; + +import com.android.systemui.Dumpable; +import com.android.systemui.dagger.SysUISingleton; +import com.android.systemui.dump.DumpManager; + +import java.io.FileDescriptor; +import java.io.PrintWriter; +import java.util.HashSet; +import java.util.Set; + +import javax.inject.Inject; + +/** + * Register dialogs to this manager if extraneous affordances (like the UDFPS sensor area) + * should be hidden from the screen when the dialog shows. + * + * Currently, only used if UDFPS is supported on the device; however, can be extended in the future + * for other use cases. + */ +@SysUISingleton +public class SystemUIDialogManager implements Dumpable { + private final StatusBarKeyguardViewManager mKeyguardViewManager; + + private final Set<SystemUIDialog> mDialogsShowing = new HashSet<>(); + private final Set<Listener> mListeners = new HashSet<>(); + + @Inject + public SystemUIDialogManager( + DumpManager dumpManager, + StatusBarKeyguardViewManager statusBarKeyguardViewManager) { + dumpManager.registerDumpable(this); + mKeyguardViewManager = statusBarKeyguardViewManager; + } + + /** + * Whether listeners should hide affordances like the UDFPS sensor icon. + */ + public boolean shouldHideAffordance() { + return !mDialogsShowing.isEmpty(); + } + + /** + * Register a listener to receive callbacks. + */ + public void registerListener(@NonNull Listener listener) { + mListeners.add(listener); + } + + /** + * Unregister a listener from receiving callbacks. + */ + public void unregisterListener(@NonNull Listener listener) { + mListeners.remove(listener); + } + + void setShowing(SystemUIDialog dialog, boolean showing) { + final boolean wasHidingAffordances = shouldHideAffordance(); + if (showing) { + mDialogsShowing.add(dialog); + } else { + mDialogsShowing.remove(dialog); + } + + if (wasHidingAffordances != shouldHideAffordance()) { + updateDialogListeners(); + } + } + + private void updateDialogListeners() { + if (shouldHideAffordance()) { + mKeyguardViewManager.resetAlternateAuth(true); + } + + for (Listener listener : mListeners) { + listener.shouldHideAffordances(shouldHideAffordance()); + } + } + + @Override + public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) { + pw.println("listeners:"); + for (Listener listener : mListeners) { + pw.println("\t" + listener); + } + pw.println("dialogs tracked:"); + for (SystemUIDialog dialog : mDialogsShowing) { + pw.println("\t" + dialog); + } + } + + /** SystemUIDialogManagerListener */ + public interface Listener { + /** + * Callback where shouldHide=true if listeners should hide their views that may overlap + * a showing dialog. + */ + void shouldHideAffordances(boolean shouldHide); + } +} diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java index f4a9092c1cd3..ac221a9f7891 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java @@ -65,6 +65,7 @@ import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -170,6 +171,8 @@ public class UdfpsControllerTest extends SysuiTestCase { private TypedArray mBrightnessValues; @Mock private TypedArray mBrightnessBacklight; + @Mock + private SystemUIDialogManager mSystemUIDialogManager; // Capture listeners so that they can be used to send events @Captor private ArgumentCaptor<IUdfpsOverlayController> mOverlayCaptor; @@ -179,8 +182,6 @@ public class UdfpsControllerTest extends SysuiTestCase { @Captor private ArgumentCaptor<ScreenLifecycle.Observer> mScreenObserverCaptor; private ScreenLifecycle.Observer mScreenObserver; - @Captor private ArgumentCaptor<UdfpsAnimationViewController> mAnimViewControllerCaptor; - @Before public void setUp() { setUpResources(); @@ -238,7 +239,8 @@ public class UdfpsControllerTest extends SysuiTestCase { mHandler, mConfigurationController, mSystemClock, - mUnlockedScreenOffAnimationController); + mUnlockedScreenOffAnimationController, + mSystemUIDialogManager); verify(mFingerprintManager).setUdfpsOverlayController(mOverlayCaptor.capture()); mOverlayController = mOverlayCaptor.getValue(); verify(mScreenLifecycle).addObserver(mScreenObserverCaptor.capture()); diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java index 1cf21ac40e31..0ae3c39e659b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java @@ -42,6 +42,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionListener; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; @@ -92,6 +93,8 @@ public class UdfpsKeyguardViewControllerTest extends SysuiTestCase { @Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; @Mock + private SystemUIDialogManager mDialogManager; + @Mock private UdfpsController mUdfpsController; private FakeSystemClock mSystemClock = new FakeSystemClock(); @@ -130,6 +133,7 @@ public class UdfpsKeyguardViewControllerTest extends SysuiTestCase { mSystemClock, mKeyguardStateController, mUnlockedScreenOffAnimationController, + mDialogManager, mUdfpsController); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java index bf5522c50a78..e3a7e3b43b77 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java @@ -62,6 +62,7 @@ import com.android.systemui.plugins.GlobalActions; import com.android.systemui.settings.UserContextProvider; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.telephony.TelephonyListenerManager; @@ -117,6 +118,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { @Mock private StatusBar mStatusBar; @Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor; @Mock private DialogLaunchAnimator mDialogLaunchAnimator; + @Mock private SystemUIDialogManager mDialogManager; private TestableLooper mTestableLooper; @@ -162,7 +164,8 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { mPackageManager, Optional.of(mStatusBar), mKeyguardUpdateMonitor, - mDialogLaunchAnimator); + mDialogLaunchAnimator, + mDialogManager); mGlobalActionsDialogLite.setZeroDialogPressDelayForTesting(); ColorExtractor.GradientColors backdropColors = new ColorExtractor.GradientColors(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java index 81bcbfb1f460..d7c00fbe1e85 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java @@ -26,7 +26,6 @@ import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyBoolean; import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -43,7 +42,6 @@ import android.os.Vibrator; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.util.Pair; -import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.view.accessibility.AccessibilityManager; @@ -69,8 +67,6 @@ import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.concurrency.FakeExecutor; import com.android.systemui.util.time.FakeSystemClock; -import com.airbnb.lottie.LottieAnimationView; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -110,8 +106,6 @@ public class LockIconViewControllerTest extends SysuiTestCase { private @Mock ConfigurationController mConfigurationController; private @Mock Vibrator mVibrator; private @Mock AuthRippleController mAuthRippleController; - private @Mock LottieAnimationView mAodFp; - private @Mock LayoutInflater mLayoutInflater; private FakeExecutor mDelayableExecutor = new FakeExecutor(new FakeSystemClock()); private LockIconViewController mLockIconViewController; @@ -149,7 +143,6 @@ public class LockIconViewControllerTest extends SysuiTestCase { when(mLockIconView.getResources()).thenReturn(mResources); when(mLockIconView.getContext()).thenReturn(mContext); - when(mLockIconView.findViewById(R.layout.udfps_aod_lock_icon)).thenReturn(mAodFp); when(mContext.getResources()).thenReturn(mResources); when(mContext.getSystemService(WindowManager.class)).thenReturn(mWindowManager); Rect windowBounds = new Rect(0, 0, 800, 1200); @@ -176,8 +169,7 @@ public class LockIconViewControllerTest extends SysuiTestCase { mDelayableExecutor, mVibrator, mAuthRippleController, - mResources, - mLayoutInflater + mResources ); } @@ -187,35 +179,6 @@ public class LockIconViewControllerTest extends SysuiTestCase { } @Test - public void testIgnoreUdfpsWhenNotSupported() { - // GIVEN Udpfs sensor is NOT available - mLockIconViewController.init(); - captureAttachListener(); - - // WHEN the view is attached - mAttachListener.onViewAttachedToWindow(mLockIconView); - - // THEN lottie animation should NOT be inflated - verify(mLayoutInflater, never()).inflate(eq(R.layout.udfps_aod_lock_icon), any()); - } - - @Test - public void testInflateUdfpsWhenSupported() { - // GIVEN Udpfs sensor is available - setupUdfps(); - when(mKeyguardUpdateMonitor.isUdfpsEnrolled()).thenReturn(true); - - mLockIconViewController.init(); - captureAttachListener(); - - // WHEN the view is attached - mAttachListener.onViewAttachedToWindow(mLockIconView); - - // THEN lottie animation should be inflated - verify(mLayoutInflater).inflate(eq(R.layout.udfps_aod_lock_icon), any()); - } - - @Test public void testUpdateFingerprintLocationOnInit() { // GIVEN fp sensor location is available pre-attached Pair<Integer, PointF> udfps = setupUdfps(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java index 053851ec385d..451291d264b7 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java @@ -43,6 +43,7 @@ import com.android.systemui.animation.DialogLaunchAnimator; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.phone.ShadeController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import org.junit.Before; import org.junit.Test; @@ -65,6 +66,7 @@ public class MediaOutputBaseDialogTest extends SysuiTestCase { mock(NotificationEntryManager.class); private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class); private final DialogLaunchAnimator mDialogLaunchAnimator = mock(DialogLaunchAnimator.class); + private final SystemUIDialogManager mDialogManager = mock(SystemUIDialogManager.class); private MediaOutputBaseDialogImpl mMediaOutputBaseDialogImpl; private MediaOutputController mMediaOutputController; @@ -77,7 +79,7 @@ public class MediaOutputBaseDialogTest extends SysuiTestCase { public void setUp() { mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE, false, mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter, - mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, mDialogManager); mMediaOutputBaseDialogImpl = new MediaOutputBaseDialogImpl(mContext, mMediaOutputController); mMediaOutputBaseDialogImpl.onCreate(new Bundle()); @@ -167,7 +169,7 @@ public class MediaOutputBaseDialogTest extends SysuiTestCase { class MediaOutputBaseDialogImpl extends MediaOutputBaseDialog { MediaOutputBaseDialogImpl(Context context, MediaOutputController mediaOutputController) { - super(context, mediaOutputController); + super(context, mediaOutputController, mDialogManager); mAdapter = mMediaOutputBaseAdapter; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java index 09ec4ca0e1df..cd26e0d960dc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java @@ -54,6 +54,7 @@ import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.phone.ShadeController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import org.junit.Before; import org.junit.Test; @@ -93,6 +94,7 @@ public class MediaOutputControllerTest extends SysuiTestCase { mock(NotificationEntryManager.class); private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class); private final DialogLaunchAnimator mDialogLaunchAnimator = mock(DialogLaunchAnimator.class); + private final SystemUIDialogManager mDialogManager = mock(SystemUIDialogManager.class); private Context mSpyContext; private MediaOutputController mMediaOutputController; @@ -115,7 +117,7 @@ public class MediaOutputControllerTest extends SysuiTestCase { mMediaOutputController = new MediaOutputController(mSpyContext, TEST_PACKAGE_NAME, false, mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter, - mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, mDialogManager); mLocalMediaManager = spy(mMediaOutputController.mLocalMediaManager); mMediaOutputController.mLocalMediaManager = mLocalMediaManager; MediaDescription.Builder builder = new MediaDescription.Builder(); @@ -159,7 +161,7 @@ public class MediaOutputControllerTest extends SysuiTestCase { public void start_withoutPackageName_verifyMediaControllerInit() { mMediaOutputController = new MediaOutputController(mSpyContext, null, false, mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter, - mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, mDialogManager); mMediaOutputController.start(mCb); @@ -180,7 +182,7 @@ public class MediaOutputControllerTest extends SysuiTestCase { public void stop_withoutPackageName_verifyMediaControllerDeinit() { mMediaOutputController = new MediaOutputController(mSpyContext, null, false, mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter, - mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, mDialogManager); mMediaOutputController.start(mCb); @@ -451,7 +453,7 @@ public class MediaOutputControllerTest extends SysuiTestCase { public void getNotificationLargeIcon_withoutPackageName_returnsNull() { mMediaOutputController = new MediaOutputController(mSpyContext, null, false, mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter, - mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, mDialogManager); assertThat(mMediaOutputController.getNotificationIcon()).isNull(); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java index 8a3ea562269d..ada8d3592012 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java @@ -40,6 +40,7 @@ import com.android.systemui.animation.DialogLaunchAnimator; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.phone.ShadeController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import org.junit.After; import org.junit.Before; @@ -67,6 +68,7 @@ public class MediaOutputDialogTest extends SysuiTestCase { mock(NotificationEntryManager.class); private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class); private final DialogLaunchAnimator mDialogLaunchAnimator = mock(DialogLaunchAnimator.class); + private final SystemUIDialogManager mDialogManager = mock(SystemUIDialogManager.class); private MediaOutputDialog mMediaOutputDialog; private MediaOutputController mMediaOutputController; @@ -76,10 +78,10 @@ public class MediaOutputDialogTest extends SysuiTestCase { public void setUp() { mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE, false, mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter, - mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, mDialogManager); mMediaOutputController.mLocalMediaManager = mLocalMediaManager; mMediaOutputDialog = new MediaOutputDialog(mContext, false, - mMediaOutputController, mUiEventLogger); + mMediaOutputController, mUiEventLogger, mDialogManager); mMediaOutputDialog.show(); when(mLocalMediaManager.getCurrentConnectedDevice()).thenReturn(mMediaDevice); @@ -125,7 +127,7 @@ public class MediaOutputDialogTest extends SysuiTestCase { // and verify if the calling times increases. public void onCreate_ShouldLogVisibility() { MediaOutputDialog testDialog = new MediaOutputDialog(mContext, false, - mMediaOutputController, mUiEventLogger); + mMediaOutputController, mUiEventLogger, mDialogManager); testDialog.show(); testDialog.dismissDialog(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java index e8cd6c88956d..b114452facc3 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java @@ -38,6 +38,7 @@ import com.android.systemui.animation.DialogLaunchAnimator; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.phone.ShadeController; +import com.android.systemui.statusbar.phone.SystemUIDialogManager; import org.junit.After; import org.junit.Before; @@ -66,6 +67,7 @@ public class MediaOutputGroupDialogTest extends SysuiTestCase { mock(NotificationEntryManager.class); private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class); private final DialogLaunchAnimator mDialogLaunchAnimator = mock(DialogLaunchAnimator.class); + private final SystemUIDialogManager mDialogManager = mock(SystemUIDialogManager.class); private MediaOutputGroupDialog mMediaOutputGroupDialog; private MediaOutputController mMediaOutputController; @@ -75,10 +77,10 @@ public class MediaOutputGroupDialogTest extends SysuiTestCase { public void setUp() { mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE, false, mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter, - mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator); + mNotificationEntryManager, mUiEventLogger, mDialogLaunchAnimator, mDialogManager); mMediaOutputController.mLocalMediaManager = mLocalMediaManager; mMediaOutputGroupDialog = new MediaOutputGroupDialog(mContext, false, - mMediaOutputController); + mMediaOutputController, mDialogManager); mMediaOutputGroupDialog.show(); when(mLocalMediaManager.getSelectedMediaDevice()).thenReturn(mMediaDevices); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java index 07debe68e224..c3349f1d70f4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java @@ -381,16 +381,15 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { } @Test - public void onUdfpsConsecutivelyFailedThreeTimes_showBouncer() { + public void onUdfpsConsecutivelyFailedTwoTimes_showBouncer() { // GIVEN UDFPS is supported when(mUpdateMonitor.isUdfpsSupported()).thenReturn(true); - // WHEN udfps fails twice - then don't show the bouncer - mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); + // WHEN udfps fails once - then don't show the bouncer mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean()); - // WHEN udfps fails the third time + // WHEN udfps fails the second time mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); // THEN show the bouncer diff --git a/services/accessibility/java/com/android/server/accessibility/SystemActionPerformer.java b/services/accessibility/java/com/android/server/accessibility/SystemActionPerformer.java index eaf269415fdc..6744ea8e26a5 100644 --- a/services/accessibility/java/com/android/server/accessibility/SystemActionPerformer.java +++ b/services/accessibility/java/com/android/server/accessibility/SystemActionPerformer.java @@ -288,8 +288,6 @@ public class SystemActionPerformer { showGlobalActions(); return true; } - case AccessibilityService.GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN: - return toggleSplitScreen(); case AccessibilityService.GLOBAL_ACTION_LOCK_SCREEN: return lockScreen(); case AccessibilityService.GLOBAL_ACTION_TAKE_SCREENSHOT: @@ -369,21 +367,6 @@ public class SystemActionPerformer { mWindowManagerService.showGlobalActions(); } - private boolean toggleSplitScreen() { - final long token = Binder.clearCallingIdentity(); - try { - StatusBarManagerInternal statusBarService = LocalServices.getService( - StatusBarManagerInternal.class); - if (statusBarService == null) { - return false; - } - statusBarService.toggleSplitScreen(); - } finally { - Binder.restoreCallingIdentity(token); - } - return true; - } - private boolean lockScreen() { mContext.getSystemService(PowerManager.class).goToSleep(SystemClock.uptimeMillis(), PowerManager.GO_TO_SLEEP_REASON_ACCESSIBILITY, 0); diff --git a/services/tests/servicestests/src/com/android/server/accessibility/SystemActionPerformerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/SystemActionPerformerTest.java index 8b6b7c235c44..1d6ed038b86d 100644 --- a/services/tests/servicestests/src/com/android/server/accessibility/SystemActionPerformerTest.java +++ b/services/tests/servicestests/src/com/android/server/accessibility/SystemActionPerformerTest.java @@ -296,14 +296,6 @@ public class SystemActionPerformerTest { } @Test - public void testToggleSplitScreen_legacy() { - setupWithRealContext(); - mSystemActionPerformer.performSystemAction( - AccessibilityService.GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN); - verify(mMockStatusBarManagerInternal).toggleSplitScreen(); - } - - @Test public void testScreenshot_requestsFromScreenshotHelper_legacy() { setupWithMockContext(); mSystemActionPerformer.performSystemAction( |