summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt12
1 files changed, 10 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..cdc5b42932ec 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
@@ -57,6 +57,12 @@ class PrivacyItemController @Inject constructor(
@VisibleForTesting
internal companion object {
+ val LOCATION_WHITELIST_PKG = arrayOf(
+ "com.android.bluetooth",
+ "com.android.systemui",
+ "com.google.android.gms",
+ "com.qualcomm.location",
+ )
val OPS_MIC_CAMERA = intArrayOf(AppOpsManager.OP_CAMERA,
AppOpsManager.OP_PHONE_CALL_CAMERA, AppOpsManager.OP_RECORD_AUDIO,
AppOpsManager.OP_PHONE_CALL_MICROPHONE)
@@ -147,7 +153,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 +326,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)