Loading src/com/android/bluetooth/pan/PanService.java 100755 → 100644 +14 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; /** * Provides Bluetooth Pan Device profile, as a service in Loading @@ -76,6 +77,8 @@ public class PanService extends ProfileService { private static final int MESSAGE_DISCONNECT = 2; private static final int MESSAGE_CONNECT_STATE_CHANGED = 11; private boolean mTetherOn = false; private static final String PAN_PREFERENCE_FILE = "PANMGR"; private static final String PAN_TETHER_SETTING = "TETHERSTATE"; AsyncChannel mTetherAc; Loading Loading @@ -320,13 +323,23 @@ public class PanService extends ProfileService { } boolean isTetheringOn() { // TODO(BT) have a variable marking the on/off state SharedPreferences tethsetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); mTetherOn = tethsetting.getBoolean(PAN_TETHER_SETTING, false); return mTetherOn; } void setBluetoothTethering(boolean value) { if(DBG) Log.d(TAG, "setBluetoothTethering: " + value +", mTetherOn: " + mTetherOn); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); SharedPreferences tethsetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); if(mTetherOn != value) { SharedPreferences.Editor editor = tethsetting.edit(); editor.putBoolean(PAN_TETHER_SETTING, value); // Commit the edit! editor.commit(); //drop any existing panu or pan-nap connection when changing the tethering state mTetherOn = value; List<BluetoothDevice> DevList = getConnectedDevices(); Loading Loading
src/com/android/bluetooth/pan/PanService.java 100755 → 100644 +14 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; /** * Provides Bluetooth Pan Device profile, as a service in Loading @@ -76,6 +77,8 @@ public class PanService extends ProfileService { private static final int MESSAGE_DISCONNECT = 2; private static final int MESSAGE_CONNECT_STATE_CHANGED = 11; private boolean mTetherOn = false; private static final String PAN_PREFERENCE_FILE = "PANMGR"; private static final String PAN_TETHER_SETTING = "TETHERSTATE"; AsyncChannel mTetherAc; Loading Loading @@ -320,13 +323,23 @@ public class PanService extends ProfileService { } boolean isTetheringOn() { // TODO(BT) have a variable marking the on/off state SharedPreferences tethsetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); mTetherOn = tethsetting.getBoolean(PAN_TETHER_SETTING, false); return mTetherOn; } void setBluetoothTethering(boolean value) { if(DBG) Log.d(TAG, "setBluetoothTethering: " + value +", mTetherOn: " + mTetherOn); enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); SharedPreferences tethsetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); if(mTetherOn != value) { SharedPreferences.Editor editor = tethsetting.edit(); editor.putBoolean(PAN_TETHER_SETTING, value); // Commit the edit! editor.commit(); //drop any existing panu or pan-nap connection when changing the tethering state mTetherOn = value; List<BluetoothDevice> DevList = getConnectedDevices(); Loading