diff options
author | Adrian Roos <roosa@google.com> | 2014-12-01 14:19:05 +0100 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-12-01 13:21:49 +0000 |
commit | 844c92b444dca7f5ef4d0943fb14e2cbeee49701 (patch) | |
tree | ca62c2a2686a1ef3ce7f520905fcd3c206ffab19 /packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java | |
parent | 07b4a291319ec48a272451789ab0fbbf8d55a050 (diff) | |
download | frameworks_base-844c92b444dca7f5ef4d0943fb14e2cbeee49701.zip frameworks_base-844c92b444dca7f5ef4d0943fb14e2cbeee49701.tar.gz frameworks_base-844c92b444dca7f5ef4d0943fb14e2cbeee49701.tar.bz2 |
Refresh user list a little more eagerly
Unfortunately, we don't get a signal when user restrictions such as
for adding new users change. That means the user switcher UI could get
out of sync and showed the add user option when in fact it couldn't add one.
Also cleans up an unused method.
Bug: 18292723
Change-Id: I56f6f848d967d9d1c11bd6262eacbdb11f90cfe2
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java | 17 |
1 files changed, 5 insertions, 12 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 e5b357a..4ac41a1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -417,18 +417,6 @@ public class UserSwitcherController { } } - public int getSwitchableUsers() { - int result = 0; - ArrayList<UserRecord> users = mController.mUsers; - int N = users.size(); - for (int i = 0; i < N; i++) { - if (users.get(i).info != null) { - result++; - } - } - return result; - } - public Drawable getDrawable(Context context, UserRecord item) { if (item.isAddUser) { return context.getDrawable(R.drawable.ic_add_circle_qs); @@ -436,6 +424,10 @@ public class UserSwitcherController { return UserIcons.getDefaultUserIcon(item.isGuest ? UserHandle.USER_NULL : item.info.id, /* light= */ true); } + + public void refresh() { + mController.refreshUsers(UserHandle.USER_NULL); + } } public static final class UserRecord { @@ -500,6 +492,7 @@ public class UserSwitcherController { } else { v = (UserDetailView) convertView; } + v.refreshAdapter(); return v; } |