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

Commit b81631e2 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "BluetoothHeadset: compatibility for nuance's vsuite" into gingerbread

parents ac83757c c98ca60c
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -202,6 +202,27 @@ public final class BluetoothHeadset {
        return BluetoothHeadset.STATE_ERROR;
    }

    /**
     * Get the current state of the Bluetooth Headset service.
     * COMPATIBILITY FUNCTION FOR NUANCE'S VSUITE.
     * REMOVE ONCE NO LONGER NEEDED.
     * @return One of the STATE_ return codes, or STATE_ERROR if this proxy
     *         object is currently not connected to the Headset service.
     * @hide
     */
    public int getState() {
        if (DBG) log("getState()");
        if (mService != null) {
            try {
                return mService.getState(mService.getCurrentHeadset());
            } 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 BluetoothHeadset.STATE_ERROR;
    }

    /**
     * Get the BluetoothDevice for the current headset.
     * @return current headset, or null if not in connected or connecting