From 42da7aa2fa01daf702884df9820830d9b36a1c11 Mon Sep 17 00:00:00 2001 From: Christian Grigis Date: Tue, 27 Oct 2020 10:42:24 +0100 Subject: [PATCH] Handle callback when returning early --- .../exposurenotification/ExposureNotificationServiceImpl.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt b/play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt index b734fb6e..0ebe73c5 100644 --- a/play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt +++ b/play-services-nearby-core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt @@ -86,7 +86,10 @@ class ExposureNotificationServiceImpl(private val context: Context, private val } override fun start(params: StartParams) { - if (ExposurePreferences(context).enabled) return + if (ExposurePreferences(context).enabled) { + params.callback.onResult(Status.SUCCESS) + return + } lifecycleScope.launchWhenStarted { val status = confirmPermission(CONFIRM_ACTION_START) if (status.isSuccess) {