diff options
| author | 2021-04-23 16:15:03 -0700 | |
|---|---|---|
| committer | 2021-04-26 11:56:05 -0700 | |
| commit | 1c3a6056f176a29904cac6a9fbca1595b443e6f6 (patch) | |
| tree | 82dabff51225f1ec9c2954a6b7aa7236fe305178 | |
| parent | 181dc2acf032594c36185e6d7e6df974873ffd1b (diff) | |
Update user icon when dark theme toggled
Previously, after toggling dark theme on/off, the keyguard user icon
would not update until it was clicked.
Also, remove unused private field mDarkAmount
Bug: 184204785
Test: With config_keyguard_user_switch_opens_qs_details=true, toggle
dark theme on/off and observe keyguard user icon
Change-Id: Ic47ed44c0c970d050178ce2c26aaccb661286ece
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java index d52ea890af7e..cda453ad2521 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java @@ -68,6 +68,7 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie private UserSwitcherController.BaseUserAdapter mAdapter; private final KeyguardStateController mKeyguardStateController; protected final SysuiStatusBarStateController mStatusBarStateController; + private final ConfigurationController mConfigurationController; private final KeyguardVisibilityHelper mKeyguardVisibilityHelper; private final KeyguardUserDetailAdapter mUserDetailAdapter; private NotificationPanelViewController mNotificationPanelViewController; @@ -76,7 +77,6 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie // State info for the user switch and keyguard private int mBarState; - private float mDarkAmount; private final StatusBarStateController.StateListener mStatusBarStateListener = new StatusBarStateController.StateListener() { @@ -97,6 +97,15 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie } }; + private ConfigurationController.ConfigurationListener + mConfigurationListener = new ConfigurationController.ConfigurationListener() { + + @Override + public void onUiModeChanged() { + updateView(true); + } + }; + @Inject public KeyguardQsUserSwitchController( UserAvatarView view, @@ -106,6 +115,7 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie ScreenLifecycle screenLifecycle, UserSwitcherController userSwitcherController, KeyguardStateController keyguardStateController, + ConfigurationController configurationController, SysuiStatusBarStateController statusBarStateController, DozeParameters dozeParameters, UiEventLogger uiEventLogger) { @@ -117,6 +127,7 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie mScreenLifecycle = screenLifecycle; mUserSwitcherController = userSwitcherController; mKeyguardStateController = keyguardStateController; + mConfigurationController = configurationController; mStatusBarStateController = statusBarStateController; mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, keyguardStateController, dozeParameters); @@ -153,8 +164,6 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie R.string.accessibility_quick_settings_choose_user_action))); } }); - - updateView(true /* forceUpdate */); } @Override @@ -163,6 +172,8 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie mAdapter.registerDataSetObserver(mDataSetObserver); mDataSetObserver.onChanged(); mStatusBarStateController.addCallback(mStatusBarStateListener); + mConfigurationController.addCallback(mConfigurationListener); + updateView(true /* forceUpdate */); } @Override @@ -171,6 +182,7 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie mAdapter.unregisterDataSetObserver(mDataSetObserver); mStatusBarStateController.removeCallback(mStatusBarStateListener); + mConfigurationController.removeCallback(mConfigurationListener); } public final DataSetObserver mDataSetObserver = new DataSetObserver() { |