Fix media option settings for A2DP.

Incoming connections move the A2DP state to Connecting
before getting authorized, which messes up the priorities.

Dr No: Eastham
Bug: 2358414
diff --git a/core/java/android/server/BluetoothA2dpService.java b/core/java/android/server/BluetoothA2dpService.java
index dfec1eb..46145b9 100644
--- a/core/java/android/server/BluetoothA2dpService.java
+++ b/core/java/android/server/BluetoothA2dpService.java
@@ -463,7 +463,8 @@
                 mAudioManager.setParameters("A2dpSuspended=false");
             }
 
-            if (state == BluetoothA2dp.STATE_CONNECTING ||
+            if (getSinkPriority(device) > BluetoothA2dp.PRIORITY_OFF &&
+                    state == BluetoothA2dp.STATE_CONNECTING ||
                     state == BluetoothA2dp.STATE_CONNECTED) {
                 // We have connected or attempting to connect.
                 // Bump priority