Skip to content
Commit 14d1a545 authored by Artem Radchenko's avatar Artem Radchenko
Browse files

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: default avatarArtem Radchenko <artem.radchenko@globallogic.com>
Change-Id: I71c7903ccb3d7f9a95a99014d14da37c61d40f8e
parent 6a01b8d2
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