From 887d80868916696eaae1599e5fa6c061d4bc2396 Mon Sep 17 00:00:00 2001 From: Gopal Krishna Shukla Date: Mon, 30 Sep 2019 15:17:27 +0530 Subject: [PATCH] Avoid NPE in system_server in bringDownServiceLocked() While stoping the service is scheduleUnbindService() is failing with exception , no need to update the OOM value of the process as processRecord is already set to NULL. Test: Monkey or directed (see bug) Bug: 136627142 Change-Id: Ic766b91e6dc47b8ff727026863bab2437f9be420 --- services/core/java/com/android/server/am/ActiveServices.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 6cbbcddc2b3f5..f021008cef7d9 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -2935,7 +2935,9 @@ public final class ActiveServices { } catch (Exception e) { Slog.w(TAG, "Exception when unbinding service " + r.shortInstanceName, e); + needOomAdj = false; serviceProcessGoneLocked(r); + break; } } }