Checking that there are no more than 2 live activities at any moment
This is tightening the makeshift strictmode criteria.
Starting with this moment, we will know that there is
no memory growth during tests execution, which is a big deal.
Big: 139137636
Change-Id: I5edc84524463bd1736d727496ad0fc031bb9624c
diff --git a/tests/src/com/android/launcher3/ui/ActivityLeakTracker.java b/tests/src/com/android/launcher3/ui/ActivityLeakTracker.java
index 0b5ce02..e9258e9 100644
--- a/tests/src/com/android/launcher3/ui/ActivityLeakTracker.java
+++ b/tests/src/com/android/launcher3/ui/ActivityLeakTracker.java
@@ -77,6 +77,8 @@
}
}
+ if (liveActivities > 2) return false;
+
// It's OK to have 1 leaked activity if no active activities exist.
return liveActivities == 0 ? destroyedActivities <= 1 : destroyedActivities == 0;
}