From c18c9138cee0f0859bcab636a004ce92ca4a9ab5 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 12 Apr 2013 17:24:56 -0700 Subject: [PATCH] AudioService: SCO audio backward compatibility After commit 25fc29b3, AudioManager.startBluetoothSco() does not use virtual voice call mode anymore when starting the SCO audio connection to the headset. To help backward compatibility, this change makes that virtual voice call is used if the request comes from an application targeting a SDK version before JB MR2. For applications targeted to JB MR2 and above a raw SCO audio connection is established. Bug 8157702 Change-Id: If1ded2fd99b7ed76d2435d95ee03659e78a7882a --- media/java/android/media/AudioManager.java | 8 ++- media/java/android/media/AudioService.java | 58 +++++++++++++++++---- media/java/android/media/IAudioService.aidl | 2 +- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index 917a47df52be7..56e98e4a92068 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -24,6 +24,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Binder; +import android.os.Build; import android.os.Handler; import android.os.IBinder; import android.os.Looper; @@ -1205,6 +1206,11 @@ public class AudioManager { * call {@link #stopBluetoothSco()} to clear the request and turn down the bluetooth connection. *

Even if a SCO connection is established, the following restrictions apply on audio * output streams so that they can be routed to SCO headset: + *

NOTE: up to and including API version + * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}, this method initiates a virtual + * voice call to the bluetooth headset. + * After API version {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2} only a raw SCO audio + * connection is established. *