Remain compatible with 4.1 handover-over-SNEP devices.
Android Jelly Bean 4.1 shipped with a handover implementation
that (erroneously) used the SNEP server for exchanging handover
messages. This was corrected in future releases, however to maintain
compatibility with the 4.1 devices, continue connecting to SNEP
in case a connection to the handover service fails.
Bug: 8508568
Change-Id: I49ee98ef9c4569bdbff8aab4ee3f45264e019f3f
diff --git a/src/com/android/nfc/P2pLinkManager.java b/src/com/android/nfc/P2pLinkManager.java
index 4c8863b..4205c7a 100755
--- a/src/com/android/nfc/P2pLinkManager.java
+++ b/src/com/android/nfc/P2pLinkManager.java
@@ -643,7 +643,7 @@
}
}
- if (needsNdef) {
+ if (needsNdef || (needsHandover && handoverClient == null)) {
snepClient = new SnepClient();
try {
snepClient.connect();