APIs to watch active op changes
System singed components can watch for starting/finishing of
long running app ops. Also protected the APIs to watch op mode
changes with a singature permission for the cross-uid use case.
Test: atest com.android.server.appops.AppOpsActiveWatcherTest
bug:64085448
Change-Id: Id7fe79ce1de4c5690b4f52786424ec5a5d9eb0fa
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 5c8d745..d919d6a 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -143,6 +143,7 @@
android:name="android.permission.MANAGE_BLUETOOTH_WHEN_PERMISSION_REVIEW_REQUIRED" />
<uses-permission
android:name="android.permission.MANAGE_WIFI_WHEN_PERMISSION_REVIEW_REQUIRED" />
+ <uses-permission android:name="android.permission.WATCH_APPOPS" />
<application android:label="@string/app_label"
android:defaultToDeviceProtectedStorage="true"
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 35c4d59..3d49e5c 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -202,6 +202,9 @@
<!-- to change themes - light or dark -->
<uses-permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES" />
+ <!-- Listen app op changes -->
+ <uses-permission android:name="android.permission.WATCH_APPOPS" />
+
<application
android:name=".SystemUIApplication"
android:persistent="true"