From 412e513afe8e27c4d183c23e05f27ab752ead0b2 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 21 Feb 2021 16:39:12 -0600 Subject: [PATCH] EN: Implement new versioning scheme of API 1.8 --- .../org/microg/gms/nearby/exposurenotification/Constants.java | 4 ++++ .../exposurenotification/ExposureNotificationServiceImpl.kt | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/play-services-nearby-api/src/main/java/org/microg/gms/nearby/exposurenotification/Constants.java b/play-services-nearby-api/src/main/java/org/microg/gms/nearby/exposurenotification/Constants.java index 11d7fdc2..5c40b145 100644 --- a/play-services-nearby-api/src/main/java/org/microg/gms/nearby/exposurenotification/Constants.java +++ b/play-services-nearby-api/src/main/java/org/microg/gms/nearby/exposurenotification/Constants.java @@ -5,6 +5,8 @@ package org.microg.gms.nearby.exposurenotification; +import static org.microg.gms.common.Constants.GMS_VERSION_CODE; + public class Constants { public static final String ACTION_EXPOSURE_NOTIFICATION_SETTINGS = "com.google.android.gms.settings.EXPOSURE_NOTIFICATION_SETTINGS"; public static final String ACTION_EXPOSURE_NOT_FOUND = "com.google.android.gms.exposurenotification.ACTION_EXPOSURE_NOT_FOUND"; @@ -17,4 +19,6 @@ public class Constants { public static final String EXTRA_TOKEN = "com.google.android.gms.exposurenotification.EXTRA_TOKEN"; public static final String TOKEN_A = "TYZWQ32170AXEUVCDW7A"; public static final int DAYS_SINCE_ONSET_OF_SYMPTOMS_UNKNOWN = Integer.MAX_VALUE; + public static final int VERSION = 18; + public static final long VERSION_FULL = ((long)VERSION) * 1000000000L + GMS_VERSION_CODE; } 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 43bd8496..566a0f9a 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 @@ -22,7 +22,6 @@ import com.google.android.gms.nearby.exposurenotification.internal.* import kotlinx.coroutines.* import org.json.JSONArray import org.json.JSONObject -import org.microg.gms.common.Constants import org.microg.gms.common.PackageUtils import org.microg.gms.nearby.exposurenotification.Constants.* import org.microg.gms.nearby.exposurenotification.proto.TemporaryExposureKeyExport @@ -96,7 +95,7 @@ class ExposureNotificationServiceImpl(private val context: Context, private val } override fun getVersion(params: GetVersionParams) { - params.callback.onResult(Status.SUCCESS, Constants.GMS_VERSION_CODE.toLong()) + params.callback.onResult(Status.SUCCESS, VERSION_FULL) } override fun getCalibrationConfidence(params: GetCalibrationConfidenceParams) {