Merge "send broadcast to explicit role holder component names" into tm-dev

This commit is contained in:
Kholoud Mohamed
2022-04-04 15:39:49 +00:00
committed by Android (Google) Code Review

View File

@@ -13354,8 +13354,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
if (receivers.isEmpty()) { if (receivers.isEmpty()) {
return; return;
} }
packageIntent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); for (ResolveInfo receiver : receivers) {
mContext.sendBroadcastAsUser(packageIntent, userHandle); final Intent componentIntent = new Intent(packageIntent)
.setComponent(receiver.getComponentInfo().getComponentName())
.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
mContext.sendBroadcastAsUser(componentIntent, userHandle);
}
} catch (RemoteException ex) { } catch (RemoteException ex) {
Slogf.w(LOG_TAG, "Cannot get list of broadcast receivers for %s because: %s.", Slogf.w(LOG_TAG, "Cannot get list of broadcast receivers for %s because: %s.",
intent.getAction(), ex); intent.getAction(), ex);