Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c2a1a90 authored by Brian Carlstrom's avatar Brian Carlstrom
Browse files

Add keychain user with special keystore access permissions

Change-Id: I02fe5171add62c5cd9f57b01bc137f3bc1cb3a69
parent 5008e92d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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},
};

+6 −0
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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) {