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

Commit 224ce04e 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: I5277cd97e46659df8c0398371f86c9880efca9ef
parents 14bd7ccb 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);
        }
    }