Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 218005e4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: Fix to update mTetherOn with proper value."

parents d954826b 649ef294
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -320,23 +320,20 @@ public class PanService extends ProfileService {
    }
     boolean isTetheringOn() {
        // TODO(BT) have a variable marking the on/off state
        if (SystemProperties.getBoolean("bluetooth.mTetherOn", false) == true) {
             if(DBG) Log.d(TAG, "isTetheringOn : " + SystemProperties.getBoolean("bluetooth.mTetherOn", false));
             return true;
        }
        return false;
        mTetherOn = SystemProperties.getBoolean("bluetooth.mTetherOn", false);
        if(DBG) Log.d(TAG, "isTetheringOn : " + mTetherOn);
        return mTetherOn;
    }

    void setBluetoothTethering(boolean value) {

        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission");
        mTetherOn = SystemProperties.getBoolean("bluetooth.mTetherOn", false) ;
        if (DBG) Log.d(TAG, "setBluetoothTethering: " + value +", mTetherOn: " + mTetherOn);

        if (SystemProperties.getBoolean("bluetooth.mTetherOn", false) != value){
        if (mTetherOn != value) {
            //drop any existing panu or pan-nap connection when changing the tethering state
            SystemProperties.set("bluetooth.mTetherOn", value?"true":"false");

            mTetherOn = value;
            SystemProperties.set("bluetooth.mTetherOn", mTetherOn?"true":"false");
            List<BluetoothDevice> DevList = getConnectedDevices();
            for (BluetoothDevice dev : DevList)
                disconnect(dev);