DivestOS/Patches/LineageOS-15.1/android_packages_apps_Settings/0005-Sensors-P2.patch
Tad 84c7d230ab Permission for sensors access patches from @MSe1969
Signed-off-by: Tad <tad@spotco.us>
2021-09-24 23:35:33 -04:00

38 lines
2.0 KiB
Diff

From 4467cf678f558ee4b04fb1b9345a43f87b51d681 Mon Sep 17 00:00:00 2001
From: MSe1969 <mse1969@posteo.de>
Date: Wed, 20 Mar 2019 08:42:49 +0100
Subject: [PATCH 2/2] 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 {
--
2.31.1