Commit Graph

326 Commits

Author SHA1 Message Date
Ruchi Kandoi
a3180099bf Merge "NfcAdapter.EXTRA_SE_NAME -> NfcAdapter.EXTRA_SECURE_ELEMENT_NAME" am: 01cef932c8
am: 7ad52283ab

Change-Id: I4cdeed1b3b55de95e58c8784e379ccfe9da7e4d8
2018-03-16 21:43:04 +00:00
Ruchi Kandoi
9a33aefd65 NfcAdapter.EXTRA_SE_NAME -> NfcAdapter.EXTRA_SECURE_ELEMENT_NAME
Test: compiles
Bug: 74976874
Change-Id: Ied783f57078aaa37017cc821adf329ececac74f3
2018-03-15 15:16:39 -07:00
Ruchi Kandoi
01de0a82cc Merge "Add NFC Transaction Event intent actions and extras" am: 337e2feada am: 8b35111d3e
am: 9750a6f69a

Change-Id: I8c9f734f8e51ecae23cb225a4295e1b6b63be307
2018-02-04 00:44:02 +00:00
Jeff Sharkey
ad357d1839 Pass in the user defined by Context.
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.

This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.

Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
2018-02-03 02:11:45 +00:00
Ruchi Kandoi
a077161382 Add NFC Transaction Event intent actions and extras
Bug: 72556384
Bug: 65127791
Test: Test App check for RF Events
Change-Id: I22f5e3d8dc11d518c96a74e54121e072caa6a18d
2018-02-02 09:19:08 -08:00
Love Khanna
f5d6d5c1a8 Set default value for T3T_PMM.
If HCEF Application does not provide the T3T PMM value, set the
default value (FFFFFFFFFFFFFFFF) as per NCI specification.

Bug: 64112415
Test: CTS Verifier; HCE-F Reader/Emulator Test
Change-Id: I24f212d9bebd978342e4dd04d618572132e7eb4b
(cherry picked from commit 20a77e973f62f145ab7b3a4822ce34407c0ca476)
2017-08-01 17:28:09 +00:00
Love Khanna
755a8fa44e NFC DTA Integration
Bug: 63903843
Test: compiles.
Change-Id: I07cbb321ffbdbe9d93d632c8a56f3bc53218e592
2017-07-20 22:15:39 +00:00
Love Khanna
ca26b128ea NCI2.0 update LF_T3T_PARAMETERS of 18 byte.
As per NCI2.0 LF_T3T_PMM is a part of LF_T3T_IDENTIFIER.
Since it is required for each LF_T3T_IDENTIFIER entry,
It can be taken from application.

Test: Compiles.

Change-Id: Icc168592c292d869a4c331dd28fe43b4d75c9a41
(cherry picked from commit e7ecebae11)
2017-07-06 11:57:42 -07:00
Love Khanna
68f719e196 AID suffix registration.
Test: compiles.

Change-Id: I0ab02599814722055d77eef29e734bfd45e8d1ee
(cherry picked from commit e910e8bf86)
2017-07-06 11:57:20 -07:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
TreeHugger Robot
1573489991 Merge "Make NFC AIDL callbacks oneway" into oc-dev 2017-05-31 00:26:37 +00:00
Ruchi Kandoi
03f9e978c1 Make NFC AIDL callbacks oneway
Test: Read NFC tags, Android Beam
Bug: 32288773
Change-Id: I6294ec29be2af8feb578e9bfd5e0770ad9c09cc0
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
(cherry picked from commit 5dc487d588)
2017-05-26 14:11:28 -07:00
Yuka Anami
c03eaa6853 Add ID_LENGTH field for Empty type record
If ID_LENGTH field is omitted from Empty Type record, it cannot be
detected as Ndef since the data is strictly checked by e3fc7d9954.
But it is not possible to create raw bytes of Empty Type record
which can meet this condition by using NdefRecord/NdefMessage.
To fix this issue, added ID_LENGTH field to Empty type record.

