Fix calls from native dialer.
This commit is contained in:
parent
f6afe8b15e
commit
d198bef5a1
3 changed files with 23 additions and 17 deletions
|
@ -16,19 +16,6 @@
|
|||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
|
||||
<activity android:name="org.linphone.LinphoneActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
android:launchMode="singleTask"
|
||||
> <!-- android:alwaysRetainTaskState="true" clearTaskOnLaunch="false"-->
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.CALL" />
|
||||
|
@ -46,6 +33,20 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
|
||||
<activity android:name="org.linphone.LinphoneActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
android:launchMode="singleTask"
|
||||
> <!-- android:alwaysRetainTaskState="true" clearTaskOnLaunch="false"-->
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name="org.linphone.IncomingCallActivity"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:launchMode="singleInstance">
|
||||
|
|
|
@ -153,10 +153,14 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
|
|||
|
||||
|
||||
public void newOutgoingCall(Intent intent) {
|
||||
if (Intent.ACTION_CALL.equalsIgnoreCase(intent.getAction())) {
|
||||
mAddress.setText(intent.getData().getSchemeSpecificPart());
|
||||
} else if (Intent.ACTION_SENDTO.equals(intent.getAction())) {
|
||||
String scheme = intent.getData().getScheme();
|
||||
if (scheme.startsWith("imto")) {
|
||||
mAddress.setText("sip:" + intent.getData().getLastPathSegment());
|
||||
} else if (scheme.startsWith("call") || scheme.startsWith("sip")) {
|
||||
mAddress.setText(intent.getData().getSchemeSpecificPart());
|
||||
} else {
|
||||
Log.e("Unknown scheme: ",scheme);
|
||||
mAddress.setText(intent.getData().getSchemeSpecificPart());
|
||||
}
|
||||
|
||||
mAddress.clearDisplayedName();
|
||||
|
|
|
@ -87,9 +87,10 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (!LinphoneManager.isInstanciated()) {
|
||||
Log.e("No service running: avoid crash by finishing ", this.getClass().getName());
|
||||
Log.e("No service running: avoid crash by starting the launcher", this.getClass().getName());
|
||||
// super.onCreate called earlier
|
||||
finish();
|
||||
startActivity(getIntent().setClass(this, LinphoneLauncherActivity.class));
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
|
|
Loading…
Reference in a new issue