Skip to content

Commit 6becbe7

Browse files
committed
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
1 parent d4c25db commit 6becbe7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public class KeyguardUserSwitcher {
4949
private final ViewGroup mUserSwitcher;
5050
private final KeyguardStatusBarView mStatusBarView;
5151
private final Adapter mAdapter;
52-
private final boolean mSimpleUserSwitcher;
5352
private final AppearAnimationUtils mAppearAnimationUtils;
5453
private final KeyguardUserSwitcherScrim mBackground;
5554
private ObjectAnimator mBgAnimator;
55+
private UserSwitcherController mUserSwitcherController;
5656

5757
public KeyguardUserSwitcher(Context context, ViewStub userSwitcher,
5858
KeyguardStatusBarView statusBarView, NotificationPanelView panelView,
@@ -66,15 +66,14 @@ public KeyguardUserSwitcher(Context context, ViewStub userSwitcher,
6666
panelView.setKeyguardUserSwitcher(this);
6767
mAdapter = new Adapter(context, userSwitcherController);
6868
mAdapter.registerDataSetObserver(mDataSetObserver);
69-
mSimpleUserSwitcher = userSwitcherController.isSimpleUserSwitcher();
69+
mUserSwitcherController = userSwitcherController;
7070
mAppearAnimationUtils = new AppearAnimationUtils(context, 400, -0.5f, 0.5f,
7171
AnimationUtils.loadInterpolator(
7272
context, android.R.interpolator.fast_out_slow_in));
7373
} else {
7474
mUserSwitcher = null;
7575
mStatusBarView = null;
7676
mAdapter = null;
77-
mSimpleUserSwitcher = false;
7877
mAppearAnimationUtils = null;
7978
mBackground = null;
8079
}
@@ -95,7 +94,7 @@ public void setKeyguard(boolean keyguard, boolean animate) {
9594
* @see android.os.UserManager#isUserSwitcherEnabled()
9695
*/
9796
private boolean shouldExpandByDefault() {
98-
return mSimpleUserSwitcher;
97+
return (mUserSwitcherController != null) && mUserSwitcherController.isSimpleUserSwitcher();
9998
}
10099

101100
public void show(boolean animate) {

0 commit comments

Comments
 (0)