Fix NPE in WirelessSettings.onCreate() for SDK and non-BT devices.

Fix NPE when entering Settings app in the SDK (and for devices without
Bluetooth). Also remove the "Bluetooth settings" item in addition to
the Bluetooth toggle item from Wireless settings when BT is missing.

Bug: 4149307
Change-Id: Iecc5960a193cf88664d3217b4d7bdbc2276dabc0
This commit is contained in:
Jake Hamby
2011-03-28 20:25:23 -07:00
parent f3b325f54d
commit f1139aab80
3 changed files with 9 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
void addPreferencesForActivity() {
addPreferencesFromResource(R.xml.bluetooth_settings);
mEnabler = new BluetoothEnabler(getActivity(), mLocalAdapter,
mEnabler = new BluetoothEnabler(getActivity(),
(CheckBoxPreference) findPreference(KEY_BT_CHECKBOX));
mDiscoverableEnabler = new BluetoothDiscoverableEnabler(getActivity(),