diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2010-10-26 17:10:09 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2010-11-03 15:20:49 -0700 |
commit | f2e6b13620f3ebbb94166834abaaabcc08a403b7 (patch) | |
tree | f946fc68cb8b0890b32c99d9c04028e3ed3e1c7d /core/java/android/bluetooth/BluetoothHeadset.java | |
parent | de04e5242ad7d95c392070e1a4f7acdf3809b91a (diff) | |
download | frameworks_base-f2e6b13620f3ebbb94166834abaaabcc08a403b7.zip frameworks_base-f2e6b13620f3ebbb94166834abaaabcc08a403b7.tar.gz frameworks_base-f2e6b13620f3ebbb94166834abaaabcc08a403b7.tar.bz2 |
Add APIs for starting and stopping a virtual call.
This API is useful for cases where the user wants to play
their voicemail, for example, through their Bluetooth headsets.
Original Change by: kausik@broadcom.com
Change-Id: I6bc8929c359d698a1bacdefab4425e3a0ac5d8dd
Diffstat (limited to 'core/java/android/bluetooth/BluetoothHeadset.java')
-rw-r--r-- | core/java/android/bluetooth/BluetoothHeadset.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index c03b444..f63a5c5 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java @@ -621,6 +621,51 @@ public final class BluetoothHeadset implements BluetoothProfile { return BluetoothHeadset.STATE_AUDIO_DISCONNECTED; } + /** + * Initiates a Virtual Voice Call to the handsfree device (if connected). + * Allows the handsfree device to be used for routing non-cellular call audio + * + * @param device Remote Bluetooth Device + * @return true if successful, false if there was some error. + * @hide + */ + public boolean startVirtualVoiceCall(BluetoothDevice device) { + if (DBG) log("startVirtualVoiceCall()"); + if (mService != null && isEnabled() && isValidDevice(device)) { + try { + return mService.startVirtualVoiceCall(device); + } 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; + } + + /** + * Terminates an ongoing Virtual Voice Call to the handsfree device (if connected). + * + * @param device Remote Bluetooth Device + * @return true if successful, false if there was some error. + * @hide + */ + public boolean stopVirtualVoiceCall(BluetoothDevice device) { + if (DBG) log("stopVirtualVoiceCall()"); + if (mService != null && isEnabled() && isValidDevice(device)) { + try { + return mService.stopVirtualVoiceCall(device); + } 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 ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if (DBG) Log.d(TAG, "Proxy object connected"); |