Bug: 38299566
Test: Write and read NDEF tag with empty type record
Change-Id: Idb58c80cf8562a8b314f4ddeccdc627dc0c6f5b4
(cherry picked from commit ef9d0a480ef72a4ff0de5b5afa3661cff81fd8b5)
2017-05-26 20:53:59 +00:00
Ruchi Kandoi
2b527ac293 nfc: First chunked NDEF record of TNF doesn't contain the type field
Test: CTS test passes
Bug: 34943312
Change-Id: I08f37ee76810f642b35ae8bde05ef0e2eff921e0
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2017-03-06 13:10:20 -08:00
Ruchi Kandoi
2ed0b48abb nfc: Make NDEF validation stricter
- Check if the MB is not set for any record apart from the first one.
- If the record is chunked, first record must contain the type

Bug: 20722275
Test: Manual; write raw NDEF messages to a tag
Change-Id: I3e73fc5163bbcd8a1f23417e98f57b665f4f1fad
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2017-01-25 18:21:28 +00:00
Martijn Coenen
5832df526f Merge "Adddress NFC API review comments." into nyc-dev am: 1fef88d8dc
am: 68b426a30d

* commit '68b426a30d964295360f32defc2b66e6b7247a93':
  Adddress NFC API review comments.

Change-Id: I00acef221305c4cb7aea75c842c1a758cccfb953
2016-05-17 18:39:50 +00:00
Martijn Coenen
68b426a30d Merge "Adddress NFC API review comments." into nyc-dev
am: 1fef88d8dc

* commit '1fef88d8dc8e25c71dc6b217202593e0f17b2105':
  Adddress NFC API review comments.

Change-Id: Ic36b9392b9475590ba8f75b352d05fba52b1ee02
2016-05-17 18:33:09 +00:00
Martijn Coenen
6136730e3b Adddress NFC API review comments.
Bug: 28775492
Change-Id: I01befba3435f0d882787fecabd3c1041fe7260d7
2016-05-17 09:09:15 +02:00
Martijn Coenen
2386212c05 Merge "Address API review comments." into nyc-dev am: 9a32929def
am: 1ffef9a239

* commit '1ffef9a239a67016607f62dfd023bf7fefb85370':
  Address API review comments.

Change-Id: I1f7da4c07988923b22bfab5689d48531cfb95aa1
2016-05-16 09:28:57 +00:00
Martijn Coenen
1ffef9a239 Merge "Address API review comments." into nyc-dev
am: 9a32929def

* commit '9a32929def3425c55a1bc96ea20346bf95357ae4':
  Address API review comments.

Change-Id: Ieb67cdc7846a06d84280e9ea9ca1cbe34dbff78f
2016-05-16 09:25:58 +00:00
Martijn Coenen
9a32929def Merge "Address API review comments." into nyc-dev 2016-05-16 09:18:36 +00:00
Steve Elliott
17750ae86e Merge "decouple HCE from FEATURE_NFC" into nyc-mr1-dev
am: b8eb2c5608

* commit 'b8eb2c5608b782d9bfc4a65625c353d79188a680':
  decouple HCE from FEATURE_NFC

Change-Id: If99fea76a8713bb4f77ffe38523501efc34b0882
2016-05-10 19:54:43 +00:00
Steve Elliott
04141eac6b decouple HCE from FEATURE_NFC
Allows getting an instance of NfcAdapter through
NfcAdapter.getNfcAdapter on a device which has
FEATURE_NFC_HOST_CARD_EMULATION(_NFCF) but not FEATURE_NFC.

All non-HCE APIs will throw an UnsupportedOperationException if accessed
without FEATURE_NFC.

Bug: 24532713
Change-Id: I95c0309d8eea46f592b3c713541a3ed6e0f96aef
2016-05-09 21:19:03 +00:00
Martijn Coenen
1b65983aa9 Merge "Fix API review comments, add remove callback." into nyc-dev
am: d19191d

* commit 'd19191d4dcdefeebe0409d65740ee006c9e8a6a2':
  Fix API review comments, add remove callback.

