Merge "Inform PendingIntent sender if broadcast was not queued." into lmp-mr1-dev

automerge: 395b519

* commit '395b519f4bfec6e1c171aaca2c62a75a5c07de07':
  Inform PendingIntent sender if broadcast was not queued.
This commit is contained in:
Amith Yamasani
2014-11-08 02:28:24 +00:00
committed by android-build-merger
3 changed files with 12 additions and 3 deletions

View File

@@ -212,6 +212,13 @@ public class ActivityManager {
*/
public static final int BROADCAST_STICKY_CANT_HAVE_PERMISSION = -1;
/**
* Result for IActivityManager.broadcastIntent: trying to send a broadcast
* to a stopped user. Fail.
* @hide
*/
public static final int BROADCAST_FAILED_USER_STOPPED = -2;
/**
* Type for IActivityManaqer.getIntentSender: this PendingIntent is
* for a sendBroadcast operation.

View File

@@ -15576,7 +15576,7 @@ public final class ActivityManagerService extends ActivityManagerNative
& Intent.FLAG_RECEIVER_BOOT_UPGRADE) == 0) {
Slog.w(TAG, "Skipping broadcast of " + intent
+ ": user " + userId + " is stopped");
return ActivityManager.BROADCAST_SUCCESS;
return ActivityManager.BROADCAST_FAILED_USER_STOPPED;
}
}

View File

@@ -269,11 +269,13 @@ final class PendingIntentRecord extends IIntentSender.Stub {
try {
// If a completion callback has been requested, require
// that the broadcast be delivered synchronously
owner.broadcastIntentInPackage(key.packageName, uid,
int sent = owner.broadcastIntentInPackage(key.packageName, uid,
finalIntent, resolvedType,
finishedReceiver, code, null, null,
requiredPermission, (finishedReceiver != null), false, userId);
sendFinish = false;
if (sent == ActivityManager.BROADCAST_SUCCESS) {
sendFinish = false;
}
} catch (RuntimeException e) {
Slog.w(ActivityManagerService.TAG,
"Unable to send startActivity intent", e);