Loading core/java/android/app/ApplicationExitInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -407,6 +407,15 @@ public final class ApplicationExitInfo implements Parcelable { */ public static final int SUBREASON_PACKAGE_UPDATE = 25; /** * The process was killed because of undelivered broadcasts; this would be set only when the * reason is {@link #REASON_OTHER}. * * For internal use only. * @hide */ public static final int SUBREASON_UNDELIVERED_BROADCAST = 26; // If there is any OEM code which involves additional app kill reasons, it should // be categorized in {@link #REASON_OTHER}, with subreason code starting from 1000. Loading Loading @@ -579,6 +588,7 @@ public final class ApplicationExitInfo implements Parcelable { SUBREASON_STOP_APP, SUBREASON_KILL_BACKGROUND, SUBREASON_PACKAGE_UPDATE, SUBREASON_UNDELIVERED_BROADCAST, }) @Retention(RetentionPolicy.SOURCE) public @interface SubReason {} Loading Loading @@ -1283,6 +1293,8 @@ public final class ApplicationExitInfo implements Parcelable { return "KILL BACKGROUND"; case SUBREASON_PACKAGE_UPDATE: return "PACKAGE UPDATE"; case SUBREASON_UNDELIVERED_BROADCAST: return "UNDELIVERED BROADCAST"; default: return "UNKNOWN"; } Loading services/core/java/com/android/server/am/BroadcastQueueImpl.java +3 −2 Original line number Diff line number Diff line Loading @@ -735,7 +735,7 @@ public class BroadcastQueueImpl extends BroadcastQueue { + " via " + app + ": " + ex; Slog.w(TAG, msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); } throw ex; } Loading Loading @@ -1388,7 +1388,8 @@ public class BroadcastQueueImpl extends BroadcastQueue { final String msg = "Failed to schedule " + r.intent + " to " + info + " via " + app + ": " + e; Slog.w(TAG, msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); } catch (RuntimeException e) { Slog.wtf(TAG, "Failed sending broadcast to " + r.curComponent + " with " + r.intent, e); Loading services/core/java/com/android/server/am/BroadcastQueueModernImpl.java +4 −2 Original line number Diff line number Diff line Loading @@ -831,7 +831,8 @@ class BroadcastQueueModernImpl extends BroadcastQueue { final String msg = "Failed to schedule " + r + " to " + receiver + " via " + app + ": " + e; logw(msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); enqueueFinishReceiver(queue, BroadcastRecord.DELIVERY_FAILURE, "remote app"); } } else { Loading @@ -858,7 +859,8 @@ class BroadcastQueueModernImpl extends BroadcastQueue { } catch (RemoteException e) { final String msg = "Failed to schedule result of " + r + " via " + app + ": " + e; logw(msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); } } // Clear so both local and remote references can be GC'ed Loading Loading
core/java/android/app/ApplicationExitInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -407,6 +407,15 @@ public final class ApplicationExitInfo implements Parcelable { */ public static final int SUBREASON_PACKAGE_UPDATE = 25; /** * The process was killed because of undelivered broadcasts; this would be set only when the * reason is {@link #REASON_OTHER}. * * For internal use only. * @hide */ public static final int SUBREASON_UNDELIVERED_BROADCAST = 26; // If there is any OEM code which involves additional app kill reasons, it should // be categorized in {@link #REASON_OTHER}, with subreason code starting from 1000. Loading Loading @@ -579,6 +588,7 @@ public final class ApplicationExitInfo implements Parcelable { SUBREASON_STOP_APP, SUBREASON_KILL_BACKGROUND, SUBREASON_PACKAGE_UPDATE, SUBREASON_UNDELIVERED_BROADCAST, }) @Retention(RetentionPolicy.SOURCE) public @interface SubReason {} Loading Loading @@ -1283,6 +1293,8 @@ public final class ApplicationExitInfo implements Parcelable { return "KILL BACKGROUND"; case SUBREASON_PACKAGE_UPDATE: return "PACKAGE UPDATE"; case SUBREASON_UNDELIVERED_BROADCAST: return "UNDELIVERED BROADCAST"; default: return "UNKNOWN"; } Loading
services/core/java/com/android/server/am/BroadcastQueueImpl.java +3 −2 Original line number Diff line number Diff line Loading @@ -735,7 +735,7 @@ public class BroadcastQueueImpl extends BroadcastQueue { + " via " + app + ": " + ex; Slog.w(TAG, msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); } throw ex; } Loading Loading @@ -1388,7 +1388,8 @@ public class BroadcastQueueImpl extends BroadcastQueue { final String msg = "Failed to schedule " + r.intent + " to " + info + " via " + app + ": " + e; Slog.w(TAG, msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); } catch (RuntimeException e) { Slog.wtf(TAG, "Failed sending broadcast to " + r.curComponent + " with " + r.intent, e); Loading
services/core/java/com/android/server/am/BroadcastQueueModernImpl.java +4 −2 Original line number Diff line number Diff line Loading @@ -831,7 +831,8 @@ class BroadcastQueueModernImpl extends BroadcastQueue { final String msg = "Failed to schedule " + r + " to " + receiver + " via " + app + ": " + e; logw(msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); enqueueFinishReceiver(queue, BroadcastRecord.DELIVERY_FAILURE, "remote app"); } } else { Loading @@ -858,7 +859,8 @@ class BroadcastQueueModernImpl extends BroadcastQueue { } catch (RemoteException e) { final String msg = "Failed to schedule result of " + r + " via " + app + ": " + e; logw(msg); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, true); app.killLocked("Can't deliver broadcast", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_UNDELIVERED_BROADCAST, true); } } // Clear so both local and remote references can be GC'ed Loading