History log of /frameworks/base/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4d8d32cb6af4b9ea2f8d320f4a52561413d146bd 19-Jan-2018 Jorim Jaggi <jjaggi@google.com> Fix issue with permission check for shortcuts and pendingIntent

When launching a PendingIntent, we have two sets of activity
options: One supplied from the caller that obtained the
pending intent, and those supplied from the caller that is
sending it. We need to perform the permission check depending
on which caller the options are coming from.

For that, we introduce SafeActivityOptions that records the
callingPid/callingUid when obtaining it and checks for the
permissions with the correct callingPid/callingUid, and
also supports merging both activity options.

In addition to that, fix shortcuts by not clearing caller
identity in LauncherAppsService.

Test: go/wm-smoke
Test: Install custom launcher APK with animation for shortcuts
enabled, make sure launch works properly.
Bug: 64674361

Change-Id: I9a854d43c65c8fa69bf16ccfbed86e8e681a095b
/frameworks/base/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java