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

Commit b75199ae authored by Brahim Chikhaoui's avatar Brahim Chikhaoui Committed by Android (Google) Code Review
Browse files

Merge "Prevent switching to non-full users with supportsSwitchToByUser" into main

parents c9609abc f07f1e54
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1216,7 +1216,7 @@ package android.content.pm {
    method public boolean isRestricted();
    method @FlaggedApi("android.multiuser.allow_supervising_profile") public boolean isSupervisingProfile();
    method public boolean supportsSwitchTo();
    method @Deprecated public boolean supportsSwitchToByUser();
    method public boolean supportsSwitchToByUser();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.UserInfo> CREATOR;
    field public static final int FLAG_ADMIN = 2; // 0x2
+6 −4
Original line number Diff line number Diff line
@@ -482,13 +482,15 @@ public class UserInfo implements Parcelable {
    }

    /**
     * @return true if this user can be switched to by end user through UI.
     * @deprecated Use {@link UserInfo#supportsSwitchTo} instead.
     * @return true if this user can be switched to by an end user through the UI.
     * This method checks if supportsSwitchTo() is true AND the user is a full user.
     * It specifically excludes the headless system user, as switching to that user
     * is typically a framework-level operation and not available to regular users
     * via the UI.
     */
    @Deprecated
    @android.ravenwood.annotation.RavenwoodThrow
    public boolean supportsSwitchToByUser() {
        return supportsSwitchTo();
        return supportsSwitchTo() && isFull();
    }

    /**