Allow unexported receiver registration for sandbox

Webview uses some system level broadcasts. This change
enables webview to work in the sandbox process
Bug: b/226564146
Test: Manual

Change-Id: I8b1a51c513b825e6749d1b711d6ef0b9f13300af
This commit is contained in:
Shiwangi Shah
2022-03-24 17:10:35 +00:00
parent 641fbeb11b
commit f9d091ff77

View File

@@ -12938,7 +12938,12 @@ public class ActivityManagerService extends IActivityManager.Stub
public Intent registerReceiverWithFeature(IApplicationThread caller, String callerPackage,
String callerFeatureId, String receiverId, IIntentReceiver receiver,
IntentFilter filter, String permission, int userId, int flags) {
enforceNotIsolatedOrSdkSandboxCaller("registerReceiver");
// Allow Sandbox process to register only unexported receivers.
if ((flags & Context.RECEIVER_NOT_EXPORTED) != 0) {
enforceNotIsolatedCaller("registerReceiver");
} else {
enforceNotIsolatedOrSdkSandboxCaller("registerReceiver");
}
ArrayList<Intent> stickyIntents = null;
ProcessRecord callerApp = null;
final boolean visibleToInstantApps