Merge "Expose UserHandle.getSharedAppGid as a system API."

This commit is contained in:
TreeHugger Robot
2022-06-01 23:24:53 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 1 deletions

View File

@@ -9781,6 +9781,7 @@ package android.os {
method @NonNull public static String formatUid(int);
method public static int getAppId(int);
method public int getIdentifier();
method public static int getSharedAppGid(int);
method public int getUid(int);
method @Deprecated public boolean isOwner();
method public boolean isSystem();

View File

@@ -404,7 +404,12 @@ public final class UserHandle implements Parcelable {
return getUid(userId, Process.SHARED_USER_GID);
}
/** @hide */
/**
* Returns the gid shared between all users with the app that this uid represents, or -1 if the
* uid is invalid.
* @hide
*/
@SystemApi
public static int getSharedAppGid(int uid) {
return getSharedAppGid(getUserId(uid), getAppId(uid));
}