Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 685f7439 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Improve "dumpsys activity lastanr-traces".

Test: manual test
Bug: 110088132
Change-Id: I2b36bd43826cbbc9f58e5509a66d4cedfe79e23a
parent d11ca759
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13149,12 +13149,13 @@ public class ActivityManagerService extends IActivityManager.Stub
        final File[] files = new File(ANR_TRACE_DIR).listFiles();
        if (ArrayUtils.isEmpty(files)) {
            pw.println("  <no ANR has occurred since boot>");
            return;
        }
        // Find the latest file.
        File latest = null;
        for (File f : files) {
            if (latest == null || latest.getName().compareTo(f.getName()) < 0) {
            if ((latest == null) || (latest.lastModified() < f.lastModified())) {
                latest = f;
            }
        }