OSDN Git Service

Don't allow PI-based starts and trampolines when sender
authorMichal Karpinski <mkarpinski@google.com>
Tue, 16 Apr 2019 13:02:46 +0000 (14:02 +0100)
committerMichal Karpinski <mkarpinski@google.com>
Tue, 16 Apr 2019 14:50:13 +0000 (15:50 +0100)
commit2927b542ab9d6e63f61c582c6a027da3efd9dead
tree6032710dc8369b13d011850422428e56faa9dd71
parent949305fe52816c6a51454cc8aee56fee8486eeac
Don't allow PI-based starts and trampolines when sender
is SYSTEM_UID and it happens to pass foregroundness check
at the time of sending

It could lead to abuses like directing the user to Settings app
and then giving a PI through any API, so that app could open
activity/trampoline due to Settings app (SYSTEM_UID) being fg.

PI-based starts where sender is SYSTEM_UID will no longer be
supported based on foregroundness check. Any such starts need
to now be explicitly whitelisted (see b/124858756).

Also, ignore windows of type TYPE_APPLICATION_STARTING in
isAnyNonToastWindowVisibleForUid() check.

Bug: 129563343
Test: atest WmTests:ActivityStarterTests
Test: atest BackgroundActivityLaunchTest
Test: atest CtsActivityManagerDeviceTestCases:ActivityStarterTests
Test: atest WmTests:RootWindowContainerTests
Change-Id: I563f71f0b1c7922d8c675d2e4feed909f43446be
services/core/java/com/android/server/am/PendingIntentRecord.java
services/core/java/com/android/server/wm/ActivityStarter.java
services/core/java/com/android/server/wm/RootWindowContainer.java
services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java