TetheringSetting: Keep Tethering checkbox unchecked until tethering up

When click Tethering, the checkbox will be checked and then unchecked,
and finally move to checked states. This causes confusing to end user,
we need to keep Tethering checkbox unchecked before tethering is really
up.

Change-Id: If2314b7dd1369e619dead45af38fd53c7e89c34e
Author: Li Wenji <wenji.li@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 18281
This commit is contained in:
Li Wenji
2012-02-11 11:52:30 +08:00
committed by Xiaokang Qin
parent 5dbc1f6405
commit 83397eab96

View File

@@ -493,8 +493,8 @@ public class TetherSettings extends SettingsPreferenceFragment
private void setUsbTethering(boolean enabled) { private void setUsbTethering(boolean enabled) {
ConnectivityManager cm = ConnectivityManager cm =
(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm.setUsbTethering(enabled) != ConnectivityManager.TETHER_ERROR_NO_ERROR) {
mUsbTether.setChecked(false); mUsbTether.setChecked(false);
if (cm.setUsbTethering(enabled) != ConnectivityManager.TETHER_ERROR_NO_ERROR) {
mUsbTether.setSummary(R.string.usb_tethering_errored_subtext); mUsbTether.setSummary(R.string.usb_tethering_errored_subtext);
return; return;
} }