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
This commit is contained in:
vadimt
2020-04-22 18:44:05 -07:00
committed by Vadim Tryshev
parent d73d39b45a
commit 0703464556
@@ -77,6 +77,8 @@ class ActivityLeakTracker implements Application.ActivityLifecycleCallbacks {
}
}
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;
}