diff options
author | Robert Greenwalt <robdroid@android.com> | 2010-03-10 17:24:57 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-10 17:24:57 -0800 |
commit | 7785e508b79e12658ca4ecb91fb2f080d7002606 (patch) | |
tree | bbb9d5e98669a6bb332841f3f2b01eb8719c80eb /src/com/android/settings | |
parent | 2348a9db51409dc1efa2ffa95f694e6b1d8d8d23 (diff) | |
parent | a2488762a7c80eb4a22a4dd018c916784526bba4 (diff) | |
download | packages_apps_Settings-7785e508b79e12658ca4ecb91fb2f080d7002606.tar.gz packages_apps_Settings-7785e508b79e12658ca4ecb91fb2f080d7002606.tar.bz2 packages_apps_Settings-7785e508b79e12658ca4ecb91fb2f080d7002606.zip |
Merge "Update Tether Settings for new UMS behavior."
Diffstat (limited to 'src/com/android/settings')
-rw-r--r-- | src/com/android/settings/TetherSettings.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java index 9b8337914..9d952ec01 100644 --- a/src/com/android/settings/TetherSettings.java +++ b/src/com/android/settings/TetherSettings.java @@ -85,15 +85,19 @@ public class TetherSettings extends PreferenceActivity { private class TetherChangeReceiver extends BroadcastReceiver { public void onReceive(Context content, Intent intent) { - // TODO - this should understand the interface types - ArrayList<String> available = intent.getStringArrayListExtra( - ConnectivityManager.EXTRA_AVAILABLE_TETHER); - ArrayList<String> active = intent.getStringArrayListExtra( - ConnectivityManager.EXTRA_ACTIVE_TETHER); - ArrayList<String> errored = intent.getStringArrayListExtra( - ConnectivityManager.EXTRA_ERRORED_TETHER); - - updateState(available.toArray(), active.toArray(), errored.toArray()); + if (intent.getAction().equals(ConnectivityManager.ACTION_TETHER_STATE_CHANGED)) { + // TODO - this should understand the interface types + ArrayList<String> available = intent.getStringArrayListExtra( + ConnectivityManager.EXTRA_AVAILABLE_TETHER); + ArrayList<String> active = intent.getStringArrayListExtra( + ConnectivityManager.EXTRA_ACTIVE_TETHER); + ArrayList<String> errored = intent.getStringArrayListExtra( + ConnectivityManager.EXTRA_ERRORED_TETHER); + updateState(available.toArray(), active.toArray(), errored.toArray()); + } else if (intent.getAction().equals(Intent.ACTION_MEDIA_SHARED) || + intent.getAction().equals(Intent.ACTION_MEDIA_UNSHARED)) { + updateState(); + } } } @@ -185,10 +189,6 @@ public class TetherSettings extends PreferenceActivity { mUsbTether.setSummary(R.string.usb_tethering_active_subtext); mUsbTether.setEnabled(true); mUsbTether.setChecked(true); - } else if (massStorageActive) { - mUsbTether.setSummary(R.string.usb_tethering_storage_active_subtext); - mUsbTether.setEnabled(false); - mUsbTether.setChecked(false); } else if (usbAvailable) { if (usbError == ConnectivityManager.TETHER_ERROR_NO_ERROR) { mUsbTether.setSummary(R.string.usb_tethering_available_subtext); @@ -201,6 +201,10 @@ public class TetherSettings extends PreferenceActivity { mUsbTether.setSummary(R.string.usb_tethering_errored_subtext); mUsbTether.setEnabled(false); mUsbTether.setChecked(false); + } else if (massStorageActive) { + mUsbTether.setSummary(R.string.usb_tethering_storage_active_subtext); + mUsbTether.setEnabled(false); + mUsbTether.setChecked(false); } else { mUsbTether.setSummary(R.string.usb_tethering_unavailable_subtext); mUsbTether.setEnabled(false); |