/** * Returns whether the current process is in an isolated sandbox. * * @hide */ public static final boolean isIsolated() { int uid = UserHandle.getAppId(myUid()); return uid >= FIRST_ISOLATED_UID && uid <= LAST_ISOLATED_UID; }
/** * Returns this process's user handle. This is the user the process is running under. It is * distinct from {@link #myUid()} in that a particular user will have multiple distinct apps * running under it each with their own uid. */ public static final UserHandle myUserHandle() { return new UserHandle(UserHandle.getUserId(myUid())); }