Commit Graph

404 Commits

Author SHA1 Message Date
George Chang
b1031e1054 Merge changes from topic "nfcc_aon_listener" am: 2195e2b514 am: 2f336d3401 am: e3cba3971a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669508

Change-Id: I3a234b2714f8254df7f4082b909b1f960b5d03f7
2021-04-15 17:14:40 +00:00
George Chang
84ca324df6 Update ControllerAlwaysOnStateCallback to ControllerAlwaysOnListener am: 78fad0d6d3 am: 9aa1fc83e5 am: 5293a03622
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675631

Change-Id: Ib6e7a448fcc62cc9af7600a2fb8df640ee7e9606
2021-04-15 17:14:23 +00:00
George Chang
60c693aa8d Add NfcManagerTests
Bug: 184837312
Test: atest NfcManagerTests
Change-Id: I1838a8232a34d9b2f35941408c499f59c68aa5e7
2021-04-15 02:24:16 +08:00
George Chang
78fad0d6d3 Update ControllerAlwaysOnStateCallback to ControllerAlwaysOnListener
Bug: 182979907
Test: atest NfcNciInstrumentationTests
Test: atest android.permission.cts.NfcPermissionTest
Change-Id: Iba0e3881b1bdb7ce080c15ae52f454912dc66ec9
2021-04-15 02:23:34 +08:00
George Chang
a613e853de Merge "Add callbacks to indicate NFC setControllerAlwaysOn state changed" am: cfc798e793 am: c5e292c9aa am: 9ef0cdbbc3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1657764

Change-Id: I64403a77aa63acb4cf0b35f6b72e82c518fa8040
2021-04-07 13:09:50 +00:00
George Chang
3562c9a505 Add callbacks to indicate NFC setControllerAlwaysOn state changed
remove unused android.nfc.action.ALWAYS_ON_STATE_CHANGED broadcast

Bug: 182979907
Test: atest NfcNciInstrumentationTests
Change-Id: I1032ee16d4d4e3f9d1b0c84f33ac70264ecda2b3
2021-04-01 21:36:57 +08:00
George Chang
03259bf7a4 Merge changes from topic "update_NFCC_Always_on" am: 7b7b809587 am: 6a6d92ff09 am: f5dcd90370
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1655107

Change-Id: I57b2db68bb05750718298d776ba2d365bea44a8b
2021-03-30 03:59:15 +00:00
George Chang
5052189dd8 Update SetAlwaysOn to SetControllerAlwaysOn
Bug: 182979907
Test: atest NfcNciInstrumentationTests
Change-Id: I6b794259ec597e5d7f86e94705017b8fe169a102
2021-03-28 22:20:52 +08:00
George Chang
abd045e95c Add new permission to set NFC always on states
Bug: 182979907
Test: atest NfcNciInstrumentationTests
Change-Id: I9a82c37f0b6716e68dc4c2d7e0f171d892f09112
2021-03-28 22:06:34 +08:00
Jack Yu
3c2fc6f742 Add attr for nfc applications to configure support power states
Use requireDeviceUnlock and requireDeviceScreenOn to configure the power
state for the AIDs of the nfc applications.

Bug: 171460473
Test: build pass
Merged-In: I03bd537082117e595a7badfb2d8ca6ee7cae08cf
Change-Id: I03bd537082117e595a7badfb2d8ca6ee7cae08cf
2021-02-01 06:41:04 +00:00
Treehugger Robot
d687007f8b Merge "Added setAlwaysOn feature" am: 66e56014df am: 0eda082f6a am: 2baabee7bb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1477323

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I92a8bf54ce320942e83563b5fc16fc7ea6198510
2021-01-20 20:32:58 +00:00
Treehugger Robot
387a6e35ce Merge "Fix typo in comment in android/nfc/tech/Ndef.java" am: 87bc42389d am: d7788c1cd5 am: b7640bf2ed
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554496

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iff58656da800f3429ec91e3e3d5a48f01bfd9fe3
2021-01-20 20:31:31 +00:00
Treehugger Robot
66e56014df Merge "Added setAlwaysOn feature" 2021-01-20 19:13:43 +00:00
George Chang
17d77b41f6 Merge "Add REQUIRE_UNLOCK_FOR_NFC broadcast to notify SystemUI" am: c76df1366c am: 8feaa187be am: 8418eaba20
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552500

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4bf7335e312a59346842a1c503e2fce5ac198b17
2021-01-20 18:54:13 +00:00
Treehugger Robot
87bc42389d Merge "Fix typo in comment in android/nfc/tech/Ndef.java" 2021-01-20 18:53:40 +00:00
Jakub Pawlowski
90dc908098 Fix typo in comment in android/nfc/tech/Ndef.java
Bug: 150104448
Test: none
Change-Id: I4a0c2c8020d42396e5a142d93d24d754a5b32930
2021-01-20 10:38:54 +01:00
George Chang
a0f9f4b73b Added setAlwaysOn feature
Add setAlwaysOn() system api.
This API is used to request that the NFC service
shall kept controller state on.

