OSDN Git Service

Logging atom TOMB_STONE_OCCURRED when a tombstone file added to dropbox.
authorjianjin <jianjin@google.com>
Tue, 2 Apr 2019 21:27:32 +0000 (14:27 -0700)
committerjianjin <jianjin@google.com>
Tue, 2 Apr 2019 21:27:32 +0000 (14:27 -0700)
Bug: 126127632
Change-Id: I09b8649e0b53bce13b7a42c80b06bf354196e9af
Fix: 126127632
Test: manually test by triggering tombstone and check statsd log

core/java/com/android/server/BootReceiver.java

index a087d68..dc4f09a 100644 (file)
@@ -267,7 +267,6 @@ public class BootReceiver extends BroadcastReceiver {
                     if (file.isFile() && file.getName().startsWith("tombstone_")) {
                         addFileToDropBox(db, timestamps, headers, file.getPath(), LOG_SIZE,
                                 TAG_TOMBSTONE);
-                        StatsLog.write(StatsLog.TOMB_STONE_OCCURRED);
                     }
                 } catch (IOException e) {
                     Slog.e(TAG, "Can't log tombstone", e);
@@ -308,6 +307,9 @@ public class BootReceiver extends BroadcastReceiver {
         if (tag.equals(TAG_TOMBSTONE) && fileContents.contains(">>> system_server <<<")) {
             addTextToDropBox(db, "system_server_native_crash", text, filename, maxSize);
         }
+        if (tag.equals(TAG_TOMBSTONE)) {
+            StatsLog.write(StatsLog.TOMB_STONE_OCCURRED);
+        }
         addTextToDropBox(db, tag, text, filename, maxSize);
     }