From 21ed2955ef47ef89f5e71c812ea64b3ace074442 Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Tue, 26 Sep 2017 11:15:47 +0200 Subject: [PATCH] [DialerIntent] add OutgoingCallReceiver.java file to git --- .../org/linphone/OutgoingCallReceiver.java | 36 +++++++++++++++++++ submodules/mswebrtc | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/android/org/linphone/OutgoingCallReceiver.java diff --git a/src/android/org/linphone/OutgoingCallReceiver.java b/src/android/org/linphone/OutgoingCallReceiver.java new file mode 100644 index 000000000..5b6e5a84d --- /dev/null +++ b/src/android/org/linphone/OutgoingCallReceiver.java @@ -0,0 +1,36 @@ +package org.linphone; + + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; + + +public class OutgoingCallReceiver extends BroadcastReceiver { + private final static String TAG = "CallHandler"; + private final String ACTION_CALL_LINPHONE = "org.linphone.intent.action.CallLaunched"; + + private LinphonePreferences mPrefs; + + @Override + public void onReceive(Context context, Intent intent) { + mPrefs = LinphonePreferences.instance(); + Log.e(TAG, "===>>>> Linphone OutgoingCallReceiver "); + if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) { + Log.e(TAG, "===>>>> Linphone OutgoingCallReceiver : ACTION_NEW_OUTGOING_CALL"); + String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); + if(mPrefs.getNativeDialerCall()){ + abortBroadcast(); + setResultData(null); + Intent newIntent = new Intent(ACTION_CALL_LINPHONE); + newIntent.setFlags(FLAG_ACTIVITY_NEW_TASK); + newIntent.putExtra("StartCall", true); + newIntent.putExtra("NumberToCall", number); + context.startActivity(newIntent); + } + } + } +} \ No newline at end of file diff --git a/submodules/mswebrtc b/submodules/mswebrtc index 198143488..475eb67b5 160000 --- a/submodules/mswebrtc +++ b/submodules/mswebrtc @@ -1 +1 @@ -Subproject commit 19814348807cdab7f13637993a05a696f47685eb +Subproject commit 475eb67b5cb8d82f6636e69c3bde8b18daeb824e