diff options
author | Ken Shirriff <kens@google.com> | 2010-02-24 12:31:36 -0800 |
---|---|---|
committer | Ken Shirriff <kens@google.com> | 2010-02-24 12:32:38 -0800 |
commit | 8ab15b32f46b0bc2f6e8315a08d6ee2b64621265 (patch) | |
tree | 9ff06327205423669ed646fb812112b7d6ea6d3a /src/com/android | |
parent | effc754719b4aa8b63af9a2ef43c11085df1abd8 (diff) | |
download | packages_apps_settings-8ab15b32f46b0bc2f6e8315a08d6ee2b64621265.zip packages_apps_settings-8ab15b32f46b0bc2f6e8315a08d6ee2b64621265.tar.gz packages_apps_settings-8ab15b32f46b0bc2f6e8315a08d6ee2b64621265.tar.bz2 |
Power Widget: don't display toast in intermediate state
If bluetooth or wifi is in an intermediate state, the widget can't modify
the state, so it shouldn't pop up a toast.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/widget/SettingsAppWidgetProvider.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java index 3db90cf..0f6bb25 100644 --- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java +++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java @@ -267,10 +267,12 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { int wifiState = getWifiState(context); if (wifiState == STATE_ENABLED) { wifiManager.setWifiEnabled(false); + Toast.makeText(context, R.string.gadget_toggle_wifi, Toast.LENGTH_SHORT).show(); } else if (wifiState == STATE_DISABLED) { wifiManager.setWifiEnabled(true); + Toast.makeText(context, R.string.gadget_toggle_wifi, Toast.LENGTH_SHORT).show(); } - Toast.makeText(context, R.string.gadget_toggle_wifi, Toast.LENGTH_SHORT).show(); + // If wifi is in intermediate state, don't do anything. } /** @@ -450,9 +452,11 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { int state = getBluetoothState(context); if (state == STATE_ENABLED) { mLocalBluetoothManager.setBluetoothEnabled(false); + Toast.makeText(context, R.string.gadget_toggle_bluetooth, Toast.LENGTH_SHORT).show(); } else if (state == STATE_DISABLED) { mLocalBluetoothManager.setBluetoothEnabled(true); + Toast.makeText(context, R.string.gadget_toggle_bluetooth, Toast.LENGTH_SHORT).show(); } - Toast.makeText(context, R.string.gadget_toggle_bluetooth, Toast.LENGTH_SHORT).show(); + // If bluetooth is in intermediate state, don't do anything. } } |