Change-Id: I9ae9906df2f8ab3fdeb6c3e84a31ba66dcc7ca44
2016-04-28 05:43:17 +00:00
Martijn Coenen
d19191d4dc Merge "Fix API review comments, add remove callback." into nyc-dev 2016-04-28 05:34:05 +00:00
Martijn Coenen
007e0292bc Address API review comments.
Bug: 28148563
Change-Id: I0b66cf6954bb7d31e76d1e6445a656abd316ebcd
2016-04-28 00:39:33 +02:00
Tobias Thierer
28532d0026 frameworks/base: Avoid Long object allocations in Long.valueOf()
Replace usages where the Long is immediately unboxed or thrown
away with Long.parseLong().
In TaskRecord.java, I also fixed up similar uses of
{Boolean,Integer}.valueOf()

Tested: built frameworks/base successfully.

Bug: 28289401
(cherry picked from commit 4bd017d6a5)

Change-Id: Icfa4708946e774f4a1bacf185c3fd11a7087017e
2016-04-22 13:36:53 +01:00
Trevor Johns
59c9a93fc2 Merge changes from topic 'merge_docs_nyc-dev' into nyc-dev
* changes:
  Remove links to createAndInitializeUser() and createUser()
  Resolve merge conflicts of a5060ee to nyc-dev
2016-04-20 18:35:57 +00:00
Trevor Johns
682c24e228 Resolve merge conflicts of a5060ee to nyc-dev
This undoes the automerger skip which occured in
commit e740c84dc3 and
replays it as a standard (NOT -s ours) merge.

Change-Id: If5a47be26f73d6a0735c425cd66310a3e2a89086
2016-04-19 02:03:59 -07:00
Narayan Kamath
a09b4d2a61 Remove unnecessary allocation+unboxing of objects.
Transforming String->int can be done with 0 allocations
using Integer.parseInt.

bug: 28078871
Change-Id: I8d9f322d7154728849dde61ef282046032858d60
2016-04-18 09:55:59 +01:00
Martijn Coenen
d55def8924 Fix API review comments, add remove callback.
Bug: 28148561
Bug: 26426491
Change-Id: I5917ea5d8fe0d3195b407643ec271ab4eb8b30b7
2016-04-15 22:14:07 +02:00
Jeff Sharkey
115d2c189a Add feature versions for devices and apps.
We're starting to see more instances of device features that will
increment separately from the SDK API level, such as camera HAL,
GPU capabilities, Bluetooth, and other hardware standards.

This change adds the ability for device features to specify a
version, which is defined to be backwards compatible.  That is, apps
requesting an older version of a feature must continue working on
devices with a newer version of that same feature.

When a version is undefined, we assume the default version "0".

Bug: 27162500
Change-Id: If890bf3f3dbb715e8feb80e7059a0d65618482ea
2016-02-15 17:45:42 -07:00
Martijn Coenen
6c89fa4988 Merge "Improve NFC-F transceive() docs." am: 1f4f7190a8
am: 21ab24f5c7

* commit '21ab24f5c7a1659981fab2764e406f51e9d3eada':
  Improve NFC-F transceive() docs.
2016-02-05 17:26:37 +00:00
Martijn Coenen
21ab24f5c7 Merge "Improve NFC-F transceive() docs."
am: 1f4f7190a8

* commit '1f4f7190a8fe6bd87fd9dd198cb711cb1a540354':
  Improve NFC-F transceive() docs.
2016-02-05 09:44:28 +00:00
Martijn Coenen
1f4f7190a8 Merge "Improve NFC-F transceive() docs." 2016-02-05 09:38:16 +00:00
Martijn Coenen
6711e02033 Improve NFC-F transceive() docs.
It wrongly said the SoD included the length;
put a sample frame in the docs to help devs.

Change-Id: I8ea74f37e7335f3e05f7df81fc303bf6195ac3cc
2016-02-05 10:26:16 +01:00
Martijn Coenen
f82ab8bea4 Merge "Implementation of HCE for NFC-F." am: e168012ff2
am: cf2f9d0966

* commit 'cf2f9d0966af01eb269b9ce6f2d08870647dd22f':
  Implementation of HCE for NFC-F.
2016-01-25 10:00:32 +00:00
Martijn Coenen
cf2f9d0966 Merge "Implementation of HCE for NFC-F."
am: e168012ff2

* commit 'e168012ff21408f8be85040bb4ac977061519f62':
  Implementation of HCE for NFC-F.
