diff options
Diffstat (limited to 'core/java/android/os/UserId.java')
-rw-r--r-- | core/java/android/os/UserId.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/os/UserId.java b/core/java/android/os/UserId.java index cf6ce2c..8bf6c6e 100644 --- a/core/java/android/os/UserId.java +++ b/core/java/android/os/UserId.java @@ -105,4 +105,12 @@ public final class UserId { public static final int getAppId(int uid) { return uid % PER_USER_RANGE; } + + /** + * Returns the user id of the current process + * @return user id of the current process + */ + public static final int myUserId() { + return getUserId(Process.myUid()); + } } |