@@ -130,6 +130,8 @@ public static RNCallKeepModule getInstance(ReactApplicationContext reactContext,
130130 if (instance == null ) {
131131 Log .d (TAG , "[RNCallKeepModule] getInstance : " + (reactContext == null ? "null" : "ok" ));
132132 instance = new RNCallKeepModule (reactContext );
133+ instance .registerReceiver ();
134+ instance .fetchStoredSettings (reactContext );
133135 }
134136 if (realContext ) {
135137 instance .setContext (reactContext );
@@ -151,8 +153,6 @@ private RNCallKeepModule(ReactApplicationContext reactContext) {
151153
152154 this .reactContext = reactContext ;
153155 delayedEvents = new WritableNativeArray ();
154- this .registerReceiver ();
155- this .fetchStoredSettings (reactContext );
156156 }
157157
158158 private boolean isSelfManaged () {
@@ -1024,7 +1024,7 @@ private boolean hasPhoneAccount() {
10241024 telecomManager .getPhoneAccount (handle ).isEnabled ();
10251025 }
10261026
1027- private void registerReceiver () {
1027+ protected void registerReceiver () {
10281028 if (!isReceiverRegistered ) {
10291029 isReceiverRegistered = true ;
10301030 voiceBroadcastReceiver = new VoiceBroadcastReceiver ();
@@ -1078,7 +1078,7 @@ private WritableMap storeSettings(ReadableMap options) {
10781078 return MapUtils .readableToWritableMap (options );
10791079 }
10801080
1081- private static void fetchStoredSettings (@ Nullable Context fromContext ) {
1081+ protected static void fetchStoredSettings (@ Nullable Context fromContext ) {
10821082 Context context = fromContext != null ? fromContext : instance .getAppContext ();
10831083 if (instance == null && context == null ) {
10841084 Log .w (TAG , "[RNCallKeepModule][fetchStoredSettings] no instance nor fromContext." );
0 commit comments