Merge branch 'master' of git.linphone.org:linphone-android

This commit is contained in:
Simon Morlat 2012-05-11 16:05:32 +02:00
commit 2715cb4ea7
10 changed files with 42 additions and 12 deletions

View file

@ -17,6 +17,7 @@
<bool name="allow_edit_in_dialer">true</bool> <bool name="allow_edit_in_dialer">true</bool>
<color name="conf_active_bg_color">#191970</color> <color name="conf_active_bg_color">#191970</color>
<bool name="forbid_self_call">false</bool>
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string> <string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
</resources> </resources>

View file

@ -2,6 +2,8 @@
<resources> <resources>
<!-- Do not translate any of the strings below --> <!-- Do not translate any of the strings below -->
<string name="pref_disable_account_key">pref_disable_account_key</string>
<string name="pref_tunnel_key">pref_tunnel_key</string> <string name="pref_tunnel_key">pref_tunnel_key</string>
<string name="pref_tunnel_mode_key">pref_tunnel_mode_key</string> <string name="pref_tunnel_mode_key">pref_tunnel_mode_key</string>
<string name="tunnel_mode_entry_value_disabled">disabled</string> <string name="tunnel_mode_entry_value_disabled">disabled</string>

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="pref_disable_account">Disable</string>
<string name="pref_tunnel">Tunnel</string> <string name="pref_tunnel">Tunnel</string>
<string name="pref_tunnel_host">Hostname</string> <string name="pref_tunnel_host">Hostname</string>
<string name="pref_tunnel_port">Port</string> <string name="pref_tunnel_port">Port</string>

View file

