summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibXZR <i@xzr.moe>2022-03-04 11:14:40 +0800
committeralk3pInjection <webmaster@raspii.tech>2022-05-07 00:20:58 +0800
commit257b28a615bc85eee42c04a29feca7fa2cb75d11 (patch)
treed11081df77359fbe1be0ab6a79cfad7082d47ba8
parente5cd9a84d44f8e02be93e8bc142510670884e91d (diff)
SystemUI: Do not show location indicator for some packages
The location indicator is frequently showed when wireless headsets are connected, which disturbes a lot especially when watching videos or playing games in landscape mode. Change-Id: I94deddb62b5b48d3eee153880d40c1928e776ebc Signed-off-by: LibXZR <i@xzr.moe>
-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)