Correct exported state for InputMethodManagerService receiver

The InputMethodManagerService receiver that listens for
CLOSE_SYSTEM_DIALOGS broadcasts was initially marked as not exported
since this broadcast should be dropped by the platform when sent from
apps. However since this broadcast is still valid to be used in tests,
receivers registering for this broadcast should be marked as exported.
This commit updates the receiver to exported to allow any tests that
send this broadcast to complete successfully.

Bug: 205796926
Test: atest ImeInsetsVisibilityTest
Change-Id: I92cb5cab839699084b3330c88fda7d72c78c565b
This commit is contained in:
Michael Groover
2021-11-10 12:24:07 -08:00
parent c8378b827f
commit c79ea6623c

View File

@@ -1827,7 +1827,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
broadcastFilterForAllUsers.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
mContext.registerReceiverAsUser(new ImmsBroadcastReceiverForAllUsers(),
UserHandle.ALL, broadcastFilterForAllUsers, null, null,
Context.RECEIVER_NOT_EXPORTED);
Context.RECEIVER_EXPORTED);
final String defaultImiId = mSettings.getSelectedInputMethod();
final boolean imeSelectedOnBoot = !TextUtils.isEmpty(defaultImiId);