1. 08 Mar, 2011 1 commit
  2. 24 Feb, 2011 2 commits
  3. 18 Feb, 2011 2 commits
    • Martijn Coenen's avatar
      Fix isConnected() implementation. · 6a7ba70e
      Martijn Coenen authored
      The NFC API's isConnected() is mapped to isPresent on a NativeNfcTag
      object, which in turn uses a cached value. This value was however not
      updated properly when the internal presence check loop detected the
      tag to be gone. The cases where isConnected() does work properly
      are screen off and explicit disconnect.
      
      Change-Id: Ieac76ceb1f161ead772ce9fd2acf273b23caca37
      6a7ba70e
    • Martijn Coenen's avatar
      Fix race in NFC tag registry/dispatch. · 10389c11
      Martijn Coenen authored
      The tag handle was only registered after the dispatch; with the "normal"
      dispatch the activity would take a while to start and this problem would not be
      seen. With foreground dispatch however, if you'd immediately try to connect to a tag,
      sometimes the tag handle is not registered yet, causing the connect() to fail.
      
      Change-Id: I92b5e36a5d8f08e410a656d364e88bce2d25c854
      10389c11
  4. 16 Feb, 2011 4 commits
  5. 09 Feb, 2011 1 commit
  6. 01 Feb, 2011 1 commit
  7. 28 Jan, 2011 2 commits
    • Martijn Coenen's avatar
      INfcTag isPresent() should not block and not cause RF activity. · ab2b44b9
      Martijn Coenen authored
      Use a cached value instead, which is based on the presence check that is running
      anyway.
      
      Change-Id: Ifa50ff38e884fa865bb7ba95dde45da39bebf7e8
      ab2b44b9
    • Martijn Coenen's avatar
      Fixed connect() failure from technology->ndef->technology. · 6b3ccb6e
      Martijn Coenen authored
      Suppose you have a MifareClassic tag with NDEF; the following scenario failed
      MifareClassic.connect()/close() -> Ndef.connect()/close() -> MifareClassic.connect() .
      
      This last connect fails because the service refuses to connect any technology
      on the same handle, except for NDEF. This check was too strict - it was only
      intended to catch connecting to a NfcA technology on an IsoDep tag, as libNFC does not
      support this. This change always allows connecting a tech on the same handle, except
      when you want to connect a non-IsoDep technology on a tag that does have the IsoDep
      technology on the same handle - in which case it refuses. This
      matches exactly what libnfc supports.
      
      Change-Id: I64d552b3cd51beb36712676492f36d182c605748
      6b3ccb6e
  8. 27 Jan, 2011 1 commit
  9. 26 Jan, 2011 3 commits
  10. 25 Jan, 2011 1 commit
    • Jeff Hamilton's avatar
      Stop using URIs for ACTION_TECHNOLOGY_DISCOVERED · 24dbea55
      Jeff Hamilton authored
      The pattern matching wasn't sufficient with the
      move to identifying technologies with their class
      names so now we use a custom dispatching mechanism.
      
      Change-Id: I3e6379d454458bbb65730ade32cdaa1680c5e339
      24dbea55
  11. 24 Jan, 2011 4 commits
    • Arnaud Ferir's avatar
      Do not disconnect P2P target if connect failed. · 7f5487be
      Arnaud Ferir authored
      If the P2P target connect failed, the P2P target disconnect cannot be done.
      However the polling loop must be restarted. This is already done in JNI layer
      by the failing connect itself.
      
      Change-Id: I1c3323e4c038c8133e7b6e16b3a238c050427cfc
      7f5487be
    • Arnaud Ferir's avatar
      Fix tag disconnect. · 2436ffe9
      Arnaud Ferir authored
      This patch fixes the tag disconnect sequence in 2 cases:
      
      1.
      When the NFC service disconnects a tag because it is not needed anymore, the
      disconnection should be effective immediately and not delayed until the tag is
      removed from the field. The NFC service is responsible for discovering again
      the same tag if the polling loop is restarted.
      The looping "presence check" in native code is then removed.
      
      2.
      Before the screen is turned off, the polling loop configuration and - if any
      tag is present - the tag disconnection must be done accordingly to the "normal"
      tag management. In particular the watchdog must be stopped properly.
      
      Change-Id: I58ee27cede110c419052b4eef07f1e4bd35ae208
      2436ffe9
    • Martijn Coenen's avatar
      Don't throw NdefFormattable technology when Ndef found. · e08c8939
      Martijn Coenen authored
      libNFC doesn't support formatting tags that are already NDEF formatted. This
      needs to be fixed in libNFC, but as a temporary work-around we will only
      throw the NdefFormattable technology if no NDEF has been found on the tag.
      
      Change-Id: I487b875de5fd66fdfec2d1b9c30fa886d8ca1477
      e08c8939
    • Jeff Hamilton's avatar
      Make the NDEF intent creation more robust. · adb527a9
      Jeff Hamilton authored
      There are lots of ways things could go
      wrong when faced with invalid NDEF data
      so just got for the catch-all and handle
      it properly.
      
      Change-Id: Ia762c8e337aef8fed867beab8159e6ed05bbacea
      adb527a9
  12. 23 Jan, 2011 1 commit
    • Jeff Hamilton's avatar
      Tweak dispatching a bit. · a1935861
      Jeff Hamilton authored
      Foreground dispatch overrides now interpret
      null for the filters as "catch all".
      
      Foreground NDEF push disables standard dispatch
      and only honors foreground dispatching so that
      two NDEF push apps don't end up just swapping
      between each other when the push happens.
      
      Change-Id: Ic305d4a3a593fff732b8d88ae72e09b4a03d6286
      a1935861
  13. 21 Jan, 2011 5 commits
  14. 20 Jan, 2011 1 commit
    • Nick Pelly's avatar
      Fix 4 second latency starting Tag application when recently using home. · 1a9eca5f
      Nick Pelly authored
      The home screen and other system apps call stopAppSwitches() to prevent
      malicious applications from starting their activity again when the user exits.
      The startActivity() call is delayed by 4 seconds.
      
      We can override this in NFC service because we are a system service, using
      resumeAppSwitches(). If a tag comes into the field we really want to show it
      immediately. It feels really laggy otherwise.
      
      Change-Id: I5394647f352e3f49f821b5346cd4c9af103137ca
      1a9eca5f
  15. 19 Jan, 2011 3 commits
  16. 18 Jan, 2011 8 commits
    • Arnaud Ferir's avatar
      Do not wait for callback if LLCP receive is successful. · 15a344d8
      Arnaud Ferir authored
      The LLCP receive function may return NFCSTATUS_SUCCESS is some data have
      already been received. This case should be updated according to the change
      in libnfc-nxp.
      
      Change-Id: I21ea159e2ec13f4db6ea53dd0edd2c1b916ea064
      15a344d8
    • Sylvain Fonteneau's avatar
      Set LLCP MIU parameter to optimal value. · 73a6ef05
      Sylvain Fonteneau authored
      At the NFCIP-1 level, the LLCP frames are splitted in 251-bytes
      packets. Knowing that NFCIP-1 packets have a 3-bytes header, the
      optimal size for a LLCP packet is 248-bytes.
      
      With the previous value (256), each LLCP frame was splitted in
      two NFCIP-1 packets, one 248+3 bytes and another one of 8+3 bytes.
      This was leading to less-than-optimal performances.
      
      Change-Id: Ide31b1ee24efc910c71d690a8ae100331b62ccf8
      73a6ef05
    • Sylvain Fonteneau's avatar
      Support for multiple LLCP incoming sockets. · 52e37119
      Sylvain Fonteneau authored
      The global variable previously used to store a single incoming
      connection request has been removed. Now, the requests are queued
      in a list until the corresponding accept() method is called or
      if the link goes down.
      
      This should also fix issues related to multiple incoming connection
      requests that can happen when activating/deactivating the link
      fastly.
      
      Change-Id: I3ab6c37b586b9f38b0de825e70f1efa06adf2062
      52e37119
    • Sylvain Fonteneau's avatar
      Handle error when accessing a closed socket handle. · f5d6f325
      Sylvain Fonteneau authored
      When an application tries to access a closed socket, the NFC
      service will fail to find it in its internal socket table,
      returning a null object which is impossible to cast to a
      LLCP socket class, generating a ClassCastException.
      
      This patch handle the exception catching, avoiding a service
      crash.
      
      Change-Id: I236652b83a51b78fcfe8258402888a74f3144a7f
      f5d6f325
    • Sylvain Fonteneau's avatar
      Moved LLCP link parameters configuration to NFC service initialization. · 6efda9f3
      Sylvain Fonteneau authored
      With the latest libnfc-nxp library, the LLCP socket internals are
      initialized when configuring the LLCP link parameters because it
      must be the first LLCP function called.
      
      Due to this, these parameters are now set only once at the NFC
      service startup instead of each peer discovery.
      
      As a consequence, the NFC Manager initialization now use the
      application properties (which contains link parameters) so these
      properties are loaded before initialization.
      
      Change-Id: I8e04c3135646a12a48c392d47cb47d09cd234ea1
      6efda9f3
    • Sylvain Fonteneau's avatar
      Removed workaround for native socket creation limitation. · 1878c7b6
      Sylvain Fonteneau authored
      Until now, the NFC native library (libnfc-nxp) had some limitations
      on the socket life cycle that made impossible to ensure the local server
      socket was listening before the remote client was trying to connect.
      
      The RegisteredSocket class was created to workaround this by enabling
      socket creation at the Java layer prior to link establishment. This
      solution was not fully satisfactory since there were still some race
      conditions.
      
      A fix for these limitations has been submitted in the library project
      in a commit named "Allow LLCP socket creation before link establishment"
      and this patch takes advantage of it to remove the RegisteredSocket
      class and all the associated code.
      
      As a consequence, the socket creation methods have been simplified, the
      link activation processes is lighter (no need to recreate native sockets
      on link activation).
      
      This patch also includes some cleaning (removed unused variables).
      
      Change-Id: I643509d620105ae7d3ba24ea68eae37f05bc6ef3
      1878c7b6
    • daniel_tomas's avatar
      WTX set to the maximum value by default · f993b6dc
      daniel_tomas authored
      Change-Id: I7ad0fc608c2dd81b42dcbca994759352ffae9360
      f993b6dc
    • Sylvain Fonteneau's avatar
      Release JNI local references in LLCP sockets. · 8ddea174
      Sylvain Fonteneau authored
      Change-Id: I691f1568ae83f2483bd6c60489d427cf62b1c9c8
      8ddea174