From 714367b3aa6aa3bcc8b7bd087a9ff01d53f5476a Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 20 Dec 2020 11:46:33 +0100 Subject: [PATCH] EN: Remove ExposureSummary from intent extras in ExposureWindow mode Intent extras are only supported in v1 mode, but CWA also accesses them in ExposureWindow mode, which can result in ClassNotFoundException in optimized builds. Fixes #1325 --- .../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 902bc2dc..0f04427e 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 @@ -370,10 +370,13 @@ class ExposureNotificationServiceImpl(private val context: Context, private val try { val intent = if (exposureSummary.matchedKeyCount > 0) { - Intent(ACTION_EXPOSURE_STATE_UPDATED).putExtra(EXTRA_EXPOSURE_SUMMARY, exposureSummary) + Intent(ACTION_EXPOSURE_STATE_UPDATED) } else { Intent(ACTION_EXPOSURE_NOT_FOUND) } + if (token != TOKEN_A) { + intent.putExtra(EXTRA_EXPOSURE_SUMMARY, exposureSummary) + } intent.putExtra(EXTRA_TOKEN, token) intent.`package` = packageName Log.d(TAG, "Sending $intent")