Merge "Add keychain user with special keystore access permissions"

This commit is contained in:
Brian Carlstrom
2011-04-08 15:40:06 -07:00
committed by Android (Google) Code Review
3 changed files with 12 additions and 0 deletions

View File

@@ -493,6 +493,7 @@ static struct user {
{AID_VPN, AID_SYSTEM, GET},
{AID_WIFI, AID_SYSTEM, GET},
{AID_ROOT, AID_SYSTEM, GET},
{AID_KEYCHAIN, AID_SYSTEM, TEST | GET | SAW},
{~0, ~0, TEST | GET | INSERT | DELETE | EXIST | SAW},
};

View File

@@ -91,6 +91,12 @@ public class Process {
*/
public static final int SDCARD_RW_GID = 1015;
/**
* Defines the UID for the KeyChain service.
* @hide
*/
public static final int KEYCHAIN_UID = 1020;
/**
* Defines the UID/GID for the NFC service process.
* @hide

View File

@@ -153,6 +153,7 @@ public class PackageManagerService extends IPackageManager.Stub {
private static final int RADIO_UID = Process.PHONE_UID;
private static final int LOG_UID = Process.LOG_UID;
private static final int NFC_UID = Process.NFC_UID;
private static final int KEYCHAIN_UID = Process.KEYCHAIN_UID;
static final int FIRST_APPLICATION_UID =
Process.FIRST_APPLICATION_UID;
static final int MAX_APPLICATION_UIDS = 1000;
@@ -751,6 +752,10 @@ public class PackageManagerService extends IPackageManager.Stub {
MULTIPLE_APPLICATION_UIDS
? NFC_UID : FIRST_APPLICATION_UID,
ApplicationInfo.FLAG_SYSTEM);
mSettings.addSharedUserLPw("android.uid.keychain",
MULTIPLE_APPLICATION_UIDS
? KEYCHAIN_UID : FIRST_APPLICATION_UID,
ApplicationInfo.FLAG_SYSTEM);
String separateProcesses = SystemProperties.get("debug.separate_processes");
if (separateProcesses != null && separateProcesses.length() > 0) {