Snap for 6619791 from f35850ffc7c8ac0cfdb5b55700b1293c04553b74 to q-keystone-qcom-release

Change-Id: I419f623e039d0e88b74b114ef284964675580666
diff --git a/src/com/android/bluetooth/a2dp/A2dpService.java b/src/com/android/bluetooth/a2dp/A2dpService.java
index 3c8435b..38ba2d6 100755
--- a/src/com/android/bluetooth/a2dp/A2dpService.java
+++ b/src/com/android/bluetooth/a2dp/A2dpService.java
@@ -880,11 +880,11 @@
 
         if (device == null) {
             // Remove active device and continue playing audio only if necessary.
-            removeActiveDevice(false);
             synchronized(mBtAvrcpLock) {
                 if(mAvrcp_ext != null)
                     mAvrcp_ext.setActiveDevice(device);
             }
+            removeActiveDevice(false);
             return true;
         }