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

Commit cfd23008 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 am: 3aac79bd

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

Change-Id: Id3eefd453e39cf026e45a1c4093d002506a546b4
parents a83daedd 3aac79bd
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);
        }
    }