Skip to content

Commit

Permalink
Bitrise Error For Release (#900)
Browse files Browse the repository at this point in the history
Update the constant to be used in a Kotlin object
Add the missing import to the StatusUpdatedWorker in the release package
  • Loading branch information
KyletheWolff authored May 5, 2021
1 parent 9c498e5 commit 570c9f9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -44,15 +45,14 @@
*/
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;

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
Expand Down Expand Up @@ -97,7 +97,8 @@ public ListenableFuture<Result> 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(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.pathcheck.covidsafepaths.exposurenotifications.common

object DebugConstants {
const val IS_SIMULATING_EXPOSURE_STATE_UPDATED = "isSimulating"
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 570c9f9

Please sign in to comment.