Loading res/layout/proxy.xml +5 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,11 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollHorizontally="true" /> <CheckBox android:id="@+id/wifi_only" android:layout_marginTop="2dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/proxy_wifi_only" /> <LinearLayout android:orientation="horizontal" android:paddingTop="8dip" Loading res/values/strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2065,5 +2065,6 @@ found in the list of installed applications.</string> <!-- Proxy settings --> <string name="proxy_setting">Proxy settings</string> <string name="proxy_setting_summary">Configure a proxy to access the internet</string> <string name="proxy_wifi_only">Use proxy only on wifi</string> </resources> src/com/android/settings/ProxySelector.java +10 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView; Loading Loading @@ -65,6 +66,7 @@ public class ProxySelector extends Activity EditText mHostnameField; EditText mPortField; Button mOKButton; CheckBox mProxyWifiOnly; // Matches blank input, ips, and domain names private static final String HOSTNAME_REGEXP = "^$|^[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*(\\.[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*)*$"; Loading Loading @@ -102,6 +104,8 @@ public class ProxySelector extends Activity mPortField.setOnClickListener(mOKHandler); mPortField.setOnFocusChangeListener(mOnFocusChangeHandler); mProxyWifiOnly = (CheckBox)findViewById(R.id.wifi_only); mOKButton = (Button)findViewById(R.id.action); mOKButton.setOnClickListener(mOKHandler); Loading Loading @@ -134,6 +138,8 @@ public class ProxySelector extends Activity String portStr = port == -1 ? "" : Integer.toString(port); mPortField.setText(portStr); mProxyWifiOnly.setChecked(Proxy.isProxyForWifiOnly(this)); Intent intent = getIntent(); String buttonLabel = intent.getStringExtra("button-label"); Loading Loading @@ -223,6 +229,8 @@ public class ProxySelector extends Activity hostname += ':' + portStr; } Settings.Secure.putString(res, Settings.Secure.HTTP_PROXY, hostname); Settings.Secure.putInt(res, Settings.Secure.HTTP_PROXY_WIFI_ONLY, mProxyWifiOnly.isChecked() ? 1 : 0); sendBroadcast(new Intent(Proxy.PROXY_CHANGE_ACTION)); return true; Loading @@ -240,6 +248,7 @@ public class ProxySelector extends Activity public void onClick(View v) { mHostnameField.setText(""); mPortField.setText(""); mProxyWifiOnly.setChecked(true); } }; Loading Loading
res/layout/proxy.xml +5 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,11 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollHorizontally="true" /> <CheckBox android:id="@+id/wifi_only" android:layout_marginTop="2dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/proxy_wifi_only" /> <LinearLayout android:orientation="horizontal" android:paddingTop="8dip" Loading
res/values/strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2065,5 +2065,6 @@ found in the list of installed applications.</string> <!-- Proxy settings --> <string name="proxy_setting">Proxy settings</string> <string name="proxy_setting_summary">Configure a proxy to access the internet</string> <string name="proxy_wifi_only">Use proxy only on wifi</string> </resources>
src/com/android/settings/ProxySelector.java +10 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView; Loading Loading @@ -65,6 +66,7 @@ public class ProxySelector extends Activity EditText mHostnameField; EditText mPortField; Button mOKButton; CheckBox mProxyWifiOnly; // Matches blank input, ips, and domain names private static final String HOSTNAME_REGEXP = "^$|^[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*(\\.[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*)*$"; Loading Loading @@ -102,6 +104,8 @@ public class ProxySelector extends Activity mPortField.setOnClickListener(mOKHandler); mPortField.setOnFocusChangeListener(mOnFocusChangeHandler); mProxyWifiOnly = (CheckBox)findViewById(R.id.wifi_only); mOKButton = (Button)findViewById(R.id.action); mOKButton.setOnClickListener(mOKHandler); Loading Loading @@ -134,6 +138,8 @@ public class ProxySelector extends Activity String portStr = port == -1 ? "" : Integer.toString(port); mPortField.setText(portStr); mProxyWifiOnly.setChecked(Proxy.isProxyForWifiOnly(this)); Intent intent = getIntent(); String buttonLabel = intent.getStringExtra("button-label"); Loading Loading @@ -223,6 +229,8 @@ public class ProxySelector extends Activity hostname += ':' + portStr; } Settings.Secure.putString(res, Settings.Secure.HTTP_PROXY, hostname); Settings.Secure.putInt(res, Settings.Secure.HTTP_PROXY_WIFI_ONLY, mProxyWifiOnly.isChecked() ? 1 : 0); sendBroadcast(new Intent(Proxy.PROXY_CHANGE_ACTION)); return true; Loading @@ -240,6 +248,7 @@ public class ProxySelector extends Activity public void onClick(View v) { mHostnameField.setText(""); mPortField.setText(""); mProxyWifiOnly.setChecked(true); } }; Loading