resolved conflicts for merge of 1ff9ad3f to master

Change-Id: I55137a241e13ec7da1d413cf9b7fd1c1fdd8c4d1
This commit is contained in:
Nick Pelly
2010-09-29 12:10:35 -07:00
5 changed files with 134 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.TelephonyProperties;
import com.android.settings.bluetooth.BluetoothEnabler;
import com.android.settings.wifi.WifiEnabler;
import com.android.settings.nfc.NfcEnabler;
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
@@ -40,17 +41,20 @@ public class WirelessSettings extends SettingsPreferenceFragment {
private static final String KEY_TOGGLE_AIRPLANE = "toggle_airplane";
private static final String KEY_TOGGLE_BLUETOOTH = "toggle_bluetooth";
private static final String KEY_TOGGLE_WIFI = "toggle_wifi";
private static final String KEY_TOGGLE_NFC = "toggle_nfc";
private static final String KEY_WIFI_SETTINGS = "wifi_settings";
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;
private AirplaneModeEnabler mAirplaneModeEnabler;
private CheckBoxPreference mAirplaneModePreference;
private WifiEnabler mWifiEnabler;
private NfcEnabler mNfcEnabler;
private BluetoothEnabler mBtEnabler;
/**
@@ -92,11 +96,13 @@ public class WirelessSettings extends SettingsPreferenceFragment {
CheckBoxPreference airplane = (CheckBoxPreference) findPreference(KEY_TOGGLE_AIRPLANE);
CheckBoxPreference wifi = (CheckBoxPreference) findPreference(KEY_TOGGLE_WIFI);
CheckBoxPreference bt = (CheckBoxPreference) findPreference(KEY_TOGGLE_BLUETOOTH);
CheckBoxPreference nfc = (CheckBoxPreference) findPreference(KEY_TOGGLE_NFC);
mAirplaneModeEnabler = new AirplaneModeEnabler(activity, airplane);
mAirplaneModePreference = (CheckBoxPreference) findPreference(KEY_TOGGLE_AIRPLANE);
mWifiEnabler = new WifiEnabler(activity, wifi);
mBtEnabler = new BluetoothEnabler(activity, bt);
mNfcEnabler = new NfcEnabler(activity, nfc);
String toggleable = Settings.System.getString(activity.getContentResolver(),
Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
@@ -114,9 +120,14 @@ public class WirelessSettings extends SettingsPreferenceFragment {
findPreference(KEY_BT_SETTINGS).setDependency(KEY_TOGGLE_AIRPLANE);
}
// Disable Bluetooth Settings if Bluetooth service is not available.
// Remove Bluetooth Settings if Bluetooth service is not available.
if (ServiceManager.getService(BluetoothAdapter.BLUETOOTH_SERVICE) == null) {
findPreference(KEY_BT_SETTINGS).setEnabled(false);
getPreferenceScreen().removePreference(bt);
}
// Remove NFC if its not available
if (ServiceManager.getService(Context.NFC_SERVICE) == null) {
getPreferenceScreen().removePreference(nfc);
}
// Enable Proxy selector settings if allowed.
@@ -172,6 +183,7 @@ public class WirelessSettings extends SettingsPreferenceFragment {
mAirplaneModeEnabler.resume();
mWifiEnabler.resume();
mBtEnabler.resume();
mNfcEnabler.resume();
}
@Override
@@ -181,6 +193,7 @@ public class WirelessSettings extends SettingsPreferenceFragment {
mAirplaneModeEnabler.pause();
mWifiEnabler.pause();
mBtEnabler.pause();
mNfcEnabler.pause();
}
@Override