summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-06-14 22:28:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-06-14 22:28:58 +0000
commit68f657619cb49b936f6152bb213f0ff0daa9ba1a (patch)
tree47c195ad6071336b935d9af3cdaab1891f37bf4a
parent47ecbaf0add19dab37c93d76a289f1e0f67eeb37 (diff)
parenta7cb994b6f463b316d481ed890d3109d3595d9d7 (diff)
downloadbase-68f657619cb49b936f6152bb213f0ff0daa9ba1a.tar.gz
Merge "Add runtime crash information to sysprops"
-rw-r--r--core/java/com/android/internal/os/RuntimeInit.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/com/android/internal/os/RuntimeInit.java b/core/java/com/android/internal/os/RuntimeInit.java
index 44c7f5406713..28b98d6fab06 100644
--- a/core/java/com/android/internal/os/RuntimeInit.java
+++ b/core/java/com/android/internal/os/RuntimeInit.java
@@ -62,6 +62,8 @@ public class RuntimeInit {
private static IBinder mApplicationObject;
private static volatile boolean mCrashing = false;
+ private static final String SYSPROP_CRASH_COUNT = "sys.system_server.crash_java";
+ private static int mCrashCount;
private static volatile ApplicationWtfHandler sDefaultApplicationWtfHandler;
@@ -105,6 +107,8 @@ public class RuntimeInit {
// first clause in either of these two cases, only for system_server.
if (mApplicationObject == null && (Process.SYSTEM_UID == Process.myUid())) {
Clog_e(TAG, "*** FATAL EXCEPTION IN SYSTEM PROCESS: " + t.getName(), e);
+ mCrashCount = SystemProperties.getInt(SYSPROP_CRASH_COUNT, 0) + 1;
+ SystemProperties.set(SYSPROP_CRASH_COUNT, String.valueOf(mCrashCount));
} else {
logUncaught(t.getName(), ActivityThread.currentProcessName(), Process.myPid(), e);
}