Commit Graph

444 Commits

Author SHA1 Message Date
Omer Ozer
5bcb0c9f66 Merge "Fixing comments on AvailableNfcAntenna" am: b55d142b23 am: 4bf9ebdde2 am: 8504c79dc3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2321793

Change-Id: Ie1927c1388cf3122d0c9cef36678d808059b2290
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 20:42:35 +00:00
Omer Ozer
4bf9ebdde2 Merge "Fixing comments on AvailableNfcAntenna" am: b55d142b23
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2321793

Change-Id: Idb846337a57dd484441f4cf5f3672ed079d6365e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 19:31:40 +00:00
Omer Ozer
e050317bfd Fixing comments on AvailableNfcAntenna
Bug: 260828096
Test: manual
Change-Id: I865d7f2b1f32adee2bfb90126c081affd405be26
2022-12-01 17:50:11 +00:00
Omer Ozer
f2be8357ab Merge "AIDL and java files for NfcAntenna Location Api." am: 4a76e9c038 am: 812fbd26e8 am: 43a62fac7a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2254046

Change-Id: Ic00828dfe3b285286bb4bfd5bccb25e8544cbce8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-21 03:57:49 +00:00
Omer Ozer
812fbd26e8 Merge "AIDL and java files for NfcAntenna Location Api." am: 4a76e9c038
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2254046

Change-Id: Ia9492bdd38fbcb0753c5e44bfbbadf74768952eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-21 02:58:52 +00:00
Omer Ozer
43c4ff6c71 AIDL and java files for NfcAntenna Location Api.
Test: Manual test
Bug: 241447186
Change-Id: I32c51f4fc54624e5d2600bf2b146775f986eb8f0
2022-11-19 01:00:41 +00:00
Alisher Alikhodjaev
eedc274533 Merge changes Ifcde87f4,Ie0606e5d am: f2d204c793 am: 6411fd0015 am: 0016176d24
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2264526

Change-Id: I6fcd10981d5685eb81f5d792fc54a17e56f6be65
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-12 01:05:43 +00:00
Alisher Alikhodjaev
6411fd0015 Merge changes Ifcde87f4,Ie0606e5d am: f2d204c793
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2264526

Change-Id: Ie1fc56275d98e4a0e9114cae20ee71a274053274
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 23:50:03 +00:00
Alisher Alikhodjaev
a8c470fb71 Use waitForService() istead of getService()
SystemManager.waitForService() is a system interface

Bug: 244264995
Test: read a tag, on/off
Change-Id: Ifcde87f4021238b4ebc67466f2d9b2e363586707
2022-11-09 13:31:23 -08:00
Alisher Alikhodjaev
ecdc6a3e7d Get PackageManager from Context
The ActiveThread.getPackageManager() is a hidden API

Bug: 244264995
Test: build ok
Change-Id: Ie0606e5dc2e3eb6e24694ff280aa234fd1a79bcb
2022-10-27 15:45:40 -07:00
Alisher Alikhodjaev
acf44dff45 Merge "Replace usages of Context.getUserId() by Context.getUser()" am: 8648e4fa22 am: b26b51709d am: 8b21320077 am: ca4cbcc510 am: 0115369522
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2232553

Change-Id: Ice1e618abcffa8578f59a2e657be37dfc751b99c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-30 03:53:11 +00:00
Alisher Alikhodjaev
0115369522 Merge "Replace usages of Context.getUserId() by Context.getUser()" am: 8648e4fa22 am: b26b51709d am: 8b21320077 am: ca4cbcc510
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2232553

Change-Id: I4e4244e9f37883811b710ad533adb797f0f38673
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-30 03:23:35 +00:00
Alisher Alikhodjaev
e564fa2997 Replace usages of Context.getUserId() by Context.getUser()
The former is a hidden API, the latter isn't.

Bug: 244264995
Test: build ok
Change-Id: Ie68aa00452cec96339c016634515593820243896
2022-09-26 21:43:48 -07:00
Hani Kazmi
4f221e5c51 Migrate Bundle/Intent APIs to new, type checked, variants
Part of go/safer-parcel. Follow up to ag/16639043. Migrates the following unsafe APIs:

* Parcel.readArray()
* Parcel.readParcelableArray()
* Bundle.getSerializable()
* Bundle.getParcelable()
* Bundle.getParcelableArrayList()
* Bundle.getParcelableArray()
* Bundle.getSparseParcelableArray()
* Intent.getSerializableExtra()
* Intent.getParcelableExtra()
* Intent.getParcelableArrayExtra()
* Intent.getParcelableArrayListExtra

