diff options
author | Adrian Roos <roosa@google.com> | 2014-08-21 20:31:41 +0200 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-08-21 20:31:41 +0200 |
commit | bed6e3bedc8845e8f9cd59ad436d140b0875cb6b (patch) | |
tree | 5c0630dc82c702d651e3198833533fa24a47701c /packages | |
parent | 0e7d37656f306a927c9bf622103b8b6af874b7f8 (diff) | |
download | frameworks_base-bed6e3bedc8845e8f9cd59ad436d140b0875cb6b.zip frameworks_base-bed6e3bedc8845e8f9cd59ad436d140b0875cb6b.tar.gz frameworks_base-bed6e3bedc8845e8f9cd59ad436d140b0875cb6b.tar.bz2 |
Always put current user first in user switchers
Bug: 16896343
Change-Id: I2de19b3af5d5b2eed1347b41bccf9c9dc87c2e5b
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java | 8 |
1 files changed, 5 insertions, 3 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 d53aa47..735fbfc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -158,8 +158,9 @@ public class UserSwitcherController { picture = BitmapHelper.createCircularClip( picture, avatarSize, avatarSize); } - records.add(new UserRecord(info, picture, false /* isGuest */, isCurrent, - false /* isAddUser */, false /* isRestricted */)); + int index = isCurrent ? 0 : records.size(); + records.add(index, new UserRecord(info, picture, false /* isGuest */, + isCurrent, false /* isAddUser */, false /* isRestricted */)); } } @@ -182,7 +183,8 @@ public class UserSwitcherController { false /* isAddUser */, createIsRestricted)); } } else { - records.add(guestRecord); + int index = guestRecord.isCurrent ? 0 : records.size(); + records.add(index, guestRecord); } } |