@ -84,6 +84,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
private LinearLayout mInCallControls; private LinearLayout mInCallControls;
private static DialerActivity instance; private static DialerActivity instance;
public boolean mVisible;
private boolean mPreventDoubleCallOnRotation; private boolean mPreventDoubleCallOnRotation;
private AlertDialog wizardDialog; private AlertDialog wizardDialog;
@ -226,7 +227,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
mBack.setOnClickListener(new OnClickListener() { mBack.setOnClickListener(new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
if (call.getCurrentParamsCopy().getVideoEnabled()) if (call != null && call.getCurrentParamsCopy().getVideoEnabled())
LinphoneActivity.instance().startVideoActivity(call, 0); LinphoneActivity.instance().startVideoActivity(call, 0);
else else
LinphoneActivity.instance().startIncallActivity(); LinphoneActivity.instance().startIncallActivity();
@ -359,6 +360,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
mVisible = false;
if (mCamera != null) { if (mCamera != null) {
mCamera.release(); mCamera.release();
@ -502,6 +504,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
// and set to the to be destroyed Dialer. // and set to the to be destroyed Dialer.
// Note1: We wait as long as possible before setting the last message. // Note1: We wait as long as possible before setting the last message.
// Note2: Linphone service is in charge of instantiating LinphoneManager // Note2: Linphone service is in charge of instantiating LinphoneManager
mVisible = true;
mStatus.setText(LinphoneManager.getInstance().getLastLcStatusMessage()); mStatus.setText(LinphoneManager.getInstance().getLastLcStatusMessage());
super.onResume(); super.onResume();
@ -513,13 +516,14 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
if (AndroidCameraConfiguration.hasSeveralCameras() && mSwitchCamera != null) if (AndroidCameraConfiguration.hasSeveralCameras() && mSwitchCamera != null)
mSwitchCamera.setVisibility(View.VISIBLE); mSwitchCamera.setVisibility(View.VISIBLE);
if (mVideoCaptureView != null && mCamera == null && !LinphoneManager.getLc().isIncall()) boolean isInCall = LinphoneManager.getLc().isIncall();
{ isInCall = isInCall || LinphoneManager.getLc().getCallsNb() > 0;
if (mVideoCaptureView != null && mCamera == null && !LinphoneManager.getLc().isIncall()) {
mCamera = Camera.open(mCurrentCameraId); mCamera = Camera.open(mCurrentCameraId);
mVideoCaptureView.switchCamera(mCamera, mCurrentCameraId); mVideoCaptureView.switchCamera(mCamera, mCurrentCameraId);
mCamera.startPreview(); mCamera.startPreview();
} else if (LinphoneManager.getLc().isIncall()) } else if (isInCall) {
{
if (mInCallControls != null) { if (mInCallControls != null) {
mInCallControls.setVisibility(View.VISIBLE); mInCallControls.setVisibility(View.VISIBLE);
mCall.setVisibility(View.GONE); mCall.setVisibility(View.GONE);
@ -534,6 +538,13 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
@Override @Override
public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
if (LinphoneUtils.onKeyVolumeSoftAdjust(keyCode)) return true; if (LinphoneUtils.onKeyVolumeSoftAdjust(keyCode)) return true;
boolean isInCall = LinphoneManager.getLc().isIncall();
isInCall = isInCall || LinphoneManager.getLc().getCallsNb() > 0;
if (keyCode == KeyEvent.KEYCODE_BACK && isInCall) {
// If we are in call on dialer, we go back to the incall view
LinphoneActivity.instance().startIncallActivity();
return true;
}
return super.onKeyDown(keyCode, event); return super.onKeyDown(keyCode, event);
} }
} }

View file

@ -314,7 +314,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
LinphoneAddress lAddress; LinphoneAddress lAddress;
try { try {
lAddress = mLc.interpretUrl(to); lAddress = mLc.interpretUrl(to);
if (mLc.isMyself(lAddress.asStringUriOnly())) { if (mR.getBoolean(R.bool.forbid_self_call) && mLc.isMyself(lAddress.asStringUriOnly())) {
mListenerDispatcher.tryingNewOutgoingCallButWrongDestinationAddress(); mListenerDispatcher.tryingNewOutgoingCallButWrongDestinationAddress();
return; return;
} }
@ -676,6 +676,9 @@ public final class LinphoneManager implements LinphoneCoreListener {
// Extra accounts // Extra accounts
for (int i = 1; i < getPrefExtraAccountsNumber(); i++) { for (int i = 1; i < getPrefExtraAccountsNumber(); i++) {
if (getPrefBoolean(getString(R.string.pref_disable_account_key) + i, false)) {
continue;
}
lUserName = getPrefString(getString(R.string.pref_username_key) + i, null); lUserName = getPrefString(getString(R.string.pref_username_key) + i, null);
lPasswd = getPrefString(getString(R.string.pref_passwd_key) + i, null); lPasswd = getPrefString(getString(R.string.pref_passwd_key) + i, null);
if (lUserName != null && lUserName.length() > 0) { if (lUserName != null && lUserName.length() > 0) {

View file

@ -78,6 +78,11 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
outboundProxy.setPersistent(true); outboundProxy.setPersistent(true);
outboundProxy.setKey(getString(R.string.pref_enable_outbound_proxy_key) + getAccountNumber(n)); outboundProxy.setKey(getString(R.string.pref_enable_outbound_proxy_key) + getAccountNumber(n));
CheckBoxPreference disable = new CheckBoxPreference(this);
disable.setTitle(getString(R.string.pref_disable_account));
disable.setPersistent(true);
disable.setKey(getString(R.string.pref_disable_account_key) + getAccountNumber(n));
final Preference delete = new Preference(this); final Preference delete = new Preference(this);
delete.setTitle("Delete this account"); delete.setTitle("Delete this account");
delete.setOnPreferenceClickListener(new OnPreferenceClickListener() { delete.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@ -91,6 +96,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
editor.putString(getString(R.string.pref_domain_key) + i, prefs.getString(getString(R.string.pref_domain_key) + (i+1), null)); editor.putString(getString(R.string.pref_domain_key) + i, prefs.getString(getString(R.string.pref_domain_key) + (i+1), null));
editor.putString(getString(R.string.pref_proxy_key) + i, prefs.getString(getString(R.string.pref_proxy_key) + (i+1), null)); editor.putString(getString(R.string.pref_proxy_key) + i, prefs.getString(getString(R.string.pref_proxy_key) + (i+1), null));
editor.putBoolean(getString(R.string.pref_enable_outbound_proxy_key) + i, prefs.getBoolean(getString(R.string.pref_enable_outbound_proxy_key) + (i+1), false)); editor.putBoolean(getString(R.string.pref_enable_outbound_proxy_key) + i, prefs.getBoolean(getString(R.string.pref_enable_outbound_proxy_key) + (i+1), false));
editor.putBoolean(getString(R.string.pref_disable_account_key) + i, prefs.getBoolean(getString(R.string.pref_disable_account_key) + (i+1), false));
} }
int lastAccount = nbAccounts - 1; int lastAccount = nbAccounts - 1;
@ -99,6 +105,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
editor.putString(getString(R.string.pref_domain_key) + lastAccount, null); editor.putString(getString(R.string.pref_domain_key) + lastAccount, null);
editor.putString(getString(R.string.pref_proxy_key) + lastAccount, null); editor.putString(getString(R.string.pref_proxy_key) + lastAccount, null);
editor.putBoolean(getString(R.string.pref_enable_outbound_proxy_key) + lastAccount, false); editor.putBoolean(getString(R.string.pref_enable_outbound_proxy_key) + lastAccount, false);
editor.putBoolean(getString(R.string.pref_disable_account_key) + lastAccount, false);
int defaultAccount = prefs.getInt(getString(R.string.pref_default_account), 0); int defaultAccount = prefs.getInt(getString(R.string.pref_default_account), 0);
if (defaultAccount > n) { if (defaultAccount > n) {
@ -138,6 +145,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
category.addPreference(domain); category.addPreference(domain);
category.addPreference(proxy); category.addPreference(proxy);
category.addPreference(outboundProxy); category.addPreference(outboundProxy);
category.addPreference(disable);
category.addPreference(mainAccount); category.addPreference(mainAccount);
category.addPreference(delete); category.addPreference(delete);
} }

View file

@ -480,7 +480,8 @@ public class VideoCallActivity extends Activity implements
params.setMargins(0, 0, 15, 15); params.setMargins(0, 0, 15, 15);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
mVideoCaptureViewReady.setLayoutParams(params); if (mVideoViewReady != null)
mVideoCaptureViewReady.setLayoutParams(params);
} }
public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) {

View file

@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
package org.linphone.ui; package org.linphone.ui;
import org.linphone.DialerActivity;
import org.linphone.LinphoneManager; import org.linphone.LinphoneManager;
import org.linphone.LinphoneService; import org.linphone.LinphoneService;
import org.linphone.R; import org.linphone.R;
@ -103,9 +104,8 @@ public class Digit extends Button implements AddressAware {
LinphoneCore lc = LinphoneManager.getLc(); LinphoneCore lc = LinphoneManager.getLc();
lc.stopDtmf(); lc.stopDtmf();
mIsDtmfStarted =false; mIsDtmfStarted =false;
if (lc.isIncall()) { if (lc.isIncall() && !DialerActivity.instance().mVisible) {
lc.sendDtmf(mKeyCode.charAt(0)); lc.sendDtmf(mKeyCode.charAt(0));
// return;
} }
} }

View file

@ -57,6 +57,8 @@ LOCAL_CFLAGS += \
-include $(LOCAL_PATH)/../build/exosip/libeXosip2_AndroidConfig.h \ -include $(LOCAL_PATH)/../build/exosip/libeXosip2_AndroidConfig.h \
-DOSIP_MT \ -DOSIP_MT \
-DENABLE_TRACE \ -DENABLE_TRACE \
-DSOCKET_TIMEOUT=50 \
-DSOCKET_PROGRESS_TIMEOUT=300 \
-include $(LOCAL_PATH)/include/eXosip2/eXosip_transport_hook.h -include $(LOCAL_PATH)/include/eXosip2/eXosip_transport_hook.h

@ -1 +1 @@
Subproject commit b3e55a3c93b39af43666acec45191b41f2016fa0 Subproject commit 41a93903b96ec4466f5efa9e9f887a1cce92648a