Restoring starting capturing existing activity.

ag/24138143 made the rule to produce empty captures in many cases.

ag/24138143 aimed to fix a leak that was caused by a local var
alreadyOpenActivity still referring the activity when the leak check
executes.

Fixing that by moving the variable to a method startCapturingExistingActivity.

Bug: 291638593
Test: local, presubmit
Flag: N/A
Change-Id: I281202488c6c85e2e2c5b5b3300e26d808167104
This commit is contained in:
Vadim Tryshev committed 2023-07-24 19:09:48 +00:00
1 parent 6eb4af3f45
commit 101ea3e4e5
3 files changed
+17 -3

No files matched your search

@@ -116,7 +116,8 @@ public class FallbackRecentsTest {
Utilities.enableRunningInTestHarnessForTests();
}
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule();
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule(
RecentsActivity.ACTIVITY_TRACKER::getCreatedActivity);
mOrderSensitiveRules = RuleChain
.outerRule(new SamplerRule())
.around(new NavigationModeSwitchRule(mLauncher))