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

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

Change-Id: I38d18f60d0f2bd74e7c1c34818fd0fd7fbc9cec0
This commit is contained in:
Philip P. Moltmann
2020-08-20 19:50:29 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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
}