summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tej Singh <singhtejinder@google.com> 2019-05-08 13:24:22 -0700
committer Tej Singh <singhtejinder@google.com> 2019-05-08 13:24:22 -0700
commitee252a5dce665a1062a12aeb9066cacd0932438c (patch)
tree67c736c0d89cdc0e401e3fa2016fc182843be272
parente74b7d2365f2783e89671b0e2e57f1e712a95a87 (diff)
Fix error source of system server crashes
System server crashes have a null ProcessRecord. This meant that we would always annotate the error source as UNKNOWN for system server crashes. Now, the check for error source first checks if the process name is system server, and if so, makes the error source SYSTEM_SERVER. Otherwise, it continues to check the ProcessRecord. Test: manually mocked a system server crash and ensured it was logged properly Bug: 130438842 Change-Id: I71fc9c3ecdd3298ab878b1b14faae2567b5e640a
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 46c8ce77d7cf..7116ef58a672 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -275,6 +275,7 @@ import android.os.storage.StorageManager;
import android.permission.PermissionManager;
import android.provider.DeviceConfig;
import android.provider.Settings;
+import android.server.ServerProtoEnums;
import android.sysprop.VoldProperties;
import android.text.TextUtils;
import android.text.format.DateUtils;
@@ -9069,7 +9070,9 @@ public class ActivityManagerService extends IActivityManager.Stub
? StatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__FOREGROUND
: StatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__BACKGROUND)
: StatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__UNKNOWN,
- (r != null) ? r.getProcessClassEnum() : 0
+ processName.equals("system_server") ? ServerProtoEnums.SYSTEM_SERVER
+ : (r != null) ? r.getProcessClassEnum()
+ : ServerProtoEnums.ERROR_SOURCE_UNKNOWN
);
final int relaunchReason = r == null ? RELAUNCH_REASON_NONE