@@ -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 voiceBroadcastReceiver = new VoiceBroadcastReceiver ();
10301030 IntentFilter intentFilter = new IntentFilter ();
@@ -1075,7 +1075,7 @@ private WritableMap storeSettings(ReadableMap options) {
10751075 return MapUtils .readableToWritableMap (options );
10761076 }
10771077
1078- private static void fetchStoredSettings (@ Nullable Context fromContext ) {
1078+ protected static void fetchStoredSettings (@ Nullable Context fromContext ) {
10791079 Context context = fromContext != null ? fromContext : instance .getAppContext ();
10801080 if (instance == null && context == null ) {
10811081 Log .w (TAG , "[RNCallKeepModule][fetchStoredSettings] no instance nor fromContext." );
0 commit comments