Skip to content

Commit ab63744

Browse files
Bug 2048741 - Return Deferred<Unit> from unenrollFromAllFirefoxLabs() (#7436)
The embedding application needs to know when the unenrollments finish so that it can potentially restart.
1 parent 1ee69ac commit ab63744

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,8 @@ open class Nimbus(
753753
} ?: FirefoxLabsUnenrollStatus.ERROR
754754
}
755755

756-
override fun unenrollFromAllFirefoxLabs() {
757-
dbScope.launch { unenrollFromAllFirefoxLabsOnThisThread() }
756+
override fun unenrollFromAllFirefoxLabs(): Deferred<Unit> {
757+
dbScope.async { unenrollFromAllFirefoxLabsOnThisThread() }
758758
}
759759

760760
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)

components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/NimbusInterface.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ interface NimbusInterface : FeaturesInterface, NimbusMessagingInterface, NimbusE
237237
/**
238238
* Attempt to unenroll from all Firefox Labs.
239239
*/
240-
fun unenrollFromAllFirefoxLabs() = Unit
240+
fun unenrollFromAllFirefoxLabs(): Deferred<Unit> =
241+
CompletableDeferred(Unit)
241242

242243
/**
243244
* Reset internal state in response to application-level telemetry reset.

0 commit comments

Comments
 (0)