Merge "Do not use isAudioOn hidden API"
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index 3796e64..f9013c6 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -392,7 +392,7 @@
             try {
                 int stream;
                 if (mBluetoothHeadset != null) {
-                    stream = mBluetoothHeadset.isAudioOn() ? AudioManager.STREAM_BLUETOOTH_SCO:
+                    stream = isBluetoothAudioOn() ? AudioManager.STREAM_BLUETOOTH_SCO :
                         AudioManager.STREAM_VOICE_CALL;
                 } else {
                     stream = AudioManager.STREAM_VOICE_CALL;
@@ -479,6 +479,11 @@
         }
     }
 
+    // Returns whether there are any connected Bluetooth audio devices
+    private boolean isBluetoothAudioOn() {
+        return mBluetoothHeadset.getConnectedDevices().size() > 0;
+    }
+
     /**
      * Displays a notification when the phone receives a DisplayInfo record.
      */