Merge "Removed summary text and categories in Wireless settings"

This commit is contained in:
Gilles Debunne
2011-07-18 17:46:54 -07:00
committed by Android (Google) Code Review
5 changed files with 9 additions and 89 deletions

View File

@@ -16,8 +16,6 @@
package com.android.settings;
import com.android.internal.telephony.PhoneStateIntentReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
@@ -27,8 +25,8 @@ import android.os.SystemProperties;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.provider.Settings;
import android.telephony.ServiceState;
import com.android.internal.telephony.PhoneStateIntentReceiver;
import com.android.internal.telephony.TelephonyProperties;
public class AirplaneModeEnabler implements Preference.OnPreferenceChangeListener {
@@ -93,10 +91,6 @@ public class AirplaneModeEnabler implements Preference.OnPreferenceChangeListene
}
private void setAirplaneModeOn(boolean enabling) {
mCheckBoxPref.setSummary(enabling ? R.string.airplane_mode_turning_on
: R.string.airplane_mode_turning_off);
// Change the system setting
Settings.System.putInt(mContext.getContentResolver(), Settings.System.AIRPLANE_MODE_ON,
enabling ? 1 : 0);
@@ -118,10 +112,7 @@ public class AirplaneModeEnabler implements Preference.OnPreferenceChangeListene
* - mobile does not send failure notification, fail on timeout.
*/
private void onAirplaneModeChanged() {
boolean airplaneModeEnabled = isAirplaneModeOn(mContext);
mCheckBoxPref.setChecked(isAirplaneModeOn(mContext));
mCheckBoxPref.setSummary(airplaneModeEnabled ? null :
mContext.getString(R.string.airplane_mode_summary));
}
/**

View File

@@ -139,25 +139,18 @@ public class WirelessSettings extends SettingsPreferenceFragment {
Preference p = findPreference(KEY_TETHER_SETTINGS);
if (wifiAvailable && usbAvailable && bluetoothAvailable) {
p.setTitle(R.string.tether_settings_title_all);
p.setSummary(R.string.tether_settings_summary_all);
} else if (wifiAvailable && usbAvailable) {
p.setTitle(R.string.tether_settings_title_all);
p.setSummary(R.string.tether_settings_summary_usb_wifi);
} else if (wifiAvailable && bluetoothAvailable) {
p.setTitle(R.string.tether_settings_title_all);
p.setSummary(R.string.tether_settings_summary_wifi_bluetooth);
} else if (wifiAvailable) {
p.setTitle(R.string.tether_settings_title_wifi);
p.setSummary(R.string.tether_settings_summary_wifi);
} else if (usbAvailable && bluetoothAvailable) {
p.setTitle(R.string.tether_settings_title_usb_bluetooth);
p.setSummary(R.string.tether_settings_summary_usb_bluetooth);
} else if (usbAvailable) {
p.setTitle(R.string.tether_settings_title_usb);
p.setSummary(R.string.tether_settings_summary_usb);
} else {
p.setTitle(R.string.tether_settings_title_bluetooth);
p.setSummary(R.string.tether_settings_summary_bluetooth);
}
}
}

View File

@@ -16,8 +16,6 @@
package com.android.settings.nfc;
import com.android.settings.R;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -26,7 +24,6 @@ import android.nfc.NfcAdapter;
import android.os.Handler;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.provider.Settings;
import android.util.Log;
/**
@@ -98,6 +95,7 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
// Start async update of the NFC adapter state, as the API is
// unfortunately blocking...
new Thread("toggleNFC") {
@Override
public void run() {
Log.d(TAG, "Setting NFC enabled state to: " + desiredState);
boolean success = false;
@@ -118,7 +116,6 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
mHandler.post(new Runnable() {
public void run() {
mCheckbox.setEnabled(true);
mCheckbox.setSummary(R.string.nfc_toggle_error);
}
});
}
@@ -130,6 +127,5 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
private void handleNfcStateChanged(boolean newState) {
mCheckbox.setChecked(newState);
mCheckbox.setEnabled(true);
mCheckbox.setSummary(R.string.nfc_quick_toggle_summary);
}
}