@@ -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