Add isAlwaysOnEnabled() system api.
This API is used to check setAlwaysOn is enabled or not.

Add isAlwaysOnSupported() system api.
This API is used to check setAlwaysOn is supported or not.

Bug: 176212892
Test: manual
Change-Id: If7ece9730c57838d870bb70cb2725919e75ef6c2
2021-01-20 03:18:06 +00:00
George Chang
994b5753c1 Add REQUIRE_UNLOCK_FOR_NFC broadcast to notify SystemUI
Bug: 177041874
Test: manual
Change-Id: I1ba9bac867fae8d3d22eb895acbe0f46cb8d76a0
2021-01-17 14:38:56 +00:00
Jack Yu
ad9223f687 Add attr for nfc applications to configure support power states
Use requireDeviceUnlock and requireDeviceScreenOn to configure the power
state for the AIDs of the nfc applications.

Bug: 171460473
Test: build pass
Change-Id: I03bd537082117e595a7badfb2d8ca6ee7cae08cf
2020-12-16 19:52:43 +08:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
Treehugger Robot
da4c23ba01 Merge changes Ifcb0f60e,I09ecdff9 am: 5bc68e02a0 am: 6f4a8baa7a am: 00f3d0f52b am: 149c95c766
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1498599

Change-Id: Ie5a84ef28e386e6f7d44171b0376ae5ff646a9eb
2020-11-18 04:45:14 +00:00
Jack Yu
3217255a4d Nfc adapter randomly returns null on devices having Nfc
Try to get NfcAdapter from NfcManager only when nfc service interface is
ready.

Bug: 173184157
Test: manaul test
Change-Id: Ifcb0f60e23f01cafd8b6b5f6bc8522773ece23a6
2020-11-13 18:34:42 +08:00
Jack Yu
cb2a677767 Improve NfcAdapter APIs to report correct nfc state
For enable and disable and state checking APIs, retry once if we found
nfc service is dead.

Bug: 173077348
Test: manual tests
Change-Id: I09ecdff9b0b7071569a854e7ace42a46b62a464f
2020-11-12 12:07:38 +08:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Automerger Merge Worker
02e6db0e4d Merge "Update preferred payment related APIs" am: d9b1353771 am: cde012199e
Change-Id: I46d98fcd989d4ea5d8ad8d7414bf86a8358ebfa8
2020-03-11 07:48:46 +00:00
Jack Yu
d70879e5bb Update preferred payment related APIs
Add API docs for ACTION_PREFERRED_PAYMENT_CHANGED and the constants(PREFERRED_PAYMENT_*).
Change return type from String to CharSequence for
getDescriptionForPreferredPaymentService.

Test: build pass
Bug: 149998286
Change-Id: Ibe0c77bb25da2673cc8f46cd1e2735c0a1e30523
2020-03-11 02:51:25 +00:00
Mike Ma
5313cbcb1b Core proto definition for "dumpsys nfc --proto"
Add NfcServiceProto for protobuf dumpsys of nfc service. Primarily used
by incident service to capture an incident report proto.

Command to invoke (any of the following after lunch and env setup):
$ adb shell dumpsys nfc --proto
$ adb shell incident 3052
$ incident_report 3052

Bug: 146086108
Exempt-From-Owner-Approval: Owners not reachable.
Test: Execute the above commands and compare the output against dumpsys
      nfc.

Change-Id: I024e148d64ccef5441a67efcbad95c622e5df12a
2020-02-17 15:34:36 -08:00
George Chang
3eb265ae00 Throw IOException on multiple connects.
Only one TagTechnology can be connected at a time.
Other calls to connect() will return IOException.

