Fixed call from contacts on Samsung
This commit is contained in:
parent
1d661e7048
commit
8320b11825
2 changed files with 34 additions and 16 deletions
|
@ -1396,9 +1396,17 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
if (intent.getStringExtra("msgShared") != null)
|
||||
displayChat(null, intent.getStringExtra("msgShared"));
|
||||
|
||||
|
||||
doNotGoToCallActivity = false;
|
||||
isOnBackground = false;
|
||||
|
||||
if (intent != null) {
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras != null && extras.containsKey("SipUriOrNumber")) {
|
||||
mAddressWaitingToBeCalled = extras.getString("SipUriOrNumber");
|
||||
intent.removeExtra("SipUriOrNumber");
|
||||
goToDialerFragment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1431,8 +1439,6 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
|
||||
|
||||
|
||||
if (getCurrentFragment() == FragmentsAvailable.SETTINGS) {
|
||||
if (fragment instanceof SettingsFragment) {
|
||||
((SettingsFragment) fragment).closePreferenceScreen();
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.linphone.tutorials.TutorialLauncherActivity;
|
|||
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;
|
||||
|
||||
|
@ -43,6 +44,7 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
private Handler mHandler;
|
||||
private ServiceWaitThread mServiceThread;
|
||||
private String addressToCall;
|
||||
private Uri uriToResolve;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -56,16 +58,6 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
|
||||
mHandler = new Handler();
|
||||
|
||||
|
||||
if (LinphoneService.isReady()) {
|
||||
onServiceReady();
|
||||
} else {
|
||||
// start linphone as background
|
||||
startService(new Intent(ACTION_MAIN).setClass(this, LinphoneService.class));
|
||||
mServiceThread = new ServiceWaitThread();
|
||||
mServiceThread.start();
|
||||
}
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
String action = intent.getAction();
|
||||
|
@ -78,10 +70,25 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
addressToCall = addressToCall.substring("sip:".length());
|
||||
}
|
||||
}
|
||||
} else if (Intent.ACTION_VIEW.equals(action)) {
|
||||
if (LinphoneService.isReady()) {
|
||||
addressToCall = ContactsManager.getInstance().getAddressOrNumberForAndroidContact(getContentResolver(), intent.getData());
|
||||
} else {
|
||||
uriToResolve = intent.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LinphoneService.isReady()) {
|
||||
onServiceReady();
|
||||
} else {
|
||||
// start linphone as background
|
||||
startService(new Intent(ACTION_MAIN).setClass(this, LinphoneService.class));
|
||||
mServiceThread = new ServiceWaitThread();
|
||||
mServiceThread.start();
|
||||
}
|
||||
}
|
||||
|
||||
protected void onServiceReady() {
|
||||
final Class<? extends Activity> classToStart;
|
||||
if (getResources().getBoolean(R.bool.show_tutorials_instead_of_app)) {
|
||||
|
@ -114,6 +121,11 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (uriToResolve != null) {
|
||||
addressToCall = ContactsManager.getInstance().getAddressOrNumberForAndroidContact(getContentResolver(), uriToResolve);
|
||||
Log.i("Intent has uri to resolve : " + uriToResolve.toString());
|
||||
uriToResolve = null;
|
||||
}
|
||||
if (addressToCall != null) {
|
||||
newIntent.putExtra("SipUriOrNumber", addressToCall);
|
||||
Log.i("Intent has address to call : " + addressToCall);
|
||||
|
|
Loading…
Reference in a new issue