From 6becbe732a987b8adb8348e9486c6abe96e3c201 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Mon, 11 Aug 2014 13:42:32 -0400 Subject: [PATCH] Make simple user switcher notice setting changes. To do this just check the state from the controller (which listens for changes), rather than holding state locally. Bug: 16888009 Change-Id: Ifdbf0055c7aa100941c6504cf3f469031c9c6e43 --- .../systemui/statusbar/policy/KeyguardUserSwitcher.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java index 18583ee401c08..8f0000fd4d882 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java @@ -49,10 +49,10 @@ public class KeyguardUserSwitcher { private final ViewGroup mUserSwitcher; private final KeyguardStatusBarView mStatusBarView; private final Adapter mAdapter; - private final boolean mSimpleUserSwitcher; private final AppearAnimationUtils mAppearAnimationUtils; private final KeyguardUserSwitcherScrim mBackground; private ObjectAnimator mBgAnimator; + private UserSwitcherController mUserSwitcherController; public KeyguardUserSwitcher(Context context, ViewStub userSwitcher, KeyguardStatusBarView statusBarView, NotificationPanelView panelView, @@ -66,7 +66,7 @@ public class KeyguardUserSwitcher { panelView.setKeyguardUserSwitcher(this); mAdapter = new Adapter(context, userSwitcherController); mAdapter.registerDataSetObserver(mDataSetObserver); - mSimpleUserSwitcher = userSwitcherController.isSimpleUserSwitcher(); + mUserSwitcherController = userSwitcherController; mAppearAnimationUtils = new AppearAnimationUtils(context, 400, -0.5f, 0.5f, AnimationUtils.loadInterpolator( context, android.R.interpolator.fast_out_slow_in)); @@ -74,7 +74,6 @@ public class KeyguardUserSwitcher { mUserSwitcher = null; mStatusBarView = null; mAdapter = null; - mSimpleUserSwitcher = false; mAppearAnimationUtils = null; mBackground = null; } @@ -95,7 +94,7 @@ public class KeyguardUserSwitcher { * @see android.os.UserManager#isUserSwitcherEnabled() */ private boolean shouldExpandByDefault() { - return mSimpleUserSwitcher; + return (mUserSwitcherController != null) && mUserSwitcherController.isSimpleUserSwitcher(); } public void show(boolean animate) {