Merge 212d2ec8b463ce536099516dad484cd2d2cd14e6 on remote branch
Change-Id: Ie4b58fe2d0168c88892cc1ee3af99007e5557e5e
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;
}
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
old mode 100755
new mode 100644
index 4d529f7..ad23c5f
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -371,6 +371,7 @@
if (mNotifier != null) {
mNotifier.cancelNotifications();
}
+ updatePendingNfcState();
break;
case START_LISTENER:
if (mAdapter.isEnabled()) {
@@ -1240,4 +1241,25 @@
void acceptNewConnections() {
mAcceptNewConnections = true;
}
+
+ private void updatePendingNfcState() {
+ new Thread("updateState") {
+ @Override
+ public void run() {
+ String where_nfc_pending = BluetoothShare.STATUS
+ + "=" + BluetoothShare.STATUS_PENDING + " AND "
+ + BluetoothShare.USER_CONFIRMATION + "="
+ + BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED
+ +" AND ( " + BluetoothShare.DIRECTION
+ + "=" + BluetoothShare.DIRECTION_OUTBOUND + " OR "
+ + BluetoothShare.DIRECTION + "="
+ + BluetoothShare.DIRECTION_INBOUND + ")";
+ ContentValues cv = new ContentValues();
+ cv.put(BluetoothShare.STATUS, BluetoothShare.STATUS_CONNECTION_ERROR);
+ int updatedCount = getContentResolver().update(BluetoothShare.CONTENT_URI,
+ cv, where_nfc_pending, null);
+ if (V) Log.v(TAG, "updatePendingNfcState " + updatedCount);
+ }
+ }.start();
+ }
}