am ee370ae1: am 4e2eb658: Merge "Update airplane-mode manipulation for the new Settings namespace" into jb-mr1-dev

* commit 'ee370ae1f6ddaba7e7aa8a61a5566d1b4e894ced':
  Update airplane-mode manipulation for the new Settings namespace
This commit is contained in:
Christopher Tate
2012-09-10 17:25:19 -07:00
committed by Android Git Automerger
10 changed files with 44 additions and 41 deletions

View File

@@ -75,12 +75,12 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
private void registerForAirplaneMode(IntentFilter filter) {
final ContentResolver resolver = mContext.getContentResolver();
final String airplaneModeRadios = Settings.System.getString(resolver,
Settings.System.AIRPLANE_MODE_RADIOS);
final String toggleableRadios = Settings.System.getString(resolver,
Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
final String airplaneModeRadios = Settings.Global.getString(resolver,
Settings.Global.AIRPLANE_MODE_RADIOS);
final String toggleableRadios = Settings.Global.getString(resolver,
Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
boolean mIsAirplaneSensitive = airplaneModeRadios == null ? true :
airplaneModeRadios.contains(Settings.System.RADIO_BLUETOOTH);
airplaneModeRadios.contains(Settings.Global.RADIO_BLUETOOTH);
if (mIsAirplaneSensitive) {
filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
}
@@ -151,8 +151,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
* Returns true if airplane mode is currently on
*/
private final boolean isAirplaneModeOn() {
return Settings.System.getInt(mContext.getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) == 1;
return Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 0) == 1;
}
/**

View File

@@ -1179,17 +1179,17 @@ public class WifiService extends IWifiManager.Stub {
}
private boolean isAirplaneSensitive() {
String airplaneModeRadios = Settings.System.getString(mContext.getContentResolver(),
Settings.System.AIRPLANE_MODE_RADIOS);
String airplaneModeRadios = Settings.Global.getString(mContext.getContentResolver(),
Settings.Global.AIRPLANE_MODE_RADIOS);
return airplaneModeRadios == null
|| airplaneModeRadios.contains(Settings.System.RADIO_WIFI);
|| airplaneModeRadios.contains(Settings.Global.RADIO_WIFI);
}
private boolean isAirplaneToggleable() {
String toggleableRadios = Settings.System.getString(mContext.getContentResolver(),
Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
String toggleableRadios = Settings.Global.getString(mContext.getContentResolver(),
Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
return toggleableRadios != null
&& toggleableRadios.contains(Settings.System.RADIO_WIFI);
&& toggleableRadios.contains(Settings.Global.RADIO_WIFI);
}
/**
@@ -1198,8 +1198,8 @@ public class WifiService extends IWifiManager.Stub {
* @return {@code true} if airplane mode is on.
*/
private boolean isAirplaneModeOn() {
return isAirplaneSensitive() && Settings.System.getInt(mContext.getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) == 1;
return isAirplaneSensitive() && Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 0) == 1;
}
@Override
@@ -1213,8 +1213,8 @@ public class WifiService extends IWifiManager.Stub {
}
pw.println("Wi-Fi is " + mWifiStateMachine.syncGetWifiStateByName());
pw.println("Stay-awake conditions: " +
Settings.System.getInt(mContext.getContentResolver(),
Settings.System.STAY_ON_WHILE_PLUGGED_IN, 0));
Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0));
pw.println();
pw.println("Internal state:");

View File

@@ -384,8 +384,8 @@ public class ComprehensiveCountryDetector extends CountryDetectorBase {
}
protected boolean isAirplaneModeOff() {
return Settings.System.getInt(
mContext.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0) == 0;
return Settings.Global.getInt(
mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0) == 0;
}
/**