Added outgoing call from intent
This commit is contained in:
parent
e82c017872
commit
b0d78b4517
2 changed files with 26 additions and 0 deletions
|
@ -18,12 +18,14 @@ along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
|
import org.linphone.core.Log;
|
||||||
import org.linphone.ui.AddressAware;
|
import org.linphone.ui.AddressAware;
|
||||||
import org.linphone.ui.AddressText;
|
import org.linphone.ui.AddressText;
|
||||||
import org.linphone.ui.CallButton;
|
import org.linphone.ui.CallButton;
|
||||||
import org.linphone.ui.EraseButton;
|
import org.linphone.ui.EraseButton;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
@ -177,4 +179,21 @@ public class DialerFragment extends Fragment {
|
||||||
public void enableDisableAddContact() {
|
public void enableDisableAddContact() {
|
||||||
mAddContact.setEnabled(LinphoneManager.getLc().getCallsNb() > 0 || !mAddress.getText().toString().equals(""));
|
mAddContact.setEnabled(LinphoneManager.getLc().getCallsNb() > 0 || !mAddress.getText().toString().equals(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void newOutgoingCall(Intent intent) {
|
||||||
|
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();
|
||||||
|
intent.setData(null);
|
||||||
|
|
||||||
|
LinphoneManager.getInstance().newOutgoingCall(mAddress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1096,8 +1096,15 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (dialerFragment != null) {
|
||||||
|
((DialerFragment) dialerFragment).newOutgoingCall(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
if (currentFragment == FragmentsAvailable.DIALER) {
|
if (currentFragment == FragmentsAvailable.DIALER) {
|
||||||
|
|
Loading…
Reference in a new issue