Fix timeout on CompletableFuture

future object hold by the caller times out when StartForFutureActivity
is destroyed and created again during the test execution.

Tested the fix with "Don't keep Activities" flag enabled in developer settings.

Bug: 257962878
Test: atest CtsPermission3TestCases:android.permission3.cts.PermissionTest23#testRequestGrantedPermission
Change-Id: I27d443d2dc1819d412541d838321a6d56260ac2f
Merged-In: I27d443d2dc1819d412541d838321a6d56260ac2f
(cherry picked from commit a6a0cfc39a7eb1ecb1a92a4f809782a76c01f398)
4 files changed