summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibXZR <i@xzr.moe>2022-03-04 11:14:40 +0800
committeralk3pInjection <webmaster@raspii.tech>2022-03-06 23:15:56 +0800
commit396e4a81b51ae6c3f19950274fc107c20601ee07 (patch)
treea361380468272635009283e1b966f822e7b13eba
parentf47e918c7e6f600523ee2c7196fcdbc2212c6995 (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.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)