summaryrefslogtreecommitdiff
path: root/core/java/android/os/UserHandle.java
diff options
context:
space:
mode:
authorXiaohui Chen <xiaohuic@google.com>2015-10-12 15:56:25 -0700
committerXiaohui Chen <xiaohuic@google.com>2015-10-15 12:09:32 -0700
commit1fa7680c9cd2d6a8ae44ce9e90f2ba5dee47b219 (patch)
tree819472d485937077699ffe645f673fcb7e56bc2a /core/java/android/os/UserHandle.java
parent32ab05c846366c19d148562c9feb5366d1018f37 (diff)
Add UserHandle.isSystem() api
This is added in order to deprecate the isOwner() api. Bug: 24869636 Change-Id: I80a7a5559525faf261b9d9c7a8593e6ff5db4b22
Diffstat (limited to 'core/java/android/os/UserHandle.java')
-rw-r--r--core/java/android/os/UserHandle.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java
index 796addc4c3bc..95da438bc869 100644
--- a/core/java/android/os/UserHandle.java
+++ b/core/java/android/os/UserHandle.java
@@ -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;