diff options
author | Amith Yamasani <yamasani@google.com> | 2011-02-14 14:19:08 -0800 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2011-02-14 14:19:08 -0800 |
commit | e419bc1bed37d0584b32f0c0d54ecd9b9e1ea212 (patch) | |
tree | 00ae473eb1c41e544cf5516cc3a85bfbf9a92c6d /src/com/android/settings/TetherSettings.java | |
parent | f11033f7ababdf3748b277cea17c5ef6b05af0b1 (diff) | |
download | packages_apps_Settings-e419bc1bed37d0584b32f0c0d54ecd9b9e1ea212.zip packages_apps_Settings-e419bc1bed37d0584b32f0c0d54ecd9b9e1ea212.tar.gz packages_apps_Settings-e419bc1bed37d0584b32f0c0d54ecd9b9e1ea212.tar.bz2 |
Fix for crash in TetherSettings when monkey is running.
Bug: 3407666
onCreateView can get called on returning from another fragment. Moved the
relevant code to onCreate().
Change-Id: Icf08c18a3981051cce4eca2d07334d0a9f3c0116
Diffstat (limited to 'src/com/android/settings/TetherSettings.java')
-rw-r--r-- | src/com/android/settings/TetherSettings.java | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java index 085a089..4ccd598 100644 --- a/src/com/android/settings/TetherSettings.java +++ b/src/com/android/settings/TetherSettings.java @@ -86,12 +86,6 @@ public class TetherSettings extends SettingsPreferenceFragment { public void onCreate(Bundle icicle) { super.onCreate(icicle); addPreferencesFromResource(R.xml.tether_prefs); - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View view = super.onCreateView(inflater, container, savedInstanceState); final Activity activity = getActivity(); mBluetoothPan = new BluetoothPan(activity); @@ -109,17 +103,19 @@ public class TetherSettings extends SettingsPreferenceFragment { mWifiRegexs = cm.getTetherableWifiRegexs(); mBluetoothRegexs = cm.getTetherableBluetoothRegexs(); - boolean usbAvailable = mUsbRegexs.length != 0; - boolean wifiAvailable = mWifiRegexs.length != 0; - boolean bluetoothAvailable = mBluetoothRegexs.length != 0; + final boolean usbAvailable = mUsbRegexs.length != 0; + final boolean wifiAvailable = mWifiRegexs.length != 0; + final boolean bluetoothAvailable = mBluetoothRegexs.length != 0; if (!usbAvailable || Utils.isMonkeyRunning()) { getPreferenceScreen().removePreference(mUsbTether); } + if (!wifiAvailable) { getPreferenceScreen().removePreference(mEnableWifiAp); getPreferenceScreen().removePreference(mWifiApSettings); } + if (!bluetoothAvailable) { getPreferenceScreen().removePreference(mBluetoothTether); } else { @@ -129,27 +125,9 @@ public class TetherSettings extends SettingsPreferenceFragment { mBluetoothTether.setChecked(false); } } - /* Don't change the title for two-pane settings - if (wifiAvailable && usbAvailable && bluetoothAvailable){ - activity.setTitle(R.string.tether_settings_title_all); - } else if (wifiAvailable && usbAvailable){ - activity.setTitle(R.string.tether_settings_title_all); - } else if (wifiAvailable && bluetoothAvailable){ - activity.setTitle(R.string.tether_settings_title_all); - } else if (wifiAvailable) { - activity.setTitle(R.string.tether_settings_title_wifi); - } else if (usbAvailable && bluetoothAvailable) { - activity.setTitle(R.string.tether_settings_title_usb_bluetooth); - } else if (usbAvailable) { - activity.setTitle(R.string.tether_settings_title_usb); - } else { - activity.setTitle(R.string.tether_settings_title_bluetooth); - } - */ + mWifiApEnabler = new WifiApEnabler(activity, mEnableWifiAp); mView = new WebView(activity); - - return view; } @Override |