Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5451c559 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Don't show managed profiles in the user switcher"

parents 3c37bcee 921b71e9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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<UserInfo> users = mUserManager.getUsers(true);
        for (UserInfo user : users) {
            if (!user.isManagedProfile()) {
                mUserInfo.add(user);
            }
        }
        mAdapter.notifyDataSetChanged();
    }