summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Philip P. Moltmann <moltmann@google.com> 2020-08-18 19:39:01 -0700
committer Philip P. Moltmann <moltmann@google.com> 2020-08-19 20:17:49 -0700
commit64c801d344aba147359875a1650003b52987b5b1 (patch)
tree624706532c224e4130c5050fa4336420462b555d
parent94afe73ca26292e33bd1d51a4934e2313a551843 (diff)
Special case location provider camera accesses and show them as
indicators Bug: 162547999 Test: Made location provider access camera and saw privacy chip Change-Id: I5960fdff38b38a0bd8f4d9c9826639cc89a94603
-rw-r--r--packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
index 6347cee7d892..b70142826c1e 100644
--- a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
@@ -19,6 +19,7 @@ package com.android.systemui.appops;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.pm.PackageManager;
+import android.location.LocationManager;
import android.media.AudioManager;
import android.media.AudioRecordingConfiguration;
import android.os.Handler;
@@ -66,6 +67,7 @@ public class AppOpsControllerImpl implements AppOpsController,
private final AppOpsManager mAppOps;
private final AudioManager mAudioManager;
+ private final LocationManager mLocationManager;
private H mBGHandler;
private final List<AppOpsController.Callback> mCallbacks = new ArrayList<>();
private final ArrayMap<Integer, Set<Callback>> mCallbacksByCode = new ArrayMap<>();
@@ -106,6 +108,7 @@ public class AppOpsControllerImpl implements AppOpsController,
mCallbacksByCode.put(OPS[i], new ArraySet<>());
}
mAudioManager = audioManager;
+ mLocationManager = context.getSystemService(LocationManager.class);
dumpManager.registerDumpable(TAG, this);
}
@@ -310,6 +313,11 @@ public class AppOpsControllerImpl implements AppOpsController,
return true;
}
+ if (appOpCode == AppOpsManager.OP_CAMERA && mLocationManager.isProviderPackage(
+ packageName)) {
+ return true;
+ }
+
return isUserSensitive(appOpCode, uid, packageName);
}