Update certain APIs to require the REPORT_USAGE_STATS permission.
Add requirement of either being the system or having the
REPORT_USAGE_STATS permission in order to call any report events related
APIs. This includes the reportChooserSelection and reportUserInteraction
APIs.
Also add the permission to Shell so the APIs can be tested via CTS.
Bug: 296056771
Bug: 218679369
Test: atest CtsUsageStatsTest
Change-Id: I3b28e00b9da73cd4bc051f3c5e03e29a734a1df0
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 323f65f..0364ede 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -167,6 +167,7 @@
<uses-permission android:name="android.permission.FORCE_BACK" />
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
+ <uses-permission android:name="android.permission.REPORT_USAGE_STATS" />
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
<uses-permission android:name="android.permission.INJECT_EVENTS" />
<uses-permission android:name="android.permission.RETRIEVE_WINDOW_CONTENT" />