diff options
| author | 2019-05-20 22:18:19 +0000 | |
|---|---|---|
| committer | 2019-05-20 22:18:19 +0000 | |
| commit | f4c2cb683034adeee71bc021564044e12250e7fe (patch) | |
| tree | cfa9ac1687c42dd3b96626667105d60bb3d14455 | |
| parent | 6a0b4bb6265dc5f4b293e869a4208b5677a0390b (diff) | |
| parent | fa7c3689e36d73dd885c976b0ae3f0dc976f4e23 (diff) | |
Merge "Null check for early watchdog-caught thread hangs" into qt-dev
| -rw-r--r-- | services/core/java/com/android/server/Watchdog.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java index a7fb99f8b004..e097d85293ab 100644 --- a/services/core/java/com/android/server/Watchdog.java +++ b/services/core/java/com/android/server/Watchdog.java @@ -617,9 +617,13 @@ public class Watchdog extends Thread { // deadlock and the watchdog as a whole to be ineffective) Thread dropboxThread = new Thread("watchdogWriteToDropbox") { public void run() { - mActivity.addErrorToDropBox( - "watchdog", null, "system_server", null, null, null, - subject, null, stack, null); + // If a watched thread hangs before init() is called, we don't have a + // valid mActivity. So we can't log the error to dropbox. + if (mActivity != null) { + mActivity.addErrorToDropBox( + "watchdog", null, "system_server", null, null, null, + subject, null, stack, null); + } StatsLog.write(StatsLog.SYSTEM_SERVER_WATCHDOG_OCCURRED, subject); } }; |