diff options
author | Bryce Lee <brycelee@google.com> | 2015-10-28 22:21:54 -0700 |
---|---|---|
committer | Bryce Lee <brycelee@google.com> | 2015-10-28 22:21:54 -0700 |
commit | 6fe0e74aad0216116a09ecb6d85091c9e8a36f6f (patch) | |
tree | e6738c64818b186c9c44c67447214c1dae84a7de /framework/java/android/bluetooth/BluetoothHeadsetClient.java | |
parent | 71bd291257152ddb6520b326b03526161b5885e3 (diff) |
Add ability to set whether audio route is allowed in BluetoothHeadsetClient
Bug: 25332357
Change-Id: I942ac0dea3e4f8580c44e027a570d0b59822a257
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHeadsetClient.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothHeadsetClient.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHeadsetClient.java b/framework/java/android/bluetooth/BluetoothHeadsetClient.java index ff4ebee221..874026fb15 100644 --- a/framework/java/android/bluetooth/BluetoothHeadsetClient.java +++ b/framework/java/android/bluetooth/BluetoothHeadsetClient.java @@ -1059,6 +1059,41 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { } /** + * Sets whether audio routing is allowed. + * + * Note: This is an internal function and shouldn't be exposed + */ + public void setAudioRouteAllowed(boolean allowed) { + if (VDBG) log("setAudioRouteAllowed"); + if (mService != null && isEnabled()) { + try { + mService.setAudioRouteAllowed(allowed); + } 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())); + } + } + + /** + * Returns whether audio routing is allowed. + * + * Note: This is an internal function and shouldn't be exposed + */ + public boolean getAudioRouteAllowed() { + if (VDBG) log("getAudioRouteAllowed"); + if (mService != null && isEnabled()) { + try { + return mService.getAudioRouteAllowed(); + } 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; + } + + /** * Initiates a connection of audio channel. * * It setup SCO channel with remote connected Handsfree AG device. |