From 0d2ac3eb8ee7e961eeb5b0e483f8d3826e0f02d5 Mon Sep 17 00:00:00 2001 From: Yasin Kilicdere Date: Wed, 1 Feb 2023 16:37:38 +0000 Subject: [PATCH] Reset title message in keyguard when onThemeChanged is called. If keyguard is visible when wallpaper colors changed event is propogated, title message of the keyguard was disappearing. This was a flaky janky behaviour since those events were not synced, but it will be consistently visible after fixing b/266711330. Bug: 266940281 Bug: 266711330 Test: Tested manually by delaying user switch events (via ag/21145270) to make the jank consistent, and made sure it's gone after the fix is applied. Test: atest KeyguardSecurityContainerControllerTest Test: atest KeyguardPinBasedInputViewControllerTest Test: atest KeyguardPasswordViewControllerTest Test: atest FrameworksServicesTests:UserControllerTest Change-Id: Ifce985363eee20ab195eb6b2fdfc6dcf175ad9f1 --- .../keyguard/KeyguardPinBasedInputViewController.java | 1 + .../keyguard/KeyguardSecurityContainerController.java | 1 + .../android/keyguard/KeyguardPasswordViewControllerTest.kt | 6 ++++++ .../keyguard/KeyguardPinBasedInputViewControllerTest.java | 6 ++++++ .../keyguard/KeyguardSecurityContainerControllerTest.java | 2 ++ .../core/java/com/android/server/am/UserController.java | 6 +++--- .../src/com/android/server/am/UserControllerTest.java | 6 +++--- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java index 8011efdc1ae7a..92e3641105472 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java @@ -131,6 +131,7 @@ public abstract class KeyguardPinBasedInputViewController { if (isFirst.getAndSet(false)) { @@ -3738,7 +3738,7 @@ class UserController implements Handler.Callback { public void onDismissCancelled() throws RemoteException { mHandler.post(runOnce); } - }, reason); + }, /* message= */ null); } boolean isUsersOnSecondaryDisplaysEnabled() { diff --git a/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java b/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java index b146c2750a05c..18d629ff1d7f7 100644 --- a/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java +++ b/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java @@ -412,7 +412,7 @@ public class UserControllerTest { mInjector.mHandler.clearAllRecordedMessages(); // Verify that continueUserSwitch worked as expected continueAndCompleteUserSwitch(userState, oldUserId, newUserId); - verify(mInjector, times(0)).dismissKeyguard(any(), anyString()); + verify(mInjector, times(0)).dismissKeyguard(any()); verify(mInjector.getWindowManager(), times(1)).stopFreezingScreen(); continueUserSwitchAssertions(oldUserId, TEST_USER_ID, false); verifySystemUserVisibilityChangesNeverNotified(); @@ -433,7 +433,7 @@ public class UserControllerTest { mInjector.mHandler.clearAllRecordedMessages(); // Verify that continueUserSwitch worked as expected continueAndCompleteUserSwitch(userState, oldUserId, newUserId); - verify(mInjector, times(1)).dismissKeyguard(any(), anyString()); + verify(mInjector, times(1)).dismissKeyguard(any()); verify(mInjector.getWindowManager(), times(1)).stopFreezingScreen(); continueUserSwitchAssertions(oldUserId, TEST_USER_ID, false); verifySystemUserVisibilityChangesNeverNotified(); @@ -1148,7 +1148,7 @@ public class UserControllerTest { } @Override - protected void dismissKeyguard(Runnable runnable, String reason) { + protected void dismissKeyguard(Runnable runnable) { runnable.run(); }