summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/TetherSettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/TetherSettings.java')
-rw-r--r--src/com/android/settings/TetherSettings.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
index 77a72a7..368973c 100644
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -55,6 +55,7 @@ import java.util.Locale;
*/
public class TetherSettings extends SettingsPreferenceFragment
implements DialogInterface.OnClickListener, Preference.OnPreferenceChangeListener {
+ private static final String TAG = "TetherSettings";
private static final String USB_TETHER_SETTINGS = "usb_tether_settings";
private static final String ENABLE_WIFI_AP = "enable_wifi_ap";
@@ -234,8 +235,10 @@ public class TetherSettings extends SettingsPreferenceFragment
switch (intent
.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) {
case BluetoothAdapter.STATE_ON:
- mBluetoothPan.setBluetoothTethering(true);
- mBluetoothEnableForTether = false;
+ if(mBluetoothPan != null) {
+ mBluetoothPan.setBluetoothTethering(true);
+ mBluetoothEnableForTether = false;
+ }
break;
case BluetoothAdapter.STATE_OFF:
@@ -392,7 +395,8 @@ public class TetherSettings extends SettingsPreferenceFragment
} else if (btState == BluetoothAdapter.STATE_TURNING_ON) {
mBluetoothTether.setEnabled(false);
mBluetoothTether.setSummary(R.string.bluetooth_turning_on);
- } else if (btState == BluetoothAdapter.STATE_ON && mBluetoothPan.isTetheringOn()) {
+ } else if (btState == BluetoothAdapter.STATE_ON &&
+ mBluetoothPan != null && mBluetoothPan.isTetheringOn()) {
mBluetoothTether.setChecked(true);
mBluetoothTether.setEnabled(true);
if (bluetoothTethered > 1) {