summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index b6a32343448e..cedc3c7eef2f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -362,6 +362,19 @@ public class UserSwitcherController {
switchToUserId(id);
}
+ public void switchTo(int userId) {
+ final int count = mUsers.size();
+ for (int i = 0; i < count; ++i) {
+ UserRecord record = mUsers.get(i);
+ if (record.info != null && record.info.id == userId) {
+ switchTo(record);
+ return;
+ }
+ }
+
+ Log.e(TAG, "Couldn't switch to user, id=" + userId);
+ }
+
private void switchToUserId(int id) {
try {
pauseRefreshUsers();