diff --git a/services/core/java/com/android/server/am/BroadcastQueueImpl.java b/services/core/java/com/android/server/am/BroadcastQueueImpl.java index 5848011a508dd..645836b831de2 100644 --- a/services/core/java/com/android/server/am/BroadcastQueueImpl.java +++ b/services/core/java/com/android/server/am/BroadcastQueueImpl.java @@ -732,9 +732,10 @@ public class BroadcastQueueImpl extends BroadcastQueue { } catch (RemoteException ex) { // Failed to call into the process. It's either dying or wedged. Kill it gently. synchronized (mService) { - Slog.w(TAG, "Can't deliver broadcast to " + app.processName - + " (pid " + app.getPid() + "). Crashing it."); - app.scheduleCrashLocked("can't deliver broadcast", + final String msg = "Failed to schedule " + intent + " to " + receiver + + " via " + app + ": " + ex; + Slog.w(TAG, msg); + app.scheduleCrashLocked(msg, CannotDeliverBroadcastException.TYPE_ID, /* extras=*/ null); } throw ex; @@ -1379,9 +1380,10 @@ public class BroadcastQueueImpl extends BroadcastQueue { processCurBroadcastLocked(r, app); return; } catch (RemoteException e) { - Slog.w(TAG, "Exception when sending broadcast to " - + r.curComponent, e); - app.scheduleCrashLocked("can't deliver broadcast", + final String msg = "Failed to schedule " + r.intent + " to " + info + + " via " + app + ": " + e; + Slog.w(TAG, msg); + app.scheduleCrashLocked(msg, CannotDeliverBroadcastException.TYPE_ID, /* extras=*/ null); } catch (RuntimeException e) { Slog.wtf(TAG, "Failed sending broadcast to " diff --git a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java index a13f48728374c..d6884633521e5 100644 --- a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java +++ b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java @@ -628,9 +628,10 @@ class BroadcastQueueModernImpl extends BroadcastQueue { app.mState.getReportedProcState()); } } catch (RemoteException e) { - Slog.w(TAG, "Failed to schedule " + r + " to " + receiver - + " via " + app + ": " + e); - app.scheduleCrashLocked(TAG, CannotDeliverBroadcastException.TYPE_ID, null); + final String msg = "Failed to schedule " + r + " to " + receiver + + " via " + app + ": " + e; + Slog.w(TAG, msg); + app.scheduleCrashLocked(msg, CannotDeliverBroadcastException.TYPE_ID, null); app.setKilled(true); finishReceiverLocked(queue, BroadcastRecord.DELIVERY_FAILURE); } @@ -655,8 +656,9 @@ class BroadcastQueueModernImpl extends BroadcastQueue { r.resultCode, r.resultData, r.resultExtras, false, r.initialSticky, r.userId, app.mState.getReportedProcState()); } catch (RemoteException e) { - Slog.w(TAG, "Failed to schedule result of " + r + " via " + app + ": " + e); - app.scheduleCrashLocked(TAG, CannotDeliverBroadcastException.TYPE_ID, null); + final String msg = "Failed to schedule result of " + r + " via " + app + ": " + e; + Slog.w(TAG, msg); + app.scheduleCrashLocked(msg, CannotDeliverBroadcastException.TYPE_ID, null); } } }