Mark link as deactivated before doing anything else.
Change-Id: I27a2b8742726b7ea49129270afe264248626af55
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 2e857da..97b8e74 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -2585,6 +2585,9 @@
case MSG_LLCP_LINK_DEACTIVATED:
device = (NativeP2pDevice) msg.obj;
+ /* Mark the link state */
+ mLlcpLinkState = NfcAdapter.LLCP_LINK_STATE_DEACTIVATED;
+
Log.d(TAG, "LLCP Link Deactivated message. Restart polling loop.");
if (device.getMode() == NativeP2pDevice.MODE_P2P_TARGET) {
if (DBG) Log.d(TAG, "disconnecting from target");
@@ -2594,9 +2597,6 @@
if (DBG) Log.d(TAG, "not disconnecting from initiator");
}
- /* Mark the link state */
- mLlcpLinkState = NfcAdapter.LLCP_LINK_STATE_DEACTIVATED;
-
/* Broadcast Intent Link LLCP activated */
Intent LlcpLinkIntent = new Intent();
LlcpLinkIntent.setAction(NfcAdapter.ACTION_LLCP_LINK_STATE_CHANGED);