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

Commit fa1a5278 authored by Ganesh Ganapathi Batta's avatar Ganesh Ganapathi Batta Committed by Matthew Xie
Browse files

Implement enableNoAutoconnect()

Adding enableNoAutoconnect() API support in Bluetooth service
 to let BT enable in quiet mode

Change-Id: I546f3ceb298082a9c9a698f406379470e3cc0d4f
parent 20867a77
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -504,7 +504,10 @@ public final class BluetoothAdapter {
     *         immediate error
     */
    public boolean enable() {
        boolean enabled = false;
        if (isEnabled() == true){
            if (DBG) Log.d(TAG, "enable(): BT is already enabled..!");
            return true;
        }
        try {
            return mManagerService.enable();
        } catch (RemoteException e) {Log.e(TAG, "", e);}
@@ -1246,8 +1249,14 @@ public final class BluetoothAdapter {
     * @hide
     */
    public boolean enableNoAutoConnect() {
        // TODO avoid auto-connect in the new stack.
        return enable();
        if (isEnabled() == true){
            if (DBG) Log.d(TAG, "enableNoAutoConnect(): BT is already enabled..!");
            return true;
        }
        try {
            return mManagerService.enableNoAutoConnect();
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        return false;
    }

    /**
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ interface IBluetoothManager
    void unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback);
    boolean isEnabled();
    boolean enable();
    boolean enableNoAutoConnect();
    boolean disable(boolean persist);

    String getAddress();