Loading packages/SystemUI/res/layout/status_bar_expanded_header.xml +2 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ android:layout_alignParentEnd="true" android:background="@drawable/ripple_drawable" > <ImageView android:id="@+id/multi_user_avatar" android:layout_width="24dp" android:layout_height="24dp" android:layout_width="@dimen/multi_user_avatar_expanded_size" android:layout_height="@dimen/multi_user_avatar_expanded_size" android:layout_gravity="center" android:scaleType="centerInside"/> </com.android.systemui.statusbar.phone.MultiUserSwitch> Loading packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,9 @@ <!-- The width of user avatar when on Keyguard --> <dimen name="multi_user_avatar_keyguard_size">22dp</dimen> <!-- The width of user avatar when expanded --> <dimen name="multi_user_avatar_expanded_size">24dp</dimen> <!-- The font size of the time when collapsed in QS --> <dimen name="qs_time_collapsed_size">14sp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java +10 −9 Original line number Diff line number Diff line Loading @@ -67,15 +67,18 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener @Override public void onClick(View v) { if (opensUserSwitcherWhenClicked()) { if (UserSwitcherController.isUserSwitcherAvailable(mUserManager)) { if (mKeyguardMode) { if (mKeyguardUserSwitcher != null) { mKeyguardUserSwitcher.show(true /* animate */); } } else { if (mQsPanel != null) { mQsPanel.showDetailAdapter(true, mQsPanel.getHost().getUserSwitcherController().userDetailAdapter); UserSwitcherController userSwitcherController = mQsPanel.getHost().getUserSwitcherController(); if (userSwitcherController != null) { mQsPanel.showDetailAdapter(true, userSwitcherController.userDetailAdapter); } } } } else { Loading @@ -92,13 +95,15 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener if (isClickable()) { String text; if (opensUserSwitcherWhenClicked()) { if (UserSwitcherController.isUserSwitcherAvailable(mUserManager)) { String currentUser = null; if (mQsPanel != null) { UserSwitcherController controller = mQsPanel.getHost() .getUserSwitcherController(); if (controller != null) { currentUser = controller.getCurrentUserName(mContext); } } if (TextUtils.isEmpty(currentUser)) { text = mContext.getString(R.string.accessibility_multi_user_switch_switcher); } else { Loading @@ -121,8 +126,4 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener return false; } private boolean opensUserSwitcherWhenClicked() { UserManager um = UserManager.get(getContext()); return UserManager.supportsMultipleUsers() && um.isUserSwitcherEnabled(); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +6 −3 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import android.os.PowerManager; import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.RankingMap; Loading Loading @@ -853,8 +854,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mKeyguardBottomArea.setAccessibilityController(mAccessibilityController); mNextAlarmController = new NextAlarmController(mContext); mKeyguardMonitor = new KeyguardMonitor(); if (UserSwitcherController.isUserSwitcherAvailable(UserManager.get(mContext))) { mUserSwitcherController = new UserSwitcherController(mContext, mKeyguardMonitor); } mKeyguardUserSwitcher = new KeyguardUserSwitcher(mContext, (ViewStub) mStatusBarWindow.findViewById(R.id.keyguard_user_switcher), mKeyguardStatusBar, mNotificationPanel, mUserSwitcherController); Loading Loading @@ -1510,7 +1512,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // If the user switcher is simple then disable QS during setup because // the user intends to use the lock screen user switcher, QS in not needed. mNotificationPanel.setQsExpansionEnabled(isDeviceProvisioned() && (!mUserSwitcherController.isSimpleUserSwitcher() || mUserSetup)); && (mUserSetup || mUserSwitcherController == null || !mUserSwitcherController.isSimpleUserSwitcher())); mShadeUpdates.check(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java +3 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,9 @@ public class KeyguardUserSwitcher { public KeyguardUserSwitcher(Context context, ViewStub userSwitcher, KeyguardStatusBarView statusBarView, NotificationPanelView panelView, UserSwitcherController userSwitcherController) { if (context.getResources().getBoolean(R.bool.config_keyguardUserSwitcher) || ALWAYS_ON) { boolean keyguardUserSwitcherEnabled = context.getResources().getBoolean(R.bool.config_keyguardUserSwitcher) || ALWAYS_ON; if (userSwitcherController != null && keyguardUserSwitcherEnabled) { mUserSwitcherContainer = (Container) userSwitcher.inflate(); mUserSwitcher = (ViewGroup) mUserSwitcherContainer.findViewById(R.id.keyguard_user_switcher_inner); Loading Loading
packages/SystemUI/res/layout/status_bar_expanded_header.xml +2 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ android:layout_alignParentEnd="true" android:background="@drawable/ripple_drawable" > <ImageView android:id="@+id/multi_user_avatar" android:layout_width="24dp" android:layout_height="24dp" android:layout_width="@dimen/multi_user_avatar_expanded_size" android:layout_height="@dimen/multi_user_avatar_expanded_size" android:layout_gravity="center" android:scaleType="centerInside"/> </com.android.systemui.statusbar.phone.MultiUserSwitch> Loading
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,9 @@ <!-- The width of user avatar when on Keyguard --> <dimen name="multi_user_avatar_keyguard_size">22dp</dimen> <!-- The width of user avatar when expanded --> <dimen name="multi_user_avatar_expanded_size">24dp</dimen> <!-- The font size of the time when collapsed in QS --> <dimen name="qs_time_collapsed_size">14sp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java +10 −9 Original line number Diff line number Diff line Loading @@ -67,15 +67,18 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener @Override public void onClick(View v) { if (opensUserSwitcherWhenClicked()) { if (UserSwitcherController.isUserSwitcherAvailable(mUserManager)) { if (mKeyguardMode) { if (mKeyguardUserSwitcher != null) { mKeyguardUserSwitcher.show(true /* animate */); } } else { if (mQsPanel != null) { mQsPanel.showDetailAdapter(true, mQsPanel.getHost().getUserSwitcherController().userDetailAdapter); UserSwitcherController userSwitcherController = mQsPanel.getHost().getUserSwitcherController(); if (userSwitcherController != null) { mQsPanel.showDetailAdapter(true, userSwitcherController.userDetailAdapter); } } } } else { Loading @@ -92,13 +95,15 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener if (isClickable()) { String text; if (opensUserSwitcherWhenClicked()) { if (UserSwitcherController.isUserSwitcherAvailable(mUserManager)) { String currentUser = null; if (mQsPanel != null) { UserSwitcherController controller = mQsPanel.getHost() .getUserSwitcherController(); if (controller != null) { currentUser = controller.getCurrentUserName(mContext); } } if (TextUtils.isEmpty(currentUser)) { text = mContext.getString(R.string.accessibility_multi_user_switch_switcher); } else { Loading @@ -121,8 +126,4 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener return false; } private boolean opensUserSwitcherWhenClicked() { UserManager um = UserManager.get(getContext()); return UserManager.supportsMultipleUsers() && um.isUserSwitcherEnabled(); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +6 −3 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import android.os.PowerManager; import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.RankingMap; Loading Loading @@ -853,8 +854,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mKeyguardBottomArea.setAccessibilityController(mAccessibilityController); mNextAlarmController = new NextAlarmController(mContext); mKeyguardMonitor = new KeyguardMonitor(); if (UserSwitcherController.isUserSwitcherAvailable(UserManager.get(mContext))) { mUserSwitcherController = new UserSwitcherController(mContext, mKeyguardMonitor); } mKeyguardUserSwitcher = new KeyguardUserSwitcher(mContext, (ViewStub) mStatusBarWindow.findViewById(R.id.keyguard_user_switcher), mKeyguardStatusBar, mNotificationPanel, mUserSwitcherController); Loading Loading @@ -1510,7 +1512,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // If the user switcher is simple then disable QS during setup because // the user intends to use the lock screen user switcher, QS in not needed. mNotificationPanel.setQsExpansionEnabled(isDeviceProvisioned() && (!mUserSwitcherController.isSimpleUserSwitcher() || mUserSetup)); && (mUserSetup || mUserSwitcherController == null || !mUserSwitcherController.isSimpleUserSwitcher())); mShadeUpdates.check(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java +3 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,9 @@ public class KeyguardUserSwitcher { public KeyguardUserSwitcher(Context context, ViewStub userSwitcher, KeyguardStatusBarView statusBarView, NotificationPanelView panelView, UserSwitcherController userSwitcherController) { if (context.getResources().getBoolean(R.bool.config_keyguardUserSwitcher) || ALWAYS_ON) { boolean keyguardUserSwitcherEnabled = context.getResources().getBoolean(R.bool.config_keyguardUserSwitcher) || ALWAYS_ON; if (userSwitcherController != null && keyguardUserSwitcherEnabled) { mUserSwitcherContainer = (Container) userSwitcher.inflate(); mUserSwitcher = (ViewGroup) mUserSwitcherContainer.findViewById(R.id.keyguard_user_switcher_inner); Loading