From d33391ebce1997012283eacb50f114f305e0df3b Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 5 Sep 2020 23:51:00 +0200 Subject: [PATCH] EN: Handle confirmation via resolution/pending intent instead of new task --- .../ExposureNotificationsConfirmActivity.kt | 20 +++-- .../nearby/exposurenotification/Constants.kt | 1 + .../exposurenotification/ExposureDatabase.kt | 24 ++++- .../ExposureNotificationServiceImpl.kt | 87 ++++++++++--------- 4 files changed, 82 insertions(+), 50 deletions(-) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/ExposureNotificationsConfirmActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/ExposureNotificationsConfirmActivity.kt index 3b2988c7..2c8fcaa4 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/ExposureNotificationsConfirmActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/ExposureNotificationsConfirmActivity.kt @@ -11,12 +11,14 @@ import android.widget.Button import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import com.google.android.gms.R -import com.google.android.gms.nearby.exposurenotification.ExposureNotificationStatusCodes.* import org.microg.gms.nearby.exposurenotification.* class ExposureNotificationsConfirmActivity : AppCompatActivity() { - private var resultCode: Int = FAILED - private val resultData: Bundle = Bundle() + private var resultCode: Int = RESULT_CANCELED + set(value) { + setResult(value) + field = value + } private val receiver: ResultReceiver? get() = intent.getParcelableExtra(KEY_CONFIRM_RECEIVER) private val action: String? @@ -47,22 +49,22 @@ class ExposureNotificationsConfirmActivity : AppCompatActivity() { findViewById