36
36
import com .google .android .gms .tasks .TaskCompletionSource ;
37
37
import com .google .android .gms .tasks .Tasks ;
38
38
import com .google .firebase .FirebaseApp ;
39
+ import com .google .firebase .annotations .concurrent .Blocking ;
39
40
import com .google .firebase .annotations .concurrent .Lightweight ;
40
41
import com .google .firebase .appdistribution .AppDistributionRelease ;
41
42
import com .google .firebase .appdistribution .BinaryType ;
@@ -65,14 +66,14 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
65
66
private final ApkUpdater apkUpdater ;
66
67
private final AabUpdater aabUpdater ;
67
68
private final SignInStorage signInStorage ;
68
- private final SequentialReference <AppDistributionReleaseInternal > cachedNewRelease ;
69
69
private final ReleaseIdentifier releaseIdentifier ;
70
70
private final ScreenshotTaker screenshotTaker ;
71
- private final Executor blockingExecutor ;
72
- private final FirebaseAppDistributionNotificationsManager notificationsManager ;
73
- private TaskCache <UpdateTask > updateIfNewReleaseAvailableTaskCache = new TaskCache <>();
74
- private TaskCache <Task <AppDistributionRelease >> checkForNewReleaseTaskCache = new TaskCache <>();
75
71
@ Lightweight private Executor lightweightExecutor ;
72
+ @ Blocking private final Executor blockingExecutor ;
73
+ private final SequentialReference <AppDistributionReleaseInternal > cachedNewRelease ;
74
+ private TaskCache <AppDistributionRelease > checkForNewReleaseTaskCache ;
75
+ private UpdateTaskCache updateIfNewReleaseAvailableTaskCache ;
76
+ private final FirebaseAppDistributionNotificationsManager notificationsManager ;
76
77
private AlertDialog updateConfirmationDialog ;
77
78
private AlertDialog signInConfirmationDialog ;
78
79
@ Nullable private Activity dialogHostActivity = null ;
@@ -94,7 +95,7 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
94
95
@ NonNull ReleaseIdentifier releaseIdentifier ,
95
96
@ NonNull ScreenshotTaker screenshotTaker ,
96
97
@ NonNull @ Lightweight Executor lightweightExecutor ,
97
- @ NonNull Executor blockingExecutor ) {
98
+ @ NonNull @ Blocking Executor blockingExecutor ) {
98
99
this .firebaseApp = firebaseApp ;
99
100
this .testerSignInManager = testerSignInManager ;
100
101
this .newReleaseFetcher = newReleaseFetcher ;
@@ -103,10 +104,12 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
103
104
this .signInStorage = signInStorage ;
104
105
this .releaseIdentifier = releaseIdentifier ;
105
106
this .lifecycleNotifier = lifecycleNotifier ;
106
- this .cachedNewRelease = new SequentialReference <>(lightweightExecutor );
107
- this .lightweightExecutor = lightweightExecutor ;
108
107
this .screenshotTaker = screenshotTaker ;
108
+ this .lightweightExecutor = lightweightExecutor ;
109
109
this .blockingExecutor = blockingExecutor ;
110
+ this .cachedNewRelease = new SequentialReference <>(lightweightExecutor );
111
+ this .checkForNewReleaseTaskCache = new TaskCache <>(lightweightExecutor );
112
+ this .updateIfNewReleaseAvailableTaskCache = new UpdateTaskCache (lightweightExecutor );
110
113
this .notificationsManager =
111
114
new FirebaseAppDistributionNotificationsManager (firebaseApp .getApplicationContext ());
112
115
lifecycleNotifier .addOnActivityDestroyedListener (this ::onActivityDestroyed );
@@ -117,7 +120,7 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
117
120
@ Override
118
121
@ NonNull
119
122
public UpdateTask updateIfNewReleaseAvailable () {
120
- return updateIfNewReleaseAvailableTaskCache .getOrCreateTask (
123
+ return updateIfNewReleaseAvailableTaskCache .getOrCreateUpdateTask (
121
124
() -> {
122
125
UpdateTaskImpl updateTask = new UpdateTaskImpl ();
123
126
remakeSignInConfirmationDialog = false ;
0 commit comments