List of usage examples for android.content Intent FLAG_EXCLUDE_STOPPED_PACKAGES
int FLAG_EXCLUDE_STOPPED_PACKAGES
To view the source code for android.content Intent FLAG_EXCLUDE_STOPPED_PACKAGES.
Click Source Link
From source file:org.microg.gms.gcm.McsService.java
private void handleAppMessage(DataMessageStanza msg) { database.noteAppMessage(msg.category, msg.getSerializedSize()); GcmDatabase.App app = database.getApp(msg.category); Intent intent = new Intent(); intent.setAction(ACTION_C2DM_RECEIVE); intent.setPackage(msg.category);// w w w. j a v a2 s. c o m intent.putExtra(EXTRA_FROM, msg.from); if (app.wakeForDelivery) { intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); } else { intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES); } if (msg.token != null) intent.putExtra(EXTRA_COLLAPSE_KEY, msg.token); for (AppData appData : msg.app_data) { intent.putExtra(appData.key, appData.value); } List<ResolveInfo> infos = getPackageManager().queryBroadcastReceivers(intent, PackageManager.GET_RESOLVED_FILTER); if (infos == null || infos.isEmpty()) { logd("No target for message, wut?"); } else { for (ResolveInfo resolveInfo : infos) { logd("Target: " + resolveInfo); Intent targetIntent = new Intent(intent); targetIntent.setComponent( new ComponentName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name)); sendOrderedBroadcast(targetIntent, msg.category + ".permission.C2D_MESSAGE"); } } }