Fix LegacyGlobalActions broadcast receiver
By default CLOSE_SYSTEM_DIALOGS broadcast is sent only for current user.
Current user is user 10 on devices with headless system user enabled.
LegacyGlobalActions broadcast receiver is registered with system user (user 0),
so the broadcast is not received.
It is proposed to use registerReceiverAsUser with UserHandle.ALL when
registering receiver to be able to receive broadcast.
Bug: 181734723
Test: cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases -t android.accessibilityservice.cts.AccessibilityGlobalActionsTest#testPerformGlobalActionPowerDialog
or Manual:
1. Open global actions dialog:
adb shell input keyevent --longpress KEYCODE_POWER
(automotive implementation uses LegacyGlobalActions implementation by default)
2. Broadcast close system dialogs intent:
adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS
Signed-off-by: Artem Radchenko <artem.radchenko@globallogic.com>
Change-Id: I71c7903ccb3d7f9a95a99014d14da37c61d40f8e
Loading
Please register or sign in to comment