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

Commit 1bb3df77 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Get the instance count as the initial value" into rvc-dev am: d5fb11a7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11473225

Change-Id: Ifa50f6f1adef914b75f6f2c567f88df8ee114a55
parents 7ed13567 d5fb11a7
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -817,6 +817,9 @@ public final class StrictMode {

            /** @hide */
            public @NonNull Builder permitActivityLeaks() {
                synchronized (StrictMode.class) {
                    sExpectedActivityInstanceCount.clear();
                }
                return disable(DETECT_VM_ACTIVITY_LEAKS);
            }

@@ -2586,8 +2589,10 @@ public final class StrictMode {
                return;
            }

            // Use the instance count from InstanceTracker as initial value.
            Integer expected = sExpectedActivityInstanceCount.get(klass);
            Integer newExpected = expected == null ? 1 : expected + 1;
            Integer newExpected =
                    expected == null ? InstanceTracker.getInstanceCount(klass) + 1 : expected + 1;
            sExpectedActivityInstanceCount.put(klass, newExpected);
        }
    }