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

Commit 177d078d authored by Mudumba Ananth's avatar Mudumba Ananth Committed by Matthew Xie
Browse files

Add WBS support on Bluedroid (6/6)

         Bug 13764086

Change-Id: I7afbddb02fc247d7799ab0fb264a467c7853cb32
parent 92222a00
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
@@ -886,6 +886,50 @@ public final class BluetoothHeadset implements BluetoothProfile {
        return false;
    }

    /**
     * enable WBS codec setting.
     *
     * @return true if successful
     *         false if there was some error such as
     *               there is no connected headset
     * @hide
     */
    public boolean enableWBS() {
        if (mService != null && isEnabled()) {
            try {
                return mService.enableWBS();
            } catch (RemoteException e) {
                Log.e(TAG, e.toString());
            }
        } else {
            Log.w(TAG, "Proxy not attached to service");
            if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
        }
        return false;
    }

    /**
     * disable WBS codec settting. It set NBS codec.
     *
     * @return true if successful
     *         false if there was some error such as
     *               there is no connected headset
     * @hide
     */
    public boolean disableWBS() {
        if (mService != null && isEnabled()) {
            try {
                return mService.disableWBS();
            } catch (RemoteException e) {
                Log.e(TAG, e.toString());
            }
        } else {
            Log.w(TAG, "Proxy not attached to service");
            if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
        }
        return false;
    }

    private final ServiceConnection mConnection = new ServiceConnection() {
        public void onServiceConnected(ComponentName className, IBinder service) {
            if (DBG) Log.d(TAG, "Proxy object connected");
+2 −0
Original line number Diff line number Diff line
@@ -55,4 +55,6 @@ interface IBluetoothHeadset {
    void phoneStateChanged(int numActive, int numHeld, int callState, String number, int type);
    void clccResponse(int index, int direction, int status, int mode, boolean mpty,
                      String number, int type);
    boolean enableWBS();
    boolean disableWBS();
}