[DialerIntent] add OutgoingCallReceiver.java file to git

This commit is contained in:
Brieuc Viel 2017-09-26 11:15:47 +02:00
parent 8924dca7d5
commit 21ed2955ef
2 changed files with 37 additions and 1 deletions

View file

@ -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);
}
}
}
}

@ -1 +1 @@
Subproject commit 19814348807cdab7f13637993a05a696f47685eb Subproject commit 475eb67b5cb8d82f6636e69c3bde8b18daeb824e