Add method to check for extended length support
@@ -27,6 +27,9 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.net.Uri;
+import android.nfc.NfcAdapter;
+import android.nfc.Tag;
+import android.nfc.tech.IsoDep;
import android.os.AsyncTask;
import android.os.Bundle;
import org.openecard.addon.bind.AuxDataKeys;
@@ -214,6 +217,18 @@ public abstract class AbstractActivationActivity extends Activity implements Bin
return eacAlreadyConnected;
}
+ /**
+ * This method proves if extended length APDU commands are supported. If extended length is supported, then
+ * true is returned, otherwise false. This method should be used when a nfc tag comes over an intent.
+ *
+ * @param intent
+ * @return
+ */
+ protected boolean isExtendedLengthSupported(Intent intent) {
+ Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
+ return tagFromIntent != null ? IsoDep.get(tagFromIntent).isExtendedLengthApduSupported() : false;
+ }
+
/**
* Implement this method to provide an instance of a service connection. The service connection is needed to
* connect to the Eac Gui Service.
