Merge "Null check for early watchdog-caught thread hangs" into qt-dev

am: f4c2cb6830

Change-Id: I1bd80144fcb30dae02d00656367d0d5a155ea3a2
This commit is contained in:
Amith Yamasani
2019-05-20 17:26:34 -07:00
committed by android-build-merger

View File

@@ -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);
}
};