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

Commit 50f91361 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't request profile owner as user if we don't have a valid user"

parents 1b48de56 97eaacba
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -172,12 +172,14 @@ public class UserIconDrawable extends Drawable implements Drawable.Callback {

    public UserIconDrawable setBadgeIfManagedUser(Context context, int userId) {
        Drawable badge = null;
        if (userId != UserHandle.USER_NULL) {
            boolean isManaged = context.getSystemService(DevicePolicyManager.class)
                    .getProfileOwnerAsUser(userId) != null;
            if (isManaged) {
                badge = getDrawableForDisplayDensity(
                        context, com.android.internal.R.drawable.ic_corp_badge_case);
            }
        }
        return setBadge(badge);
    }

+3 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import com.android.internal.util.UserIcons;
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.Utils;
import com.android.systemui.Dependency;
import com.android.systemui.Dumpable;
import com.android.systemui.GuestResumeSessionReceiver;
import com.android.systemui.Prefs;
import com.android.systemui.Prefs.Key;
@@ -70,7 +71,7 @@ import java.util.List;
/**
 * Keeps a list of all users on the device for user switching.
 */
public class UserSwitcherController {
public class UserSwitcherController implements Dumpable {

    private static final String TAG = "UserSwitcherController";
    private static final boolean DEBUG = false;
@@ -549,6 +550,7 @@ public class UserSwitcherController {
        };
    };

    @Override
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("UserSwitcherController state:");
        pw.println("  mLastNonGuestUser=" + mLastNonGuestUser);