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

Commit 4a4701de authored by Yuting Fang's avatar Yuting Fang
Browse files

Hardcode device aware permissions in system server

CAMERA and MICROPHONE are the only two permissions that can be device aware at this moment. Hardcode them in the system server to
enable saving permission states for device aware permissions. Note: this is a temporary change. Once we have a formal API to return
device aware permissions, we should replace the hardcode.

Bug: 292252664
Test: Existing tests pass. Refer to tests in ag/24855864
Change-Id: If706ea1c9dc5b171a5210298dab5ad4812d6bb88
parent 3a4dedd8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@

package com.android.server.permission.access.permission

import android.Manifest
import android.permission.PermissionManager
import android.permission.flags.Flags
import android.util.Slog
import com.android.modules.utils.BinaryXmlPullParser
import com.android.modules.utils.BinaryXmlSerializer
@@ -273,7 +275,12 @@ class DevicePermissionPolicy : SchemePolicy() {

        /** These permissions are supported for virtual devices. */
        // TODO: b/298661870 - Use new API to get the list of device aware permissions.
        val DEVICE_AWARE_PERMISSIONS = emptySet<String>()
        val DEVICE_AWARE_PERMISSIONS =
            if (Flags.deviceAwarePermissionApis()) {
                setOf(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)
            } else {
                emptySet<String>()
            }
    }

    /**