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

Commit e3d5723a authored by Bhasker Neti's avatar Bhasker Neti
Browse files

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

This reverts commit 649ef294.

Revert "Bluetooth: Added a property to have the tethering setting persist"

This reverts commit 205cd5db.
This is is a combination of 2 commits.

Changed  the implementation via
Change-Id: Ifbe1bc4909d259e7e8e6e9801b28d974f38c5354
parent 218005e4
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.os.SystemProperties;


/**
 * Provides Bluetooth Pan Device profile, as a service in
@@ -320,20 +320,15 @@ public class PanService extends ProfileService {
    }
     boolean isTetheringOn() {
        // TODO(BT) have a variable marking the on/off state
        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");
        if(DBG) Log.d(TAG, "setBluetoothTethering: " + value +", mTetherOn: " + mTetherOn);

        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission");
        if(mTetherOn != value) {
            //drop any existing panu or pan-nap connection when changing the tethering state
            mTetherOn = value;
            SystemProperties.set("bluetooth.mTetherOn", mTetherOn?"true":"false");
            List<BluetoothDevice> DevList = getConnectedDevices();
            for(BluetoothDevice dev : DevList)
                disconnect(dev);