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

Commit b4982b20 authored by Ryo Hashimoto's avatar Ryo Hashimoto
Browse files

Use the proper variant of String#substring to report broken strict mode stacks

substring(int start) returns everything after |start|.
To get the front part, substring(int start, int end) should be used.

Change-Id: I4dfde175f607091b48f90afe92ef3b957ffd1c6b
parent 70125f70
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1923,7 +1923,7 @@ public final class StrictMode {
            if (LOG_V) Log.d(TAG, "strict mode violation stacks read from binder call.  i=" + i);
            ViolationInfo info = new ViolationInfo(p, !currentlyGathering);
            if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 30000) {
                String front = info.crashInfo.stackTrace.substring(256);
                String front = info.crashInfo.stackTrace.substring(0, 256);
                // 30000 characters is way too large for this to be any sane kind of
                // strict mode collection of stacks.  We've had a problem where we leave
                // strict mode violations associated with the thread, and it keeps tacking