From 921b71e95f53bb07980ef22b8b6a75ea20490ccd Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Wed, 23 Apr 2014 14:43:23 -0700 Subject: Don't show managed profiles in the user switcher Only show users that you can switch to. Change-Id: Iff6dfccc27230f824d73d02731a045c69419b814 --- .../src/com/android/systemui/settings/UserSwitcherHostView.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'packages/SystemUI/src/com/android/systemui/settings/UserSwitcherHostView.java') diff --git a/packages/SystemUI/src/com/android/systemui/settings/UserSwitcherHostView.java b/packages/SystemUI/src/com/android/systemui/settings/UserSwitcherHostView.java index 87ebcc1..d67e7cb 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/UserSwitcherHostView.java +++ b/packages/SystemUI/src/com/android/systemui/settings/UserSwitcherHostView.java @@ -38,6 +38,7 @@ import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; +import java.util.List; /** * A quick and dirty view to show a user switcher. @@ -118,7 +119,12 @@ public class UserSwitcherHostView extends FrameLayout implements ListView.OnItem public void refreshUsers() { mUserInfo.clear(); - mUserInfo.addAll(mUserManager.getUsers(true)); + List users = mUserManager.getUsers(true); + for (UserInfo user : users) { + if (!user.isManagedProfile()) { + mUserInfo.add(user); + } + } mAdapter.notifyDataSetChanged(); } -- cgit v1.1