File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
android/src/main/java/io/wazo/callkeep Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 4949
5050// @see https://github.com/kbagchiGWC/voice-quickstart-android/blob/9a2aff7fbe0d0a5ae9457b48e9ad408740dfb968/exampleConnectionService/src/main/java/com/twilio/voice/examples/connectionservice/VoiceConnectionServiceActivity.java
5151public class RNCallKeepModule extends ReactContextBaseJavaModule {
52- Activity mActivity = null ;
53-
5452 public static final int REQUEST_READ_PHONE_STATE = 1337 ;
5553 public static final int REQUEST_REGISTER_CALL_PROVIDER = 394859 ;
5654
@@ -238,10 +236,8 @@ public void backToForeground() {
238236
239237 focusIntent .addFlags (Intent .FLAG_ACTIVITY_REORDER_TO_FRONT );
240238
241- final Activity activity = getActivity ();
242- if (activity != null ) {
243- activity .startActivity (focusIntent );
244- }
239+ Activity activity = getCurrentActivity ();
240+ activity .startActivity (focusIntent );
245241 }
246242
247243 private void registerPhoneAccount (Context appContext ) {
@@ -312,13 +308,6 @@ private Context getAppContext() {
312308 return this .reactContext .getApplicationContext ();
313309 }
314310
315- private Activity getActivity () {
316- Activity activity = getCurrentActivity ();
317- if (activity == null ) activity = mActivity ;
318-
319- return activity ;
320- }
321-
322311 private class VoiceBroadcastReceiver extends BroadcastReceiver {
323312 @ Override
324313 public void onReceive (Context context , Intent intent ) {
You can’t perform that action at this time.
0 commit comments