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

Commit c98ca60c authored by Christopher Lais's avatar Christopher Lais
Browse files

BluetoothHeadset: compatibility for nuance's vsuite

vsuite uses an internal function that was changed in gingerbread;
provide compatibility for it.

Change-Id: Ib6fbb0e4dcb5d434535f5b96f3cb3005b7f4ace5
parent 3df945f7
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