From d42685d5de1dbd6d75b48d42418f370adaa4daef Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 3 Sep 2009 09:25:22 -0400 Subject: [PATCH] Add support for running apps with uid/gid AID_LOG by specifying android.uid.log in the manifest This is needed to allow the BugReportService to start the dumpstate service. Change-Id: I12cab23767c919592da102c654b6b80416717661 Signed-off-by: Mike Lockwood --- core/java/android/os/Process.java | 6 ++++++ services/java/com/android/server/PackageManagerService.java | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index 980cff39801ff..699ddb27606b7 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -73,6 +73,12 @@ public class Process { */ public static final int SHELL_UID = 2000; + /** + * Defines the UID/GID for the log group. + * @hide + */ + public static final int LOG_UID = 1007; + /** * Defines the UID/GID for the WIFI supplicant process. * @hide diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 14cd7a86f0bd3..82cf1bc4dfd82 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -112,6 +112,7 @@ class PackageManagerService extends IPackageManager.Stub { private static final boolean MULTIPLE_APPLICATION_UIDS = true; private static final int RADIO_UID = Process.PHONE_UID; + private static final int LOG_UID = Process.LOG_UID; private static final int FIRST_APPLICATION_UID = Process.FIRST_APPLICATION_UID; private static final int MAX_APPLICATION_UIDS = 1000; @@ -364,6 +365,10 @@ class PackageManagerService extends IPackageManager.Stub { MULTIPLE_APPLICATION_UIDS ? RADIO_UID : FIRST_APPLICATION_UID, ApplicationInfo.FLAG_SYSTEM); + mSettings.addSharedUserLP("android.uid.log", + MULTIPLE_APPLICATION_UIDS + ? LOG_UID : FIRST_APPLICATION_UID, + ApplicationInfo.FLAG_SYSTEM); String separateProcesses = SystemProperties.get("debug.separate_processes"); if (separateProcesses != null && separateProcesses.length() > 0) {