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

Commit d5fb11a7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents cf3a8611 762f0493
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);
        }
    }