Bug: 227458983
Test: m and presubmit pass
Change-Id: I72f206cb18eb5c669a7fff07a6845bed1c433fdb
2022-07-01 10:53:53 +00:00
chloedai
90d2c04d98 Assign the nonce from NfcService while contructing a Tag object
1. Remove nonce setting method from AIDL, only NfcService could generate
nonce
2. NfcService directily assign a nonce to Tag object while contructing

Bug: 199291025
Test: test with some reader apps, test pass
Change-Id: I0cf3d22a785b463589f1ba9bd3ca49825839b9ce
Merged-In: I0cf3d22a785b463589f1ba9bd3ca49825839b9ce
2022-05-24 08:51:50 +00:00
chloedai
46f1dd6534 Assign the nonce from NfcService while contructing a Tag object
1. Remove nonce setting method from AIDL, only NfcService could generate
nonce
2. NfcService directily assign a nonce to Tag object while contructing

Bug: 199291025
Test: test with some reader apps, test pass
Change-Id: I0cf3d22a785b463589f1ba9bd3ca49825839b9ce
2022-05-20 10:51:19 +00:00
Chloe Dai
e733e5a379 Merge changes from topic "Backport: tag availability checking mechanism" into sc-v2-dev-plus-aosp am: 40a364f284
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17046201

Change-Id: I14e5e6e0b7bd6d8333ed8d35557ff3dcf7d01fbf
2022-03-08 02:40:03 +00:00
chloedai
aab937aba8 [automerge] Add null checking to fix NullPointerException while creating mock tag 2p: d52c4c3e83
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17046201

Bug: 221452261
Change-Id: Ibd6b72aba6b8755d38524cda66ed5fce0f4c8aab
2022-03-07 03:08:43 +00:00
chloedai
d52c4c3e83 Add null checking to fix NullPointerException while creating mock tag
Bug: 221452261
Test: Test pass
Change-Id: Ie64df0d8d291468b258f92524af10da504c7dade
Merged_In: Ie64df0d8d291468b258f92524af10da504c7dade
(cherry picked from commit dbdc1bd3c7)
2022-03-07 03:08:33 +00:00
Presubmit Automerger Backend
cea18d7f27 [automerge] Add tag availability checking mechanism 2p: 113f3a4a1d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16730930

Bug: 199291025
Change-Id: Ib99e5fe19b020154867910bbaeb513be277a81cd
Merged-In: Iabaab1f6d2d22e15966d31dd79099369d828f4c6
2022-03-07 03:08:20 +00:00
chloedai
113f3a4a1d Add tag availability checking mechanism
Set a cookie to the tag objects when they are constructed, the
cookie could be used to check the availability before returning
the tag service

Bug: 199291025
Test: test with some reader apps, test pass
Merged-In: Iabaab1f6d2d22e15966d31dd79099369d828f4c6
Change-Id: Iabaab1f6d2d22e15966d31dd79099369d828f4c6
2022-03-07 03:08:06 +00:00
Treehugger Robot
82fb1ea0c2 Merge "Add an optional extra field description for ACTION_CHANGE_DEFAULT" am: 2b65ebc340 am: 8f7978d676 am: c65ee54bcb am: 43fb9c1dd2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2000590

Change-Id: Ic4749e1bfecafaf5cba2e488a2195dfea6df47b1
2022-03-03 03:46:42 +00:00
Treehugger Robot
43fb9c1dd2 Merge "Add an optional extra field description for ACTION_CHANGE_DEFAULT" am: 2b65ebc340 am: 8f7978d676 am: c65ee54bcb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2000590

Change-Id: Ia8749bb7d273af93c310a10e101511ec2db0fbd7
2022-03-03 03:36:59 +00:00
chloedai
dbdc1bd3c7 Add null checking to fix NullPointerException while creating mock tag
Bug: 221452261
Test: Test pass
Change-Id: Ie64df0d8d291468b258f92524af10da504c7dade
2022-03-03 03:55:47 +08:00
Jack Yu
a053fa8d46 Add an optional extra field description for ACTION_CHANGE_DEFAULT
Add the description using Intent.EXTRA_USER to pass the UserHandle of
the user that owns the app.

