[Switch submodule branch] Uncommented tunnel related code
This commit is contained in:
parent
0dc98268c5
commit
7137609898
5 changed files with 28 additions and 25 deletions
|
@ -64,7 +64,6 @@ import android.os.Handler;
|
|||
import android.os.PowerManager;
|
||||
import android.os.PowerManager.WakeLock;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.SettingNotFoundException;
|
||||
import android.telephony.TelephonyManager;
|
||||
|
@ -100,7 +99,6 @@ import org.linphone.core.Core.LogCollectionUploadState;
|
|||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.ConfiguringState;
|
||||
import org.linphone.core.CoreException;
|
||||
import org.linphone.core.ErrorInfo;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.CoreListener;
|
||||
import org.linphone.core.Event;
|
||||
|
@ -110,13 +108,13 @@ import org.linphone.core.InfoMessage;
|
|||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.PublishState;
|
||||
import org.linphone.core.Tunnel;
|
||||
import org.linphone.core.tools.OpenH264DownloadHelperListener;
|
||||
import org.linphone.core.PayloadType;
|
||||
import org.linphone.core.PresenceBasicStatus;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.Reason;
|
||||
import org.linphone.core.SubscriptionState;
|
||||
//import org.linphone.core.TunnelConfig;
|
||||
import org.linphone.core.TunnelConfig;
|
||||
import org.linphone.core.VersionUpdateCheckResult;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.mediastream.Version;
|
||||
|
@ -530,17 +528,18 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
|||
if (!mLc.tunnelAvailable())
|
||||
return;
|
||||
|
||||
/*NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
|
||||
mLc.tunnelCleanServers();
|
||||
NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
|
||||
Tunnel tunnel = mLc.getTunnel();
|
||||
tunnel.cleanServers();
|
||||
TunnelConfig config = mPrefs.getTunnelConfig();
|
||||
if (config.getHost() != null) {
|
||||
mLc.tunnelAddServer(config);
|
||||
tunnel.addServer(config);
|
||||
manageTunnelServer(info);
|
||||
}*/ // TODO FIXME
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isTunnelNeeded(NetworkInfo info) {
|
||||
/*if (info == null) {
|
||||
if (info == null) {
|
||||
Log.i("No connectivity: tunnel should be disabled");
|
||||
return false;
|
||||
}
|
||||
|
@ -555,7 +554,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
|||
&& getString(R.string.tunnel_mode_entry_value_3G_only).equals(pref)) {
|
||||
Log.i("need tunnel: 'no wifi' connection");
|
||||
return true;
|
||||
}*/ // TODO FIXME
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -563,19 +562,20 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
|||
private void manageTunnelServer(NetworkInfo info) {
|
||||
if (mLc == null) return;
|
||||
if (!mLc.tunnelAvailable()) return;
|
||||
Tunnel tunnel = mLc.getTunnel();
|
||||
|
||||
/*Log.i("Managing tunnel");
|
||||
Log.i("Managing tunnel");
|
||||
if (isTunnelNeeded(info)) {
|
||||
Log.i("Tunnel need to be activated");
|
||||
mLc.tunnelSetMode(Core.TunnelMode.enable);
|
||||
tunnel.setMode(Tunnel.Mode.Enable);
|
||||
} else {
|
||||
Log.i("Tunnel should not be used");
|
||||
String pref = mPrefs.getTunnelMode();
|
||||
mLc.tunnelSetMode(Core.TunnelMode.disable);
|
||||
tunnel.setMode(Tunnel.Mode.Disable);
|
||||
if (getString(R.string.tunnel_mode_entry_value_auto).equals(pref)) {
|
||||
mLc.tunnelSetMode(Core.TunnelMode.auto);
|
||||
tunnel.setMode(Tunnel.Mode.Auto);
|
||||
}
|
||||
}
|
||||
}*/ // TODO FIXME
|
||||
}
|
||||
|
||||
public synchronized final void destroyCore() {
|
||||
|
|
|
@ -38,6 +38,8 @@ import org.linphone.core.NatPolicy;
|
|||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.Config;
|
||||
//import org.linphone.core.TunnelConfig;
|
||||
import org.linphone.core.Tunnel;
|
||||
import org.linphone.core.TunnelConfig;
|
||||
import org.linphone.core.VideoActivationPolicy;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.purchase.Purchasable;
|
||||
|
@ -1290,12 +1292,13 @@ public class LinphonePreferences {
|
|||
// End of advanced settings
|
||||
|
||||
// Tunnel settings
|
||||
/*private TunnelConfig tunnelConfig = null;
|
||||
private TunnelConfig tunnelConfig = null;
|
||||
|
||||
public TunnelConfig getTunnelConfig() {
|
||||
if(getLc().tunnelAvailable()) {
|
||||
if(tunnelConfig == null) {
|
||||
TunnelConfig servers[] = getLc().tunnelGetServers();
|
||||
Tunnel tunnel = getLc().getTunnel();
|
||||
if (tunnelConfig == null) {
|
||||
TunnelConfig servers[] = tunnel.getServers();
|
||||
if(servers.length > 0) {
|
||||
tunnelConfig = servers[0];
|
||||
} else {
|
||||
|
@ -1349,7 +1352,7 @@ public class LinphonePreferences {
|
|||
public void setTunnelMode(String mode) {
|
||||
getConfig().setString("app", "tunnel", mode);
|
||||
LinphoneManager.getInstance().initTunnelFromConf();
|
||||
}*/
|
||||
}
|
||||
// End of tunnel settings
|
||||
|
||||
public boolean isProvisioningLoginViewEnabled() {
|
||||
|
|
|
@ -290,16 +290,16 @@ public class SettingsFragment extends PreferencesListFragment {
|
|||
return;
|
||||
}
|
||||
|
||||
/*setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_host_key, mPrefs.getTunnelHost());
|
||||
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_host_key, mPrefs.getTunnelHost());
|
||||
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_port_key, String.valueOf(mPrefs.getTunnelPort()));
|
||||
ListPreference tunnelModePref = (ListPreference) findPreference(getString(R.string.pref_tunnel_mode_key));
|
||||
String tunnelMode = mPrefs.getTunnelMode();
|
||||
tunnelModePref.setSummary(tunnelMode);
|
||||
tunnelModePref.setValue(tunnelMode);*/
|
||||
tunnelModePref.setValue(tunnelMode);
|
||||
}
|
||||
|
||||
private void setTunnelPreferencesListener() {
|
||||
/*findPreference(getString(R.string.pref_tunnel_host_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||
findPreference(getString(R.string.pref_tunnel_host_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String host = newValue.toString();
|
||||
|
@ -329,7 +329,7 @@ public class SettingsFragment extends PreferencesListFragment {
|
|||
preference.setSummary(mode);
|
||||
return true;
|
||||
}
|
||||
});*/
|
||||
});
|
||||
}
|
||||
|
||||
private void initAccounts() {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c65f14509eeec3192cd1170646b700e9428ac292
|
||||
Subproject commit 8e841b047641b1812a83880a90e89d702747ca5b
|
|
@ -1 +1 @@
|
|||
Subproject commit 716ceeb474a415d685ca0f8377c3bf20819f9866
|
||||
Subproject commit 36aa0bfd0e18a2ff7316ea0013ea7313b5f09b6c
|
Loading…
Reference in a new issue