Fix issue #29438842: Enter the "am broadcast -a...

...'android.hardware.action.NEW_PICTURE'" to terminal, but does not have a response.

Change-Id: I264f386810237a7abc767f68363afeccda557b9c
This commit is contained in:
Dianne Hackborn
2016-06-20 11:22:40 -07:00
parent c2d75c898b
commit ea05cd57f5
2 changed files with 14 additions and 1 deletions

View File

@@ -17917,6 +17917,19 @@ public final class ActivityManagerService extends ActivityManagerNative
// Apps should use JobScehduler to monitor for media provider changes.
Slog.w(TAG, action + " no longer allowed; dropping from "
+ UserHandle.formatUid(callingUid));
if (resultTo != null) {
final BroadcastQueue queue = broadcastQueueForIntent(intent);
try {
queue.performReceiveLocked(callerApp, resultTo, intent,
Activity.RESULT_CANCELED, null, null,
false, false, userId);
} catch (RemoteException e) {
Slog.w(TAG, "Failure ["
+ queue.mQueueName + "] sending broadcast result of "
+ intent, e);
}
}
// Lie; we don't want to crash the app.
return ActivityManager.BROADCAST_SUCCESS;
}

View File

@@ -456,7 +456,7 @@ public final class BroadcastQueue {
}
}
private void performReceiveLocked(ProcessRecord app, IIntentReceiver receiver,
void performReceiveLocked(ProcessRecord app, IIntentReceiver receiver,
Intent intent, int resultCode, String data, Bundle extras,
boolean ordered, boolean sticky, int sendingUser) throws RemoteException {
// Send the intent to the receiver asynchronously using one-way binder calls.