DivestOS/Patches/LineageOS-15.1/android_packages_apps_Settings/0005-Sensors-P2.patch

34 lines
1.9 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MSe1969 <mse1969@posteo.de>
Date: Wed, 20 Mar 2019 08:42:49 +0100
Subject: [PATCH] AppOps details: Add permission icons for new Sensor AppOps
Change-Id: Ic68954f30ba8214041c685a4efca4fc65b99ddaf
---
src/com/android/settings/applications/AppOpsDetails.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/com/android/settings/applications/AppOpsDetails.java b/src/com/android/settings/applications/AppOpsDetails.java
index 220bdff005..db948ab5cd 100644
--- a/src/com/android/settings/applications/AppOpsDetails.java
+++ b/src/com/android/settings/applications/AppOpsDetails.java
@@ -111,6 +111,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_devices_other);
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);
@@ -205,6 +206,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 {