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

Commit f04f3005 authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Android (Google) Code Review
Browse files

Merge "Add UserHandle.isSystem() api"

parents d4f2b641 1fa7680c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -25743,7 +25743,8 @@ package android.os {
    ctor public UserHandle(android.os.Parcel);
    method public int describeContents();
    method public int getIdentifier();
    method public boolean isOwner();
    method public deprecated boolean isOwner();
    method public boolean isSystem();
    method public static int myUserId();
    method public static android.os.UserHandle readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
+12 −1
Original line number Diff line number Diff line
@@ -270,13 +270,24 @@ public final class UserHandle implements Parcelable {
     * Returns true if this UserHandle refers to the owner user; false otherwise.
     * @return true if this UserHandle refers to the owner user; false otherwise.
     * @hide
     * TODO: find an alternative to this Api.
     * @deprecated please use {@link #isSystem()} or check for
     * {@link android.content.pm.UserInfo#isPrimary()}
     * {@link android.content.pm.UserInfo#isAdmin()} based on your particular use case.
     */
    @SystemApi
    public boolean isOwner() {
        return this.equals(OWNER);
    }

    /**
     * @return true if this UserHandle refers to the system user; false otherwise.
     * @hide
     */
    @SystemApi
    public boolean isSystem() {
        return this.equals(SYSTEM);
    }

    /** @hide */
    public UserHandle(int h) {
        mHandle = h;