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

Commit deec962e authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am f671005b: Introduce system API for distinguishing the owner user

* commit 'f671005b75b3d603fb664afb64576c7c59cb5387':
  Introduce system API for distinguishing the owner user
parents 151c4eb4 cbd7a6ec
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.os;

import android.annotation.SystemApi;
import android.util.SparseArray;

import java.io.PrintWriter;
@@ -237,6 +238,16 @@ public final class UserHandle implements Parcelable {
        return getUserId(Process.myUid());
    }

    /**
     * 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
     */
    @SystemApi
    public final boolean isOwner() {
        return this.equals(OWNER);
    }

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