Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +13 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public class KeyguardStatusBarView extends RelativeLayout private BatteryController mBatteryController; private KeyguardUserSwitcher mKeyguardUserSwitcher; private UserSwitcherController mUserSwitcherController; private int mSystemIconsSwitcherHiddenExpandedMargin; private View mSystemIconsContainer; Loading Loading @@ -149,6 +150,15 @@ public class KeyguardStatusBarView extends RelativeLayout } else if (mMultiUserSwitch.getParent() == this && mKeyguardUserSwitcherShowing) { removeView(mMultiUserSwitch); } if (mKeyguardUserSwitcher == null) { // If we have no keyguard switcher, the screen width is under 600dp. In this case, // we don't show the multi-user avatar unless there is more than 1 user on the device. if (mUserSwitcherController.getSwitchableUserCount() > 1) { mMultiUserSwitch.setVisibility(View.VISIBLE); } else { mMultiUserSwitch.setVisibility(View.GONE); } } mBatteryLevel.setVisibility(mBatteryCharging ? View.VISIBLE : View.GONE); } Loading Loading @@ -187,6 +197,7 @@ public class KeyguardStatusBarView extends RelativeLayout } public void setUserSwitcherController(UserSwitcherController controller) { mUserSwitcherController = controller; mMultiUserSwitch.setUserSwitcherController(controller); } Loading Loading @@ -287,6 +298,8 @@ public class KeyguardStatusBarView extends RelativeLayout mSystemIconsSuperContainer.animate().cancel(); mMultiUserSwitch.animate().cancel(); mMultiUserSwitch.setAlpha(1f); } else { updateVisibilities(); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +12 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,18 @@ public class UserSwitcherController { Log.e(TAG, "Couldn't switch to user, id=" + userId); } public int getSwitchableUserCount() { int count = 0; final int N = mUsers.size(); for (int i = 0; i < N; ++i) { UserRecord record = mUsers.get(i); if (record.info != null && record.info.supportsSwitchTo()) { count++; } } return count; } private void switchToUserId(int id) { try { pauseRefreshUsers(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +13 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public class KeyguardStatusBarView extends RelativeLayout private BatteryController mBatteryController; private KeyguardUserSwitcher mKeyguardUserSwitcher; private UserSwitcherController mUserSwitcherController; private int mSystemIconsSwitcherHiddenExpandedMargin; private View mSystemIconsContainer; Loading Loading @@ -149,6 +150,15 @@ public class KeyguardStatusBarView extends RelativeLayout } else if (mMultiUserSwitch.getParent() == this && mKeyguardUserSwitcherShowing) { removeView(mMultiUserSwitch); } if (mKeyguardUserSwitcher == null) { // If we have no keyguard switcher, the screen width is under 600dp. In this case, // we don't show the multi-user avatar unless there is more than 1 user on the device. if (mUserSwitcherController.getSwitchableUserCount() > 1) { mMultiUserSwitch.setVisibility(View.VISIBLE); } else { mMultiUserSwitch.setVisibility(View.GONE); } } mBatteryLevel.setVisibility(mBatteryCharging ? View.VISIBLE : View.GONE); } Loading Loading @@ -187,6 +197,7 @@ public class KeyguardStatusBarView extends RelativeLayout } public void setUserSwitcherController(UserSwitcherController controller) { mUserSwitcherController = controller; mMultiUserSwitch.setUserSwitcherController(controller); } Loading Loading @@ -287,6 +298,8 @@ public class KeyguardStatusBarView extends RelativeLayout mSystemIconsSuperContainer.animate().cancel(); mMultiUserSwitch.animate().cancel(); mMultiUserSwitch.setAlpha(1f); } else { updateVisibilities(); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +12 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,18 @@ public class UserSwitcherController { Log.e(TAG, "Couldn't switch to user, id=" + userId); } public int getSwitchableUserCount() { int count = 0; final int N = mUsers.size(); for (int i = 0; i < N; ++i) { UserRecord record = mUsers.get(i); if (record.info != null && record.info.supportsSwitchTo()) { count++; } } return count; } private void switchToUserId(int id) { try { pauseRefreshUsers(); Loading