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

Commit 3aac79bd 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: Id7f1364cf789acb458d158616174e23653a9269c
parents 844ac4ce 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);
        }
    }