32
32
import com .google .android .gms .tasks .TaskCompletionSource ;
33
33
import com .google .android .gms .tasks .Tasks ;
34
34
import com .google .firebase .FirebaseApp ;
35
+ import com .google .firebase .annotations .concurrent .Lightweight ;
35
36
import com .google .firebase .appdistribution .AppDistributionRelease ;
36
37
import com .google .firebase .appdistribution .BinaryType ;
37
38
import com .google .firebase .appdistribution .FirebaseAppDistribution ;
40
41
import com .google .firebase .appdistribution .UpdateProgress ;
41
42
import com .google .firebase .appdistribution .UpdateStatus ;
42
43
import com .google .firebase .appdistribution .UpdateTask ;
43
- import com .google .firebase .concurrent .FirebaseExecutors ;
44
44
import java .util .concurrent .Executor ;
45
45
46
46
/**
@@ -61,7 +61,7 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
61
61
private final SequentialReference <AppDistributionReleaseInternal > cachedNewRelease ;
62
62
private TaskCache <UpdateTask > updateIfNewReleaseAvailableTaskCache = new TaskCache <>();
63
63
private TaskCache <Task <AppDistributionRelease >> checkForNewReleaseTaskCache = new TaskCache <>();
64
- private Executor lightweightExecutor ;
64
+ @ Lightweight private Executor lightweightExecutor ;
65
65
private AlertDialog updateConfirmationDialog ;
66
66
private AlertDialog signInConfirmationDialog ;
67
67
@ Nullable private Activity dialogHostActivity = null ;
@@ -81,15 +81,15 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
81
81
@ NonNull AabUpdater aabUpdater ,
82
82
@ NonNull SignInStorage signInStorage ,
83
83
@ NonNull FirebaseAppDistributionLifecycleNotifier lifecycleNotifier ,
84
- @ NonNull Executor lightweightExecutor ) {
84
+ @ NonNull @ Lightweight Executor lightweightExecutor ) {
85
85
this .firebaseApp = firebaseApp ;
86
86
this .testerSignInManager = testerSignInManager ;
87
87
this .newReleaseFetcher = newReleaseFetcher ;
88
88
this .apkUpdater = apkUpdater ;
89
89
this .aabUpdater = aabUpdater ;
90
90
this .signInStorage = signInStorage ;
91
91
this .lifecycleNotifier = lifecycleNotifier ;
92
- this .cachedNewRelease = SequentialReference . withBaseExecutor (lightweightExecutor );
92
+ this .cachedNewRelease = new SequentialReference <> (lightweightExecutor );
93
93
this .lightweightExecutor = lightweightExecutor ;
94
94
lifecycleNotifier .addOnActivityDestroyedListener (this ::onActivityDestroyed );
95
95
lifecycleNotifier .addOnActivityPausedListener (this ::onActivityPaused );
@@ -220,8 +220,7 @@ public Task<Void> signInTester() {
220
220
public void signOutTester () {
221
221
cachedNewRelease
222
222
.set (null )
223
- .addOnSuccessListener (
224
- FirebaseExecutors .directExecutor (), unused -> signInStorage .setSignInStatus (false ));
223
+ .addOnSuccessListener (lightweightExecutor , unused -> signInStorage .setSignInStatus (false ));
225
224
}
226
225
227
226
@ Override
@@ -240,7 +239,7 @@ public synchronized Task<AppDistributionRelease> checkForNewRelease() {
240
239
.checkForNewRelease ()
241
240
.onSuccessTask (lightweightExecutor , release -> cachedNewRelease .set (release ))
242
241
.onSuccessTask (
243
- FirebaseExecutors . directExecutor () ,
242
+ lightweightExecutor ,
244
243
release ->
245
244
Tasks .forResult (ReleaseUtils .convertToAppDistributionRelease (release )))
246
245
.addOnFailureListener (
0 commit comments