|
38 | 38 | import android.os.SystemClock; |
39 | 39 | import android.os.UserHandle; |
40 | 40 | import android.util.EventLog; |
| 41 | +import android.util.Log; |
41 | 42 | import android.util.Slog; |
42 | 43 |
|
43 | 44 | /** |
@@ -779,6 +780,21 @@ final void processNextBroadcast(boolean fromMsg) { |
779 | 780 | } catch (RemoteException e) { |
780 | 781 | Slog.w(TAG, "Exception when sending broadcast to " |
781 | 782 | + r.curComponent, e); |
| 783 | + } catch (RuntimeException e) { |
| 784 | + Log.wtf(TAG, "Failed sending broadcast to " |
| 785 | + + r.curComponent + " with " + r.intent, e); |
| 786 | + // If some unexpected exception happened, just skip |
| 787 | + // this broadcast. At this point we are not in the call |
| 788 | + // from a client, so throwing an exception out from here |
| 789 | + // will crash the entire system instead of just whoever |
| 790 | + // sent the broadcast. |
| 791 | + logBroadcastReceiverDiscardLocked(r); |
| 792 | + finishReceiverLocked(r, r.resultCode, r.resultData, |
| 793 | + r.resultExtras, r.resultAbort, true); |
| 794 | + scheduleBroadcastsLocked(); |
| 795 | + // We need to reset the state if we failed to start the receiver. |
| 796 | + r.state = BroadcastRecord.IDLE; |
| 797 | + return; |
782 | 798 | } |
783 | 799 |
|
784 | 800 | // If a dead object exception was thrown -- fall through to |
|
0 commit comments