From d041822fe7ca70cdf1582d71cfb6ff9ab09b7c29 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Tue, 10 May 2016 15:49:51 -0700 Subject: [PATCH] Reduce wtf spam when a service onDestroy races with proc death Only log a message if the ServiceRecord still has a non-null app Bug: 28527548 Change-Id: I737679a6a0cd28d265919090c6a9e955ee454379 --- .../core/java/com/android/server/am/ActiveServices.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index b0752792d0673..36f51fcca1f86 100755 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -2186,8 +2186,12 @@ public final class ActiveServices { if (!inDestroying) { // Not sure what else to do with this... if it is not actually in the // destroying list, we don't need to make sure to remove it from it. - Slog.wtfStack(TAG, "Service done with onDestroy, but not inDestroying: " - + r); + // If the app is null, then it was probably removed because the process died, + // otherwise wtf + if (r.app != null) { + Slog.wtfStack(TAG, "Service done with onDestroy, but not inDestroying: " + + r + ", app=" + r.app); + } } else if (r.executeNesting != 1) { Slog.wtfStack(TAG, "Service done with onDestroy, but executeNesting=" + r.executeNesting + ": " + r);