Assign AID_EVERYONE gid to newly-created processes
Change-Id: I0ec45e07d77a4e6a47b6ba0d761c8375f433f528
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 96f42cc..5617b80 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -146,6 +146,12 @@
public static final int LAST_ISOLATED_UID = 99999;
/**
+ * Defines the gid shared by all applications running under the same profile.
+ * @hide
+ */
+ public static final int SHARED_USER_GID = 9997;
+
+ /**
* First gid for applications to share resources. Used when forward-locking
* is enabled but all UserHandles need to be able to read the resources.
* @hide
diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java
index 6e693a4..914c170 100644
--- a/core/java/android/os/UserHandle.java
+++ b/core/java/android/os/UserHandle.java
@@ -145,6 +145,14 @@
}
/**
+ * Returns the gid shared between all apps with this userId.
+ * @hide
+ */
+ public static final int getUserGid(int userId) {
+ return getUid(userId, Process.SHARED_USER_GID);
+ }
+
+ /**
* Returns the shared app gid for a given uid or appId.
* @hide
*/