From a6d73351fd78b7d1f5a802aedc2943139488880e Mon Sep 17 00:00:00 2001 From: Yabin Huang Date: Thu, 3 Jun 2021 19:12:28 -0700 Subject: [PATCH] Add a comment for the LegacyGlobalActions broadcast receiver fix The bug is already fixed in master branch by registering the broadcast receiver with UserHandle.ALL, which is an uncommon way to register a broadcast receiver. This CL adds a comment to explain it. Bug: 182842046 Test: atest CtsAccessibilityServiceTestCases Change-Id: I10405769ba6426c7bbcd31e09e1cd4c99585665b --- .../java/com/android/server/policy/LegacyGlobalActions.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/policy/LegacyGlobalActions.java b/services/core/java/com/android/server/policy/LegacyGlobalActions.java index 5e4c801d90fbc..a5969a88008d5 100644 --- a/services/core/java/com/android/server/policy/LegacyGlobalActions.java +++ b/services/core/java/com/android/server/policy/LegacyGlobalActions.java @@ -135,6 +135,9 @@ class LegacyGlobalActions implements DialogInterface.OnDismissListener, DialogIn filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); filter.addAction(Intent.ACTION_SCREEN_OFF); filter.addAction(TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED); + // By default CLOSE_SYSTEM_DIALOGS broadcast is sent only for current user, which is user + // 10 on devices with headless system user enabled. + // In order to receive the broadcast, register the broadcast receiver with UserHandle.ALL. context.registerReceiverAsUser(mBroadcastReceiver, UserHandle.ALL, filter, null, null); mHasTelephony =