I wrote an article before:
After Android 3.1, the newly installed and the user forcibly stopped the apk, unable to monitor the broadcast problem
Today I finally studied the principle and posted the code execution logic:
ContextImpl.sendBroadcast () ActivityManagerNative.getDefault().broadcastIntent() ActivityManagerService.broadcastIntent() ActivityManagerService.broadcastIntentLocked() ActivityManagerService.collectReceiverComponents() PackageManagerService.queryIntentReceivers() PackageManagerService.ActivityIntentResolver.queryIntentForPackage() IntentResolver.queryIntentFromList() IntentResolver.buildResolveList() PackageManagerService.ActivityIntentResolver.isFilterStopped() return (ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0 && ps.getStopped(userId);
in conclusion:
Only non-STOPPED applications, and system applications, can receive broadcasts that do not contain FLAG_INCLUDE_STOPPED_PACKAGES in the Intent.