Enabling users toset the Global Proxy from wireless settings.

Change-Id: Ie9b37e4c8e042fab738d2181878e93d7d2645834
This commit is contained in:
Oscar Montemayor
2010-08-03 16:56:09 -07:00
parent 3d9d445aba
commit 05411893af
6 changed files with 102 additions and 17 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings;
import android.app.admin.DevicePolicyManager;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
@@ -45,6 +46,7 @@ public class WirelessSettings extends PreferenceActivity {
private static final String KEY_BT_SETTINGS = "bt_settings";
private static final String KEY_VPN_SETTINGS = "vpn_settings";
private static final String KEY_TETHER_SETTINGS = "tether_settings";
private static final String KEY_PROXY_SETTINGS = "proxy_settings";
public static final String EXIT_ECM_RESULT = "exit_ecm_result";
public static final int REQUEST_CODE_EXIT_ECM = 1;
@@ -118,6 +120,11 @@ public class WirelessSettings extends PreferenceActivity {
findPreference(KEY_BT_SETTINGS).setEnabled(false);
}
// Enable Proxy selector settings if allowed.
Preference mGlobalProxy = findPreference(KEY_PROXY_SETTINGS);
DevicePolicyManager mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
mGlobalProxy.setEnabled(mDPM.getGlobalProxyAdmin() == null);
// Disable Tethering if it's not allowed
ConnectivityManager cm =
(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);