summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
index e072b4a3646c..5cb022ef6a45 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
@@ -57,6 +57,11 @@ class PrivacyItemController @Inject constructor(
@VisibleForTesting
internal companion object {
+ val LOCATION_WHITELIST_PKG = arrayOf(
+ "com.android.bluetooth",
+ "com.android.systemui",
+ "com.google.android.gms",
+ )
val OPS_MIC_CAMERA = intArrayOf(AppOpsManager.OP_CAMERA,
AppOpsManager.OP_PHONE_CALL_CAMERA, AppOpsManager.OP_RECORD_AUDIO,
AppOpsManager.OP_PHONE_CALL_MICROPHONE)
@@ -147,7 +152,8 @@ class PrivacyItemController @Inject constructor(
active: Boolean
) {
// Check if we care about this code right now
- if (code in OPS_LOCATION && !locationAvailable) {
+ if (code in OPS_LOCATION && !locationAvailable
+ || packageName in LOCATION_WHITELIST_PKG) {
return
}
val userId = UserHandle.getUserId(uid)
@@ -319,7 +325,8 @@ class PrivacyItemController @Inject constructor(
AppOpsManager.OP_RECORD_AUDIO -> PrivacyType.TYPE_MICROPHONE
else -> return null
}
- if (type == PrivacyType.TYPE_LOCATION && !locationAvailable) {
+ if (type == PrivacyType.TYPE_LOCATION && !locationAvailable
+ || appOpItem.packageName in LOCATION_WHITELIST_PKG) {
return null
}
val app = PrivacyApplication(appOpItem.packageName, appOpItem.uid)