summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jaikumar Ganesh <jaikumar@google.com> 2010-11-08 14:07:53 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-11-08 14:07:53 -0800
commit1bc0177328ed5103f3ce49eadbaeb2f363a00bc8 (patch)
treee6d580eea56afd597c1931e863559d80e7839c55
parentd8acf9b68235c9c9a73f797cf520b9384d1c9368 (diff)
parentf2e6b13620f3ebbb94166834abaaabcc08a403b7 (diff)
Merge "Add APIs for starting and stopping a virtual call."
-rw-r--r--core/java/android/bluetooth/BluetoothHeadset.java45
-rw-r--r--core/java/android/bluetooth/IBluetoothHeadset.aidl3
2 files changed, 48 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java
index c03b444a0eb2..f63a5c5c344b 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");
diff --git a/core/java/android/bluetooth/IBluetoothHeadset.aidl b/core/java/android/bluetooth/IBluetoothHeadset.aidl
index ab07931b8bcc..e9521939ef85 100644
--- a/core/java/android/bluetooth/IBluetoothHeadset.aidl
+++ b/core/java/android/bluetooth/IBluetoothHeadset.aidl
@@ -47,4 +47,7 @@ interface IBluetoothHeadset {
boolean disconnectHeadsetInternal(in BluetoothDevice device);
boolean setAudioState(in BluetoothDevice device, int state);
int getAudioState(in BluetoothDevice device);
+
+ boolean startVirtualVoiceCall(in BluetoothDevice device);
+ boolean stopVirtualVoiceCall(in BluetoothDevice device);
}