Restrict visibility of SHORTCUT_INVOCATION events.

UsageStats will not return SHORTCUT_INVOCATION events to callers
of #queryEvents and #queryEventsForUser if they don't have visibility,
as defined by ShortcutService#hasShortcutHostPermission.

Also, add ACCESS_SHORTCUT permission to shell for CTS test and add the
ShortcutManagerUsageTest to postsubmit.

Bug: 145549490
Test: atest android.app.usage.cts.UsageStatsTest
Test: atest android.content.pm.cts.shortcutmanager.ShortcutManagerUsageTest
Change-Id: I2a69f061c35c31035a5d0381ab2f42029ec4fffc
This commit is contained in:
Varun Shah
2020-01-07 16:33:22 -08:00
parent 1b1bdd3642
commit 01f6f26b54
5 changed files with 60 additions and 11 deletions

View File

@@ -240,6 +240,9 @@
<!-- Allows setting brightness from the shell -->
<uses-permission android:name="android.permission.CONTROL_DISPLAY_BRIGHTNESS"/>
<!-- Permission required for CTS test - ShortcutManagerUsageTest -->
<uses-permission android:name="android.permission.ACCESS_SHORTCUTS"/>
<!-- Permissions required to test ambient display. -->
<uses-permission android:name="android.permission.READ_DREAM_STATE"/>
<uses-permission android:name="android.permission.WRITE_DREAM_STATE"/>