From 570c9f91ae551da2ffeb15a6cbfe34153451f434 Mon Sep 17 00:00:00 2001 From: Kyle Wolff Date: Wed, 5 May 2021 19:59:43 -0400 Subject: [PATCH] Bitrise Error For Release (#900) Update the constant to be used in a Kotlin object Add the missing import to the StatusUpdatedWorker in the release package --- .../exposurenotifications/nearby/StateUpdatedWorker.java | 7 ++++--- .../exposurenotifications/common/DebugConstants.kt | 5 +++++ .../reactmodules/DebugMenuModule.java | 5 ++--- .../exposurenotifications/nearby/StateUpdatedWorker.java | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/common/DebugConstants.kt diff --git a/android/app/src/debug/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java b/android/app/src/debug/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java index 35f401bba..042047acf 100644 --- a/android/app/src/debug/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java +++ b/android/app/src/debug/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java @@ -33,6 +33,7 @@ import org.pathcheck.covidsafepaths.bridge.EventSender; import org.pathcheck.covidsafepaths.exposurenotifications.ExposureNotificationClientWrapper; import org.pathcheck.covidsafepaths.exposurenotifications.common.AppExecutors; +import org.pathcheck.covidsafepaths.exposurenotifications.common.DebugConstants; import org.pathcheck.covidsafepaths.exposurenotifications.common.NotificationHelper; import org.pathcheck.covidsafepaths.exposurenotifications.storage.RealmSecureStorageBte; @@ -44,7 +45,6 @@ */ public class StateUpdatedWorker extends ListenableWorker { private static final String TAG = "StateUpdatedWorker"; - public static final String IS_SIMULATING = "isSimulating"; private final Context context; private final boolean isSimulating; @@ -52,7 +52,7 @@ public class StateUpdatedWorker extends ListenableWorker { public StateUpdatedWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) { super(context, workerParams); this.context = context; - isSimulating = workerParams.getInputData().getBoolean(IS_SIMULATING, false); + isSimulating = workerParams.getInputData().getBoolean(DebugConstants.IS_SIMULATING_EXPOSURE_STATE_UPDATED, false); } @NonNull @@ -97,7 +97,8 @@ public ListenableFuture startWork() { static void runOnce(Context context, Intent intent) { Data data = new Data.Builder() - .putBoolean(IS_SIMULATING, intent.getBooleanExtra(IS_SIMULATING, false)) + .putBoolean(DebugConstants.IS_SIMULATING_EXPOSURE_STATE_UPDATED, + intent.getBooleanExtra(DebugConstants.IS_SIMULATING_EXPOSURE_STATE_UPDATED, false)) .build(); WorkManager.getInstance(context).enqueue( diff --git a/android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/common/DebugConstants.kt b/android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/common/DebugConstants.kt new file mode 100644 index 000000000..a186d060d --- /dev/null +++ b/android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/common/DebugConstants.kt @@ -0,0 +1,5 @@ +package org.pathcheck.covidsafepaths.exposurenotifications.common + +object DebugConstants { + const val IS_SIMULATING_EXPOSURE_STATE_UPDATED = "isSimulating" +} \ No newline at end of file diff --git a/android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/reactmodules/DebugMenuModule.java b/android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/reactmodules/DebugMenuModule.java index db397979c..6fe35a88f 100644 --- a/android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/reactmodules/DebugMenuModule.java +++ b/android/app/src/main/java/org/pathcheck/covidsafepaths/exposurenotifications/reactmodules/DebugMenuModule.java @@ -1,7 +1,5 @@ package org.pathcheck.covidsafepaths.exposurenotifications.reactmodules; -import static org.pathcheck.covidsafepaths.exposurenotifications.nearby.StateUpdatedWorker.IS_SIMULATING; - import android.content.Intent; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; @@ -19,6 +17,7 @@ import org.jetbrains.annotations.NotNull; import org.pathcheck.covidsafepaths.exposurenotifications.ExposureNotificationClientWrapper; import org.pathcheck.covidsafepaths.exposurenotifications.common.AppExecutors; +import org.pathcheck.covidsafepaths.exposurenotifications.common.DebugConstants; import org.pathcheck.covidsafepaths.exposurenotifications.dto.RNDiagnosisKey; import org.pathcheck.covidsafepaths.exposurenotifications.nearby.ExposureNotificationBroadcastReceiver; import org.pathcheck.covidsafepaths.exposurenotifications.storage.RealmSecureStorageBte; @@ -74,7 +73,7 @@ public void onFailure(@NotNull Throwable exception) { public void simulateExposure(Promise promise) { Intent exposureIntent = new Intent(getReactApplicationContext(), ExposureNotificationBroadcastReceiver.class); exposureIntent.setAction("com.google.android.gms.exposurenotification.ACTION_EXPOSURE_STATE_UPDATED"); - exposureIntent.putExtra(IS_SIMULATING, true); + exposureIntent.putExtra(DebugConstants.IS_SIMULATING_EXPOSURE_STATE_UPDATED, true); getReactApplicationContext().sendBroadcast(exposureIntent); promise.resolve(null); } diff --git a/android/app/src/release/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java b/android/app/src/release/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java index 8a28f9947..0e498cdd8 100644 --- a/android/app/src/release/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java +++ b/android/app/src/release/java/org/pathcheck/covidsafepaths/exposurenotifications/nearby/StateUpdatedWorker.java @@ -18,6 +18,7 @@ package org.pathcheck.covidsafepaths.exposurenotifications.nearby; import android.content.Context; +import android.content.Intent; import android.util.Log; import androidx.annotation.NonNull; import androidx.work.ListenableWorker;