Loading android/app/src/com/android/bluetooth/pan/PanService.java +2 −17 Original line number Diff line number Diff line Loading @@ -50,9 +50,6 @@ 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 * the Bluetooth application. Loading @@ -76,8 +73,6 @@ 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"; private BluetoothTetheringNetworkFactory mNetworkFactory; Loading Loading @@ -109,10 +104,6 @@ public class PanService extends ProfileService { mNetworkFactory = new BluetoothTetheringNetworkFactory(getBaseContext(), getMainLooper(), this); // Set mTetherOn based on the last saved tethering preference while starting the Pan service SharedPreferences tetherSetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); mTetherOn = tetherSetting.getBoolean(PAN_TETHER_SETTING, false); return true; } Loading Loading @@ -238,6 +229,7 @@ public class PanService extends ProfileService { return service.isPanUOn(); } public boolean isTetheringOn() { // TODO(BT) have a variable marking the on/off state PanService service = getService(); if (service == null) return false; return service.isTetheringOn(); Loading Loading @@ -297,6 +289,7 @@ public class PanService extends ProfileService { return (getPanLocalRoleNative() & BluetoothPan.LOCAL_PANU_ROLE) != 0; } boolean isTetheringOn() { // TODO(BT) have a variable marking the on/off state return mTetherOn; } Loading @@ -309,14 +302,6 @@ public class PanService extends ProfileService { throw new SecurityException("DISALLOW_CONFIG_TETHERING is enabled for this user."); } if(mTetherOn != value) { SharedPreferences tetherSetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); SharedPreferences.Editor editor = tetherSetting.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
android/app/src/com/android/bluetooth/pan/PanService.java +2 −17 Original line number Diff line number Diff line Loading @@ -50,9 +50,6 @@ 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 * the Bluetooth application. Loading @@ -76,8 +73,6 @@ 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"; private BluetoothTetheringNetworkFactory mNetworkFactory; Loading Loading @@ -109,10 +104,6 @@ public class PanService extends ProfileService { mNetworkFactory = new BluetoothTetheringNetworkFactory(getBaseContext(), getMainLooper(), this); // Set mTetherOn based on the last saved tethering preference while starting the Pan service SharedPreferences tetherSetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); mTetherOn = tetherSetting.getBoolean(PAN_TETHER_SETTING, false); return true; } Loading Loading @@ -238,6 +229,7 @@ public class PanService extends ProfileService { return service.isPanUOn(); } public boolean isTetheringOn() { // TODO(BT) have a variable marking the on/off state PanService service = getService(); if (service == null) return false; return service.isTetheringOn(); Loading Loading @@ -297,6 +289,7 @@ public class PanService extends ProfileService { return (getPanLocalRoleNative() & BluetoothPan.LOCAL_PANU_ROLE) != 0; } boolean isTetheringOn() { // TODO(BT) have a variable marking the on/off state return mTetherOn; } Loading @@ -309,14 +302,6 @@ public class PanService extends ProfileService { throw new SecurityException("DISALLOW_CONFIG_TETHERING is enabled for this user."); } if(mTetherOn != value) { SharedPreferences tetherSetting = getSharedPreferences(PAN_PREFERENCE_FILE, 0); SharedPreferences.Editor editor = tetherSetting.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