2016-01-25 09:56:20 +00:00
Martijn Coenen
e168012ff2 Merge "Implementation of HCE for NFC-F." 2016-01-25 09:48:43 +00:00
Yoshinobu Ito
c52adfe124 Implementation of HCE for NFC-F.
This impementation includes HCE(Host-based Card Emulation) for NFC-F
which emulates NFC Forum Type 3 Tag on a smartphone.

Signed-off-by: Daisuke Ito <DaisukeE.Ito@jp.sony.com>
               Yoshinobu Ito <Yoshinobu.Ito@jp.sony.com>

Change-Id: I1618a7fba801e0705ff3cc078206a1446b3dd56d
2016-01-22 18:14:18 +09:00
Martijn Coenen
3748600bad NFC: Allow apps to specify they're done with tag.
When an application is no longer interested in
communicating with a tag, but the tag is kept in
range of the device for a long amount of time, we
will burn a lot of power keeping the connection
to it alive.

Instead, allow the app to signal it's "done" with
the tag, which allows us to put the controller
in a low-power mode. This will save power in scenarios
such as an NFC tag embedded in a car dock or
wireless charging dock.

Bug: 26426491
Change-Id: I7a0149ede46e0c7610b06ed1776344b772677350
2016-01-18 14:53:28 -08:00
Neil Fuller
69c2907c63 Merge "Fix @code escapes"
am: b0d92f4717

* commit 'b0d92f4717af4e4736dc80b2a822dae8e5a52587':
  Fix @code escapes
2016-01-15 16:31:40 +00:00
Neil Fuller
9498e8a8d2 Fix @code escapes
The body of {@code} must not be HTML escaped. This is one of
several changes that fix the source in conjunction with a
doclava fix.

Bug: 25757239
(cherry-picked from commit 71fbb81b14)

Change-Id: I19dafddc6501be6fee362c396ac5bbdc934ae39d
2016-01-15 16:14:57 +00:00
Martijn Coenen
b325061b19 Merge "Clear calling identify b4 Beam callback." into mnc-dr1.5-dev am: 4bbd3c4819 am: c94df7c685
am: 68521a6825

* commit '68521a682524c53e6bfd883a3f41b4fe514c2d0c':
  Clear calling identify b4 Beam callback.
2015-12-23 00:33:26 -08:00
Martijn Coenen
24584f0b34 Clear calling identify b4 Beam callback.
Fixes AppOps crash, because it notices the calling
package is different from the calling UID.

Bug: 25492633
Change-Id: I55e2d975fd0a7ee94c4623efb3b19b1b54b72da2
2015-12-21 10:33:06 +00:00
Neil Fuller
71fbb81b14 Fix @code escapes
The body of {@code} must not be HTML escaped. This is one of
several changes that fix the source in conjunction with a
doclava fix.

Bug: 25757239
Change-Id: Ib38a0fa2dd2a3d68e467f78a812071e763d7e881
2015-12-02 14:24:11 +00:00
Martijn Coenen
a1ec958829 Fix missing copyright headers.
Bug: 23868522
Change-Id: I37fb86e3a751fad363d70687d1b9bcd512bcd33e
2015-09-07 11:53:59 +02:00
Nicolas Prevot
2ee3beedb1 Merge "In NfcActivityManager, don't use UserHandle.CURRENT." into mnc-dev 2015-07-02 12:28:46 +00:00
Robert Schaub
a50979997c am e51d6d05: am fae35eed: Merge "docs: Changed link in Java source code comment to repair 404" into mnc-preview-docs
* commit 'e51d6d05e9334fce5d46909ea669027762c4c0a2':
  docs: Changed link in Java source code comment to repair 404
2015-07-01 17:12:31 +00:00
Nicolas Prevot
81b7b10864 In NfcActivityManager, don't use UserHandle.CURRENT.
In the work profile, UserHandle.CURRENT refers to the primary user.
We want to refer to the work profile itself.
So, using new UserHandle(UserHandle.myUserId()) instead.

BUG:21960385
Change-Id: I4d880ccf6926e437d674874295029b29278f3e12
2015-07-01 12:27:09 +01:00