@@ -130,6 +130,8 @@ public static RNCallKeepModule getInstance(ReactApplicationContext reactContext,
130
130
if (instance == null ) {
131
131
Log .d (TAG , "[RNCallKeepModule] getInstance : " + (reactContext == null ? "null" : "ok" ));
132
132
instance = new RNCallKeepModule (reactContext );
133
+ instance .registerReceiver ();
134
+ instance .fetchStoredSettings (reactContext );
133
135
}
134
136
if (realContext ) {
135
137
instance .setContext (reactContext );
@@ -151,8 +153,6 @@ private RNCallKeepModule(ReactApplicationContext reactContext) {
151
153
152
154
this .reactContext = reactContext ;
153
155
delayedEvents = new WritableNativeArray ();
154
- this .registerReceiver ();
155
- this .fetchStoredSettings (reactContext );
156
156
}
157
157
158
158
private boolean isSelfManaged () {
@@ -1024,7 +1024,7 @@ private boolean hasPhoneAccount() {
1024
1024
telecomManager .getPhoneAccount (handle ).isEnabled ();
1025
1025
}
1026
1026
1027
- private void registerReceiver () {
1027
+ protected void registerReceiver () {
1028
1028
if (!isReceiverRegistered ) {
1029
1029
isReceiverRegistered = true ;
1030
1030
voiceBroadcastReceiver = new VoiceBroadcastReceiver ();
@@ -1078,7 +1078,7 @@ private WritableMap storeSettings(ReadableMap options) {
1078
1078
return MapUtils .readableToWritableMap (options );
1079
1079
}
1080
1080
1081
- private static void fetchStoredSettings (@ Nullable Context fromContext ) {
1081
+ protected static void fetchStoredSettings (@ Nullable Context fromContext ) {
1082
1082
Context context = fromContext != null ? fromContext : instance .getAppContext ();
1083
1083
if (instance == null && context == null ) {
1084
1084
Log .w (TAG , "[RNCallKeepModule][fetchStoredSettings] no instance nor fromContext." );
0 commit comments