Revert to old way of registering app to handle gsm calls
This commit is contained in:
parent
739336df42
commit
aacd92c2e4
2 changed files with 8 additions and 50 deletions
|
@ -50,6 +50,14 @@
|
|||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.CALL" />
|
||||
<action android:name="android.intent.action.CALL_PRIVILEGED" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:scheme="tel" />
|
||||
<data android:scheme="sip" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SENDTO" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
@ -107,12 +115,6 @@
|
|||
android:label="@string/service_name"
|
||||
android:stopWithTask="false"/>
|
||||
|
||||
<receiver android:name="org.linphone.AndroidCallInterceptor">
|
||||
<intent-filter android:priority="99">
|
||||
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="org.linphone.NetworkManager">
|
||||
<intent-filter><action android:name="android.net.conn.CONNECTIVITY_CHANGE"></action></intent-filter>
|
||||
</receiver>
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
package org.linphone;
|
||||
|
||||
/*
|
||||
AndroidCallInterceptor.java
|
||||
Copyright (C) 2014 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
public class AndroidCallInterceptor extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String phoneNumber = getResultData();
|
||||
if (phoneNumber == null) {
|
||||
phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
|
||||
}
|
||||
|
||||
if (context.getResources().getBoolean(R.bool.intercept_outgoing_gsm_calls)) {
|
||||
setResultData(null);
|
||||
Intent i = new Intent();
|
||||
i.setClass(context, LinphoneActivity.class);
|
||||
i.putExtra("SipUriOrNumber", phoneNumber);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(i);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue