From 07d87012c17752ff949968be7d31b6fb0998ce36 Mon Sep 17 00:00:00 2001 From: Jordan Demeulenaere Date: Wed, 13 Apr 2022 11:33:24 +0200 Subject: [PATCH] Fix keyguard dismiss animation with occludable activities. See b/203044476#comment27 for before/after videos. Test: Manual Bug: 203044476 Change-Id: Ie80187a5ca9b61b8178bbe977bf252db654d9fa4 Merged-In: Ie80187a5ca9b61b8178bbe977bf252db654d9fa4 --- .../keyguard_bottom_affordance_bg.xml | 22 +++++++------------ .../statusbar/phone/CentralSurfacesImpl.java | 6 +++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/SystemUI/res/drawable/keyguard_bottom_affordance_bg.xml b/packages/SystemUI/res/drawable/keyguard_bottom_affordance_bg.xml index 3a08a7111d9a2..41123c84ded13 100644 --- a/packages/SystemUI/res/drawable/keyguard_bottom_affordance_bg.xml +++ b/packages/SystemUI/res/drawable/keyguard_bottom_affordance_bg.xml @@ -16,19 +16,13 @@ * limitations under the License. */ --> - - - - - - - - - - + android:shape="rectangle"> + + + + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 485c01814f79e..96acd6a8e85f9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -2511,6 +2511,12 @@ public class CentralSurfacesImpl extends CoreStartable implements animate, intent.getPackage(), (adapter) -> { ActivityOptions options = new ActivityOptions( CentralSurfaces.getActivityOptions(mDisplayId, adapter)); + + // We know that the intent of the caller is to dismiss the keyguard and + // this runnable is called right after the keyguard is solved, so we tell + // WM that we should dismiss it to avoid flickers when opening an activity + // that can also be shown over the keyguard. + options.setDismissKeyguard(); options.setDisallowEnterPictureInPictureWhileLaunching( disallowEnterPictureInPictureWhileLaunching); if (CameraIntents.isInsecureCameraIntent(intent)) {