Skip to content
Commit d69bd6a2 authored by Bernardo Rufino's avatar Bernardo Rufino
Browse files

[Attempt #2] Restrict {AM,WM}.closeSystemDialogs()

Second attempt at ag/13297639. Recents uses AM.closeSystemDialogs() and
I had forgotten to give it the proper permission, so it broke a few
tests (b/177228919). Permission is given in ag/13318845. Will only
submit this CL with CtsWindowManagerDeviceTestCases passing.

-- Original CL description (added "Test:" line)

As part of locking down Intent.ACTION_CLOSE_SYSTEM_DIALOGS, we need to
protect AM.closeSystemDialogs() too (which ends up calling the broadcast
under the system UID). We should also protect WM.closeSystemDialogs(),
which is slightly different in that it asks windows/views to close
themselves, for the same reasons that we protected the intent and for
consistency too. Check go/close-system-dialogs for details on the
general effort.

To achieve this we move the logic from AM to WM, since we can't call out
from WM to AM. Part of the logic was already in WM (the trampoline
case), so I mostly moved code from AMS to wm.ATMS. The part I had to
wire from AM was the sourceUid of the instrumentation, but that fit
nicely since we had to pipe similar information before for BAL too.

Bug: 159105552
Test: atest CtsAppTestCases:android.app.cts.CloseSystemDialogsTest
Test: Run CtsWindowManagerDeviceTestCases
Change-Id: I4c44b11b8e7d4474c0c7ff472dbe63f743d7ff36
parent 8dd46b0e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment