DivestOS/Patches/LineageOS-16.0/android_packages_apps_Settings/0002-Sensors-P2.patch

34 lines
2.0 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MSe1969 <mse1969@posteo.de>
Date: Tue, 19 Mar 2019 22:35:38 +0100
Subject: [PATCH] AppOps details: Add permission icons for new Sensor AppOps
Change-Id: Ifc337517818dcc929a406ed455fb76e6533507ab
---
.../android/settings/applications/appops/AppOpsDetails.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/com/android/settings/applications/appops/AppOpsDetails.java b/src/com/android/settings/applications/appops/AppOpsDetails.java
index 2f210435e8..4f01ceabda 100644
--- a/src/com/android/settings/applications/appops/AppOpsDetails.java
+++ b/src/com/android/settings/applications/appops/AppOpsDetails.java
@@ -115,6 +115,7 @@ public class AppOpsDetails extends SettingsPreferenceFragment {
OP_ICONS.put(AppOpsManager.OP_GPS, R.drawable.ic_perm_location);
OP_ICONS.put(AppOpsManager.OP_MUTE_MICROPHONE, R.drawable.ic_perm_microphone);
OP_ICONS.put(AppOpsManager.OP_NFC_CHANGE, R.drawable.ic_perm_nfc);
+ OP_ICONS.put(AppOpsManager.OP_OTHER_SENSORS, R.drawable.ic_phone_info);
OP_ICONS.put(AppOpsManager.OP_POST_NOTIFICATION, R.drawable.ic_perm_notifications);
OP_ICONS.put(AppOpsManager.OP_READ_CLIPBOARD, R.drawable.ic_perm_clipboard);
OP_ICONS.put(AppOpsManager.OP_RUN_IN_BACKGROUND, R.drawable.ic_perm_background);
@@ -213,6 +214,10 @@ public class AppOpsDetails extends SettingsPreferenceFragment {
if (icon == null && op != -1 && OP_ICONS.containsKey(op)) {
icon = getActivity().getDrawable(OP_ICONS.get(op));
}
+ if (icon == null && op == AppOpsManager.OP_MOTION_SENSORS) {
+ icon = getIconByPermission(AppOpsManager.opToPermission(
+ AppOpsManager.OP_USE_FINGERPRINT));
+ }
if (icon == null) {
Log.e(TAG, "Failed to retrieve icon for permission: " + perm);
} else {