Bug: 215300017
Test: build pass
Change-Id: Ieeaf0876b19cae60743cbf279e5c937a457165c9
2022-03-01 03:05:40 +00:00
Treehugger Robot
a1d64e1394 Merge "Remove EXTRA_USERID from NFC CardEmulation" am: 1a11b7b5d5 am: f5d51cb655 am: 37e2084dce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1984767

Change-Id: I34632e1f8ba0d71f36dd10dfef95c8fa6dc89fc2
2022-02-22 02:50:09 +00:00
Jack Yu
c5942cc293 Remove EXTRA_USERID from NFC CardEmulation
Based on suggestion, use existing Intent.EXTRA_USER to pass the UserHandle
as the extra field of ACTION_CHANGE_DEFAULT.

Bug: 215300017
Test: manual
Change-Id: I15c5032f0229e8049fa1ef3741638974189ac3cf
2022-02-15 13:54:44 +08:00
Chloe Dai
dda723993a Merge "Add tag availability checking mechanism" 2022-01-26 02:58:10 +00:00
chloedai
49f7afe68b Add tag availability checking mechanism
Set a cookie to the tag objects when they are constructed, the
cookie could be used to check the availability before returning
the tag service

Bug: 199291025
Test: test with some reader apps, test pass
Change-Id: Iabaab1f6d2d22e15966d31dd79099369d828f4c6
2022-01-20 06:23:41 +00:00
Bernardo Rufino
1a5cb387d6 Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 331be9a643.

Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).

Original commit message:

Migrate unsafe parcel APIs in framework-minus-apex

Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
2022-01-19 11:13:18 +00:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Jack Yu
fd53b477cd NFC-F support in work profile
Add one function to get NfcF service based on user id.

Bug: 202367033
Test: mauanl tests
Change-Id: I15f3ef84198b0af40d33fd16f457fb9b6cb7ca32
2021-11-04 12:47:51 +00:00
Jack Yu
c39a7ac618 NFC support in work profile
Add new constant userId extra for ACTION_CHANGE_DEFAULT.

Bug: 202367033
Test: mauanl tests
Change-Id: I4ce95f3939a8bb80b77926f111f34d084be8fb3e
2021-10-29 08:00:29 +00:00
Jack Yu
2341866fec NFC support in work profile
Add one function to get service based on user id.
Add one function to set deafult for next tap based on user id.

Bug: 202367033
Test: mauanl tests
Change-Id: Ib5bd36528c0d398215b078dbbd4f19305ce1402c
2021-10-29 07:59:58 +00:00
George Chang
0e61ff0344 Merge "Fix getSelectionModeForCategory" am: be74a9f6ba am: 057beb9bda
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1719130

Change-Id: Ieeee702d0a3dd1f55151354ab2f04ba1f1885572
2021-05-27 17:54:41 +00:00
George Chang
b039c1fa4f Fix getSelectionModeForCategory
NFC_PAYMENT_DEFAULT_COMPONENT is not accessable for market apps
Check if default payment name already registered in settings by NfcService.
Add a new AIDL interface isDefaultPaymentRegistered in INfcCardEmulation.aidl

Bug: 189178386
Test: atest CtsNfcTestCases
Merged-In: I0a09c9763d39c8e0b9b28df85603bdc7f281669d
Change-Id: I0a09c9763d39c8e0b9b28df85603bdc7f281669d
2021-05-26 16:27:38 +00:00
George Chang
4366d81730 Fix getSelectionModeForCategory
NFC_PAYMENT_DEFAULT_COMPONENT is not accessable for market apps
Check if default payment name already registered in settings by NfcService.
Add a new AIDL interface isDefaultPaymentRegistered in INfcCardEmulation.aidl

Bug: 189178386
Test: atest CtsNfcTestCases
Change-Id: I0a09c9763d39c8e0b9b28df85603bdc7f281669d
2021-05-26 18:17:40 +08:00
Treehugger Robot
198741831a Merge "Update register and unregisterControllerAlwaysOnListener" am: 16019ad77d am: 925778283c am: 270ca9b85e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1686685

Change-Id: Ib847254e7ccf35aa0050bcb1893fa9924899af97
2021-04-28 04:47:19 +00:00
George Chang
3b317f9134 Update register and unregisterControllerAlwaysOnListener
Don't register listener if Nfc ControllerAlwaysOn is not supported

Bug: 186172688
Test: atest NfcManagerTests
Test: atest android.permission.cts.NfcPermissionTest
Change-Id: I0e2a4ad372754c56f72296fdbaed8c98c06e1c56
2021-04-26 23:04:55 +08:00
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