Bug: 144398423
Test: check error on multiple connects
Change-Id: I19a5f33c7f0d3e7592fe7791c1e04ddc2c9d6125
2020-01-21 23:46:05 +00:00
Artur Satayev
bc3d8b9071 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I534e3fd1305e2f4af076986770033478448a665c
Merged-In: I534e3fd1305e2f4af076986770033478448a665c
2020-01-13 12:39:59 +00:00
Jack Yu
2dbf394181 Provide APIs to get preferred payment service information
Provide APIs to get current preferred payment service information:
1. AID list
2. RouteDestination
3. Description
APIs would be guarded by a new permission.

Bug:139790381
Test: Build pass
Change-Id: I1a4fff5fee58f6e5d6727319cff9ad90e55fc767
2019-12-12 20:08:18 +08:00
Akinobu Nakashima
f18917783c Merge "Fix backward compatibility when there's no secureElementName"
am: 24ae670b4e

Change-Id: I963ccde31ca834bf4fec47e4dca05dcce1d1c4e2
2019-08-27 09:57:56 -07:00
Akinobu Nakashima
90690d2a8b Fix backward compatibility when there's no secureElementName
secureElementName can be unspecified in xml file.
If secureElementName is not specified, offHostName is null.
Then ApduServiceInfo#isOnHost returns true even if it is off-host
because mOnHost is wrongly set to true.

Test: manual
Bug: 137916987
Change-Id: I52ad1f09d3733fc435a937397fc9a433bd630a46
2019-08-06 13:15:29 +00:00
Ruchi Kandoi
6cc1ebe1e6 Update Secure NFC API definitions
Bug: 124767797
Test: None
Merged-In: If78d90fdc0a24d5f44bbb582f388a9c60b12786c
Change-Id: If78d90fdc0a24d5f44bbb582f388a9c60b12786c
2019-06-12 11:16:08 +00:00
Jack Yu
dbca60beb9 Update Multi-OffHost related API definition
Test: build pass
Bug: 128831640
Change-Id: Ia0a8ec38b0c4e60df18f727b0f5a7fdba84fe9e1
2019-04-16 16:55:07 -07:00
Jack Yu
c48f223018 Update Multi-OffHost related API definition
Test: build pass
Bug: 128831640
Change-Id: Ia0a8ec38b0c4e60df18f727b0f5a7fdba84fe9e1
2019-04-16 15:45:20 -07:00
Ioannis Ilkos
2b6277245a Add statically built regex pattern to avoid rebuilding all the time
Bug: b/129682219
Change-Id: I4a94c641d99964bed96ecb1725b84c8a9331879d
Test: Build, treehugger
2019-04-02 09:23:19 +00:00
Jack Yu
c4d52632e8 Merge "Update Android Beam deprecated API description" am: 527b6de018 am: 8b855b16f3
am: 862152f8cd

Change-Id: I0ddd6f1bffc709ffe93e194cd38996758cf48484
2019-03-27 19:09:38 -07:00
Jack Yu
65b438b07a Update Android Beam deprecated API description
Bug: 127532226
Test: None
Change-Id: Id3a769c4cf97bbaee751fd5dc0831bdc5993ef50
2019-03-25 06:29:55 +00:00
Ruchi Kandoi
5e72196be3 Merge "Add @NonNull annotations to (un)setOffHostForService()" am: 78366e46b2 am: 049cd3b67e
am: 0baada5d2a

Change-Id: I207de7be71246830bbf01e0c6b126892997ccadc
2019-03-08 06:42:19 -08:00
Treehugger Robot
78366e46b2 Merge "Add @NonNull annotations to (un)setOffHostForService()" 2019-03-07 20:07:16 +00:00
Ruchi Kandoi
3b2e5c3d02 Merge "Update Secure NFC API definitions" 2019-03-07 18:44:52 +00:00
Ruchi Kandoi
2d09e5c41f Update Secure NFC API definitions
Bug: 124767797
Test: None
Change-Id: If78d90fdc0a24d5f44bbb582f388a9c60b12786c
2019-03-05 10:17:54 -08:00
Ruchi Kandoi
4480f2592e Add @NonNull annotations to (un)setOffHostForService()
Test: None
Bug: 126699330
Bug: 126701964
Change-Id: Id8edf1720ee391d51eef70daeba63133c1efb339
2019-03-04 14:42:32 -08:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00