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

Commit 984f90a3 authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Automerger Merge Worker
Browse files

Treat phone call mic/camera similar to other mic/camera app-ops am: 94afe73c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12396941

Change-Id: I38d18f60d0f2bd74e7c1c34818fd0fd7fbc9cec0
parents 67cfa225 94afe73c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -82,8 +82,10 @@ public class AppOpsControllerImpl implements AppOpsController,

    protected static final int[] OPS = new int[] {
            AppOpsManager.OP_CAMERA,
            AppOpsManager.OP_PHONE_CALL_CAMERA,
            AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
            AppOpsManager.OP_RECORD_AUDIO,
            AppOpsManager.OP_PHONE_CALL_MICROPHONE,
            AppOpsManager.OP_COARSE_LOCATION,
            AppOpsManager.OP_FINE_LOCATION
    };
@@ -302,7 +304,9 @@ public class AppOpsControllerImpl implements AppOpsController,
        // does not correspond to a platform permission
        // which may be user sensitive, so for now always show it to the user.
        if (appOpCode == AppOpsManager.OP_SYSTEM_ALERT_WINDOW
                || appOpCode == AppOpsManager.OP_MONITOR_HIGH_POWER_LOCATION) {
                || appOpCode == AppOpsManager.OP_MONITOR_HIGH_POWER_LOCATION
                || appOpCode == AppOpsManager.OP_PHONE_CALL_CAMERA
                || appOpCode == AppOpsManager.OP_PHONE_CALL_MICROPHONE) {
            return true;
        }

+5 −2
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ class PrivacyItemController @Inject constructor(
    @VisibleForTesting
    internal companion object {
        val OPS_MIC_CAMERA = intArrayOf(AppOpsManager.OP_CAMERA,
                AppOpsManager.OP_RECORD_AUDIO)
                AppOpsManager.OP_PHONE_CALL_CAMERA, AppOpsManager.OP_RECORD_AUDIO,
                AppOpsManager.OP_PHONE_CALL_MICROPHONE)
        val OPS_LOCATION = intArrayOf(
                AppOpsManager.OP_COARSE_LOCATION,
                AppOpsManager.OP_FINE_LOCATION)
@@ -248,9 +249,11 @@ class PrivacyItemController @Inject constructor(

    private fun toPrivacyItem(appOpItem: AppOpItem): PrivacyItem? {
        val type: PrivacyType = when (appOpItem.code) {
            AppOpsManager.OP_PHONE_CALL_CAMERA,
            AppOpsManager.OP_CAMERA -> PrivacyType.TYPE_CAMERA
            AppOpsManager.OP_COARSE_LOCATION -> PrivacyType.TYPE_LOCATION
            AppOpsManager.OP_COARSE_LOCATION,
            AppOpsManager.OP_FINE_LOCATION -> PrivacyType.TYPE_LOCATION
            AppOpsManager.OP_PHONE_CALL_MICROPHONE,
            AppOpsManager.OP_RECORD_AUDIO -> PrivacyType.TYPE_MICROPHONE
            else -> return null
        }