Moved intent filter to LinphoneActivity to prevent launcher from showing each time + started to improve this process
This commit is contained in:
parent
50be31fdc6
commit
10f34a1979
5 changed files with 205 additions and 206 deletions
|
@ -74,6 +74,14 @@
|
|||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".LinphoneActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/LinphoneStyleLight">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.CALL" />
|
||||
<action android:name="android.intent.action.CALL_PRIVILEGED" />
|
||||
|
@ -122,14 +130,6 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".LinphoneActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/LinphoneStyleLight">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".call.CallIncomingActivity"
|
||||
android:launchMode="singleTop"
|
||||
|
|
|
@ -115,6 +115,7 @@ import org.linphone.settings.AccountPreferencesFragment;
|
|||
import org.linphone.settings.LinphonePreferences;
|
||||
import org.linphone.settings.SettingsFragment;
|
||||
import org.linphone.utils.DeviceUtils;
|
||||
import org.linphone.utils.IntentUtils;
|
||||
import org.linphone.utils.LinphoneGenericActivity;
|
||||
import org.linphone.utils.LinphoneUtils;
|
||||
import org.linphone.views.AddressText;
|
||||
|
@ -385,6 +386,7 @@ public class LinphoneActivity extends LinphoneGenericActivity
|
|||
|
||||
private void changeCurrentFragment(FragmentsAvailable newFragmentType, Bundle extras) {
|
||||
if (newFragmentType == mCurrentFragment
|
||||
&& newFragmentType != FragmentsAvailable.CHAT_LIST
|
||||
&& newFragmentType != FragmentsAvailable.CHAT
|
||||
&& newFragmentType != FragmentsAvailable.GROUP_CHAT) {
|
||||
return;
|
||||
|
@ -1394,6 +1396,8 @@ public class LinphoneActivity extends LinphoneGenericActivity
|
|||
Log.w(
|
||||
"[Linphone Activity] Device has been restricted by user (Android 9+), push notifications won't work !");
|
||||
}
|
||||
|
||||
IntentUtils.handleIntent(this, getIntent());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1457,31 +1461,6 @@ public class LinphoneActivity extends LinphoneGenericActivity
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent intent = getIntent();
|
||||
|
||||
if (intent.getStringExtra("msgShared") != null) {
|
||||
Bundle extras = new Bundle();
|
||||
extras.putString("messageDraft", intent.getStringExtra("msgShared"));
|
||||
changeCurrentFragment(FragmentsAvailable.CHAT_LIST, extras);
|
||||
intent.removeExtra("msgShared");
|
||||
} else if (intent.getStringExtra("fileShared") != null
|
||||
&& !intent.getStringExtra("fileShared").equals("")) {
|
||||
Bundle extras = new Bundle();
|
||||
extras.putString("fileSharedUri", intent.getStringExtra("fileShared"));
|
||||
changeCurrentFragment(FragmentsAvailable.CHAT_LIST, extras);
|
||||
intent.removeExtra("fileShared");
|
||||
}
|
||||
mIsOnBackground = false;
|
||||
|
||||
if (intent != null) {
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras != null && extras.containsKey("SipUriOrNumber")) {
|
||||
addressWaitingToBeCalled = extras.getString("SipUriOrNumber");
|
||||
intent.removeExtra("SipUriOrNumber");
|
||||
goToDialerFragment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1513,61 +1492,92 @@ public class LinphoneActivity extends LinphoneGenericActivity
|
|||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
|
||||
if (getCurrentFragment() == FragmentsAvailable.SETTINGS) {
|
||||
if (mFragment instanceof SettingsFragment) {
|
||||
((SettingsFragment) mFragment).closePreferenceScreen();
|
||||
}
|
||||
}
|
||||
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras != null && extras.getBoolean("GoToChat", false)) {
|
||||
if (extras != null) {
|
||||
if (extras.getBoolean("GoToChat", false)) {
|
||||
String localSipUri = extras.getString("LocalSipUri");
|
||||
String remoteSipUri = extras.getString("ChatContactSipUri");
|
||||
Log.i(
|
||||
"[Linphone Activity] Intent asked to go to chat, local URI "
|
||||
+ localSipUri
|
||||
+ ", remote URI "
|
||||
+ remoteSipUri);
|
||||
intent.putExtra("DoNotGoToCallActivity", true);
|
||||
if (remoteSipUri == null) {
|
||||
goToChatList();
|
||||
} else {
|
||||
goToChat(localSipUri, remoteSipUri, extras);
|
||||
}
|
||||
} else if (extras != null && extras.getBoolean("GoToHistory", false)) {
|
||||
} else if (extras.getBoolean("GoToHistory", false)) {
|
||||
Log.i("[Linphone Activity] Intent asked to go to call history");
|
||||
intent.putExtra("DoNotGoToCallActivity", true);
|
||||
changeCurrentFragment(FragmentsAvailable.HISTORY_LIST, null);
|
||||
} else if (extras != null && extras.getBoolean("GoToInapp", false)) {
|
||||
} else if (extras.getBoolean("GoToInapp", false)) {
|
||||
Log.i("[Linphone Activity] Intent asked to go to inapp");
|
||||
intent.putExtra("DoNotGoToCallActivity", true);
|
||||
displayInapp();
|
||||
} else if (extras != null && extras.getBoolean("Notification", false)) {
|
||||
} else if (extras.getBoolean("Notification", false)) {
|
||||
if (LinphoneManager.getLc().getCallsNb() > 0) {
|
||||
startIncallActivity();
|
||||
}
|
||||
} else if (extras != null && extras.getBoolean("StartCall", false)) {
|
||||
} else if (extras.getBoolean("StartCall", false)) {
|
||||
if (CallActivity.isInstanciated()) {
|
||||
CallActivity.instance().startIncomingCallActivity();
|
||||
} else {
|
||||
addressWaitingToBeCalled = extras.getString("NumberToCall");
|
||||
goToDialerFragment();
|
||||
}
|
||||
} else if (extras != null && extras.getBoolean("Transfer", false)) {
|
||||
} else if (extras.getBoolean("Transfer", false)) {
|
||||
intent.putExtra("DoNotGoToCallActivity", true);
|
||||
} else if (extras != null && extras.getBoolean("AddCall", false)) {
|
||||
} else if (extras.getBoolean("AddCall", false)) {
|
||||
intent.putExtra("DoNotGoToCallActivity", true);
|
||||
} else if (intent.getStringExtra("msgShared") != null) {
|
||||
String message = intent.getStringExtra("msgShared");
|
||||
Log.i(
|
||||
"[Linphone Activity] Intent asked to go to chat list to share message "
|
||||
+ message);
|
||||
extras.putString("messageDraft", message);
|
||||
changeCurrentFragment(FragmentsAvailable.CHAT_LIST, extras);
|
||||
intent.removeExtra("msgShared");
|
||||
} else if (intent.getStringExtra("fileShared") != null
|
||||
&& !intent.getStringExtra("fileShared").equals("")) {
|
||||
String file = intent.getStringExtra("fileShared");
|
||||
Log.i(
|
||||
"[Linphone Activity] Intent asked to go to chat list to share file(s) "
|
||||
+ file);
|
||||
extras.putString("fileSharedUri", file);
|
||||
changeCurrentFragment(FragmentsAvailable.CHAT_LIST, extras);
|
||||
intent.removeExtra("fileShared");
|
||||
} else {
|
||||
DialerFragment dialerFragment = DialerFragment.instance();
|
||||
if (dialerFragment != null) {
|
||||
if (extras != null && extras.containsKey("SipUriOrNumber")) {
|
||||
if (extras.containsKey("SipUriOrNumber")) {
|
||||
if (getResources()
|
||||
.getBoolean(R.bool.automatically_start_intercepted_outgoing_gsm_call)) {
|
||||
.getBoolean(
|
||||
R.bool.automatically_start_intercepted_outgoing_gsm_call)) {
|
||||
dialerFragment.newOutgoingCall(extras.getString("SipUriOrNumber"));
|
||||
} else {
|
||||
dialerFragment.displayTextInAddressBar(extras.getString("SipUriOrNumber"));
|
||||
dialerFragment.displayTextInAddressBar(
|
||||
extras.getString("SipUriOrNumber"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dialerFragment.newOutgoingCall(intent);
|
||||
}
|
||||
} else {
|
||||
if (extras != null && extras.containsKey("SipUriOrNumber")) {
|
||||
if (extras.containsKey("SipUriOrNumber")) {
|
||||
addressWaitingToBeCalled = extras.getString("SipUriOrNumber");
|
||||
goToDialerFragment();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setIntent(intent);
|
||||
|
||||
if (LinphoneManager.getLc().getCalls().length > 0) {
|
||||
// If a call is ringing, start incomingcallactivity
|
||||
Collection<Call.State> incoming = new ArrayList<>();
|
||||
|
@ -1581,8 +1591,6 @@ public class LinphoneActivity extends LinphoneGenericActivity
|
|||
}
|
||||
}
|
||||
}
|
||||
setIntent(intent);
|
||||
}
|
||||
|
||||
public boolean isOnBackground() {
|
||||
return mIsOnBackground;
|
||||
|
|
|
@ -24,26 +24,16 @@ import static android.content.Intent.ACTION_MAIN;
|
|||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import java.util.ArrayList;
|
||||
import org.linphone.assistant.RemoteProvisioningActivity;
|
||||
import org.linphone.call.CallActivity;
|
||||
import org.linphone.contacts.ContactsManager;
|
||||
import org.linphone.settings.LinphonePreferences;
|
||||
import org.linphone.utils.FileUtils;
|
||||
|
||||
/** Launch Linphone main activity when Service is ready. */
|
||||
public class LinphoneLauncherActivity extends Activity {
|
||||
|
||||
private final String ACTION_CALL_LINPHONE = "org.linphone.intent.action.CallLaunched";
|
||||
|
||||
private Handler mHandler;
|
||||
private ServiceWaitThread mServiceThread;
|
||||
private String mAddressToCall;
|
||||
private Uri mUriToResolve;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -56,32 +46,6 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
|
||||
mHandler = new Handler();
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
String action = intent.getAction();
|
||||
if (Intent.ACTION_CALL.equals(action)) {
|
||||
if (intent.getData() != null) {
|
||||
mAddressToCall = intent.getData().toString();
|
||||
mAddressToCall = mAddressToCall.replace("%40", "@");
|
||||
mAddressToCall = mAddressToCall.replace("%3A", ":");
|
||||
if (mAddressToCall.startsWith("sip:")) {
|
||||
mAddressToCall = mAddressToCall.substring("sip:".length());
|
||||
} else if (mAddressToCall.startsWith("tel:")) {
|
||||
mAddressToCall = mAddressToCall.substring("tel:".length());
|
||||
}
|
||||
}
|
||||
} else if (Intent.ACTION_VIEW.equals(action)) {
|
||||
if (LinphoneService.isReady()) {
|
||||
mAddressToCall =
|
||||
ContactsManager.getInstance()
|
||||
.getAddressOrNumberForAndroidContact(
|
||||
getContentResolver(), intent.getData());
|
||||
} else {
|
||||
mUriToResolve = intent.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LinphoneService.isReady()) {
|
||||
onServiceReady();
|
||||
} else {
|
||||
|
@ -108,66 +72,8 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Intent newIntent = new Intent(LinphoneLauncherActivity.this, classToStart);
|
||||
Intent intent = getIntent();
|
||||
String stringFileShared = null;
|
||||
String stringUriFileShared = null;
|
||||
Uri fileUri = null;
|
||||
if (intent != null) {
|
||||
String action = intent.getAction();
|
||||
String type = intent.getType();
|
||||
newIntent.setData(intent.getData());
|
||||
if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
if (("text/plain").equals(type)
|
||||
&& intent.getStringExtra(Intent.EXTRA_TEXT) != null) {
|
||||
stringFileShared = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
newIntent.putExtra("msgShared", stringFileShared);
|
||||
} else {
|
||||
fileUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
stringUriFileShared =
|
||||
FileUtils.getFilePath(getBaseContext(), fileUri);
|
||||
newIntent.putExtra("fileShared", stringUriFileShared);
|
||||
}
|
||||
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) {
|
||||
if (type.startsWith("image/")) {
|
||||
ArrayList<Uri> imageUris =
|
||||
intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
|
||||
String filePaths = "";
|
||||
for (Uri uri : imageUris) {
|
||||
filePaths += FileUtils.getFilePath(getBaseContext(), uri);
|
||||
filePaths += ":";
|
||||
}
|
||||
newIntent.putExtra("fileShared", filePaths);
|
||||
}
|
||||
} else if (ACTION_CALL_LINPHONE.equals(action)
|
||||
&& (intent.getStringExtra("NumberToCall") != null)) {
|
||||
String numberToCall = intent.getStringExtra("NumberToCall");
|
||||
if (CallActivity.isInstanciated()) {
|
||||
CallActivity.instance().startIncomingCallActivity();
|
||||
} else {
|
||||
LinphoneManager.getInstance()
|
||||
.newOutgoingCall(numberToCall, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mUriToResolve != null) {
|
||||
mAddressToCall =
|
||||
ContactsManager.getInstance()
|
||||
.getAddressOrNumberForAndroidContact(
|
||||
getContentResolver(), mUriToResolve);
|
||||
Log.i(
|
||||
"LinphoneLauncher",
|
||||
"Intent has uri to resolve : " + mUriToResolve.toString());
|
||||
mUriToResolve = null;
|
||||
}
|
||||
if (mAddressToCall != null) {
|
||||
newIntent.putExtra("SipUriOrNumber", mAddressToCall);
|
||||
Log.i(
|
||||
"LinphoneLauncher",
|
||||
"Intent has address to call : " + mAddressToCall);
|
||||
mAddressToCall = null;
|
||||
}
|
||||
startActivity(newIntent);
|
||||
Intent intent = new Intent(LinphoneLauncherActivity.this, classToStart);
|
||||
startActivity(intent);
|
||||
}
|
||||
},
|
||||
1000);
|
||||
|
|
|
@ -20,11 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
*/
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.Application;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
|
@ -32,7 +29,6 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemClock;
|
||||
import android.provider.ContactsContract;
|
||||
import android.view.WindowManager;
|
||||
import java.util.ArrayList;
|
||||
|
@ -52,7 +48,6 @@ import org.linphone.core.tools.Log;
|
|||
import org.linphone.mediastream.Version;
|
||||
import org.linphone.notifications.NotificationsManager;
|
||||
import org.linphone.receivers.BluetoothManager;
|
||||
import org.linphone.receivers.KeepAliveReceiver;
|
||||
import org.linphone.settings.LinphonePreferences;
|
||||
import org.linphone.utils.LinphoneUtils;
|
||||
import org.linphone.views.LinphoneGL2JNIViewOverlay;
|
||||
|
@ -175,7 +170,7 @@ public final class LinphoneService extends Service {
|
|||
|
||||
if (sInstance != null) {
|
||||
Log.w("[Service] Attempt to start the LinphoneService but it is already running !");
|
||||
return START_REDELIVER_INTENT;
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
LinphoneManager.createAndStart(this, isPush);
|
||||
|
@ -263,25 +258,9 @@ public final class LinphoneService extends Service {
|
|||
5000);
|
||||
}
|
||||
|
||||
// make sure the application will at least wakes up every 10 mn
|
||||
if (LinphonePreferences.instance().isBackgroundModeEnabled()
|
||||
&& (!LinphonePreferences.instance().isPushNotificationEnabled()
|
||||
|| !LinphoneManager.getInstance().hasLinphoneAccount())) {
|
||||
Intent keepAliveIntent = new Intent(this, KeepAliveReceiver.class);
|
||||
PendingIntent keepAlivePendingIntent =
|
||||
PendingIntent.getBroadcast(
|
||||
this, 0, keepAliveIntent, PendingIntent.FLAG_ONE_SHOT);
|
||||
AlarmManager alarmManager =
|
||||
((AlarmManager) this.getSystemService(Context.ALARM_SERVICE));
|
||||
alarmManager.setExact(
|
||||
AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
||||
SystemClock.elapsedRealtime() + 600000,
|
||||
keepAlivePendingIntent);
|
||||
}
|
||||
|
||||
BluetoothManager.getInstance().initBluetooth();
|
||||
|
||||
return START_REDELIVER_INTENT;
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
106
app/src/main/java/org/linphone/utils/IntentUtils.java
Normal file
106
app/src/main/java/org/linphone/utils/IntentUtils.java
Normal file
|
@ -0,0 +1,106 @@
|
|||
package org.linphone.utils;
|
||||
|
||||
/*
|
||||
IntentUtils.java
|
||||
Copyright (C) 2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import java.util.ArrayList;
|
||||
import org.linphone.LinphoneActivity;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.call.CallActivity;
|
||||
import org.linphone.contacts.ContactsManager;
|
||||
import org.linphone.core.tools.Log;
|
||||
|
||||
public class IntentUtils {
|
||||
private static final String ACTION_CALL_LINPHONE = "org.linphone.intent.action.CallLaunched";
|
||||
|
||||
public static void handleIntent(Context context, Intent intent) {
|
||||
if (intent == null) return;
|
||||
|
||||
Intent newIntent = new Intent(context, LinphoneActivity.class);
|
||||
String stringFileShared;
|
||||
String stringUriFileShared;
|
||||
Uri fileUri;
|
||||
String addressToCall;
|
||||
|
||||
String action = intent.getAction();
|
||||
String type = intent.getType();
|
||||
newIntent.setData(intent.getData());
|
||||
|
||||
if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
if (("text/plain").equals(type) && intent.getStringExtra(Intent.EXTRA_TEXT) != null) {
|
||||
stringFileShared = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
newIntent.putExtra("msgShared", stringFileShared);
|
||||
Log.i("[Intent Utils] ACTION_SEND with text/plain data: " + stringFileShared);
|
||||
} else {
|
||||
fileUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
stringUriFileShared = FileUtils.getFilePath(context, fileUri);
|
||||
newIntent.putExtra("fileShared", stringUriFileShared);
|
||||
Log.i("[Intent Utils] ACTION_SEND with file: " + stringUriFileShared);
|
||||
}
|
||||
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) {
|
||||
if (type.startsWith("image/")) {
|
||||
ArrayList<Uri> imageUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
|
||||
String filePaths = "";
|
||||
for (Uri uri : imageUris) {
|
||||
filePaths += FileUtils.getFilePath(context, uri);
|
||||
filePaths += ":";
|
||||
}
|
||||
newIntent.putExtra("fileShared", filePaths);
|
||||
Log.i("[Intent Utils] ACTION_SEND_MULTIPLE with files: " + filePaths);
|
||||
}
|
||||
} else if (ACTION_CALL_LINPHONE.equals(action)
|
||||
&& (intent.getStringExtra("NumberToCall") != null)) {
|
||||
String numberToCall = intent.getStringExtra("NumberToCall");
|
||||
Log.i("[Intent Utils] ACTION_CALL_LINPHONE with number: " + numberToCall);
|
||||
if (CallActivity.isInstanciated()) {
|
||||
CallActivity.instance().startIncomingCallActivity();
|
||||
} else {
|
||||
LinphoneManager.getInstance().newOutgoingCall(numberToCall, null);
|
||||
}
|
||||
} else if (Intent.ACTION_CALL.equals(action)) {
|
||||
if (intent.getData() != null) {
|
||||
addressToCall = intent.getData().toString();
|
||||
addressToCall = addressToCall.replace("%40", "@");
|
||||
addressToCall = addressToCall.replace("%3A", ":");
|
||||
if (addressToCall.startsWith("sip:")) {
|
||||
addressToCall = addressToCall.substring("sip:".length());
|
||||
} else if (addressToCall.startsWith("tel:")) {
|
||||
addressToCall = addressToCall.substring("tel:".length());
|
||||
}
|
||||
Log.i("[Intent Utils] ACTION_CALL with number: " + addressToCall);
|
||||
newIntent.putExtra("SipUriOrNumber", addressToCall);
|
||||
}
|
||||
} else if (Intent.ACTION_VIEW.equals(action)) {
|
||||
addressToCall =
|
||||
ContactsManager.getInstance()
|
||||
.getAddressOrNumberForAndroidContact(
|
||||
context.getContentResolver(), intent.getData());
|
||||
newIntent.putExtra("SipUriOrNumber", addressToCall);
|
||||
Log.i("[Intent Utils] ACTION_VIEW with number: " + addressToCall);
|
||||
} else {
|
||||
Log.i("[Intent Utils] Unknown action [" + action + "], skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
context.startActivity(newIntent);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue