Page MenuHomePhabricator

D4240.id13432.diff
No OneTemporary

D4240.id13432.diff

diff --git a/native/android/app/src/main/java/app/comm/android/fbjni/CommSecureStore.java b/native/android/app/src/main/java/app/comm/android/fbjni/CommSecureStore.java
--- a/native/android/app/src/main/java/app/comm/android/fbjni/CommSecureStore.java
+++ b/native/android/app/src/main/java/app/comm/android/fbjni/CommSecureStore.java
@@ -4,10 +4,11 @@
import expo.modules.core.arguments.MapArguments;
import expo.modules.core.arguments.ReadableArguments;
import expo.modules.securestore.SecureStoreModule;
-
+import java.util.concurrent.atomic.AtomicBoolean;
public class CommSecureStore {
private static final CommSecureStore instance = new CommSecureStore();
+ private static AtomicBoolean initialized = new AtomicBoolean(false);
private SecureStoreModule secureStoreModule = null;
private final ReadableArguments readableArguments;
@@ -20,7 +21,9 @@
}
public void initialize(SecureStoreModule secureStoreModule) {
- this.secureStoreModule = secureStoreModule;
+ if (CommSecureStore.initialized.compareAndSet(false, true)) {
+ this.secureStoreModule = secureStoreModule;
+ }
}
private void checkModule() {

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 3:27 PM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2605346
Default Alt Text
D4240.id13432.diff (1 KB)

Event Timeline