Commit Graph

178 Commits

Author SHA1 Message Date
Jack Yu
d01497a5de Fix "learn more" link is not clickable
Use function setLearnMoreAction instead of ClickableSpan in
NFC FooterPreference.

Bug: 226299551
Test: maunal test
Change-Id: I69c494b3e6fc92940d498d8be0c9ef5041b1bb3b
2022-03-28 22:42:45 +08:00
TreeHugger Robot
da591a4f76 Merge "Make NFC Setting summary text translatable" into tm-dev 2022-03-15 14:47:16 +00:00
Jack Yu
323606ee25 Correct null UserHandle handling for ACTION_CHANGE_DEFAULT
When there is no userhandle passed via Intent.EXTRA_USER,
use UserHandle.myUserId() instead.

Bug: 221561126
Test: set default payment in GPay app
Change-Id: I272aa6674b7a18523fe02fadeb4a502a67303ee7
2022-03-15 02:47:25 +00:00
Jack Yu
47bdc61116 Make NFC Setting summary text translatable
Add a string in resource xml for the work app summary text in the
default payment selection list.

Bug: 202369556
Test: manual test
Change-Id: Iec3f4bd47c641f3226506a5c49f1601cb24f613a
2022-03-14 11:45:19 +08:00
TreeHugger Robot
382cebc187 Merge "Refine NFC settings UX" 2022-02-15 14:45:04 +00:00
Treehugger Robot
11ac8ac28a Merge "Use Intent.EXTRA_USER for ACTION_CHANGE_DEFAULT" am: 57238d653c am: 1a16975a36 am: b7077ab55f
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1977698

Change-Id: Icc629addf9f47a48a0da14d105d737a7e9e1348c
2022-02-14 12:05:25 +00:00
Treehugger Robot
b7077ab55f Merge "Use Intent.EXTRA_USER for ACTION_CHANGE_DEFAULT" am: 57238d653c am: 1a16975a36
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1977698

Change-Id: I0196d39d1e8d619a54931492fc89f15b8b5dfc99
2022-02-14 11:49:04 +00:00
Jack Yu
1e9a9cdec4 Refine NFC settings UX
Adjust notification string when selecting a work app.
Use NFC banner instead of app icon.

Bug: 202367033
Test: manual
Change-Id: I4f1094b8d48bb60716a2bf648dff593186d707aa
2022-02-09 21:52:18 +08:00
Jack Yu
c7b568751e Use Intent.EXTRA_USER for ACTION_CHANGE_DEFAULT
Use Intent.EXTRA_USER to pass the UserHandle as the extra field of
ACTION_CHANGE_DEFAULT.

Bug: 215300017
Test: manual
Change-Id: I8862ae509638c7c264f49c4bc5753a65e8fdcfbc
2022-02-09 21:34:59 +08:00
Jack Yu
29e46bd01e Do not let guest user disable secure nfc am: a579ca7554 am: 1009054124 am: b85416796d am: 05dfb08c80 am: 147f4bc01d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16691815

Change-Id: Ibb578e5efdfffa772c785cb482de853a19faf0b7
2022-01-28 23:29:42 +00:00
Jack Yu
147f4bc01d Do not let guest user disable secure nfc am: a579ca7554 am: 1009054124 am: b85416796d am: 05dfb08c80
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16691815

Change-Id: Ib69851dd1d88fcba84af0cf940b6f949aab15355
2022-01-28 23:14:00 +00:00
Jack Yu
b85416796d Do not let guest user disable secure nfc am: a579ca7554 am: 1009054124
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16691815

Change-Id: I9879ba034ae2b8d7a964a4d6c9d700bad55b636e
2022-01-28 22:31:38 +00:00
Jack Yu
a579ca7554 Do not let guest user disable secure nfc
Bug: 209446496
Test: manual
Merged-In: I7253f7f08fde04e30400a30d9a0d24f1ceff04b0
Change-Id: I7253f7f08fde04e30400a30d9a0d24f1ceff04b0
(cherry picked from commit d9e3e6e4b1)
2022-01-22 07:56:25 +00:00
TreeHugger Robot
8a0d26dca7 Merge "Do not let guest user disable secure nfc" 2022-01-22 07:41:57 +00:00
Jack Yu
9de30f08e6 New UX for the NFC default payment settings
Re-design the UX.

Bug: 202367033
Test: maunal
      make RunSettingsRoboTests ROBOTEST_FILTER=NfcForegroundPreferenceControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=PaymentSettingsTest
Change-Id: I4c05ac4a1974645c76a37900d64aa8e1a491bca1
2022-01-21 10:25:09 +00:00
Jack Yu
d9e3e6e4b1 Do not let guest user disable secure nfc
Bug: 209446496
Test: manual
Change-Id: I7253f7f08fde04e30400a30d9a0d24f1ceff04b0
2022-01-19 10:43:10 +00:00
Michael Groover
911f7e7aa9 Add unaudited exported flag to exposed runtime receivers
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting T or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the T release.

Bug: 161145287
Test: Build
Change-Id: Ie97372efebd8258d9a4c503771d55109a85e6ae9
2021-12-09 20:34:02 -08:00
Jack Yu
9a0ab00ac4 Merge "NFC support in work profile" am: c2647199ce am: 79675e89f2 am: 3ccf7e29f8
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1856215

Change-Id: Ib97dd1b197a362258552a45d7d9b40565da96cb5
2021-11-22 11:23:29 +00:00
Jack Yu
79675e89f2 Merge "NFC support in work profile" am: c2647199ce
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1856215

Change-Id: Iac30f77fd5d732bb3b50fc531600fed02d477919
2021-11-22 11:00:16 +00:00
Jack Yu
2a2e0275cc NFC support in work profile
Configure NFC payment settings based on userId.

Bug: 202367033
Test: mauanl tests
Change-Id: I97e275f374d34618b64188d5de185ec6c527e0fd
2021-11-15 19:03:34 +08:00
Jason Chiu
026b1b5df6 Merge changes from topic "slice-highlight" into sc-v2-dev am: 6821b6be32
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16151654

Change-Id: Ib03d41631d8bf961fa3ff3957eb5452411da7792
2021-11-02 02:28:16 +00:00
Jason Chiu
2989c50a23 Add highlight menu keys for all toggle pref controllers and custom slices
Bug: 204695404
Test: manual, robotest build pass, unit
Change-Id: Iad2e28ada8ddb766ffa7eff2c8dc581250cbd6f8
2021-11-01 15:00:18 +08:00
TreeHugger Robot
9a573b1942 Merge "PaymentDefaultDialog Could be Overlaid" into sc-dev am: a2e975064e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15821792

Change-Id: Id94319ec70f89a5f153d4e7f6db9ed2cba036997
2021-09-30 19:05:51 +00:00
Alisher Alikhodjaev
b2c03474c4 PaymentDefaultDialog Could be Overlaid
Settings#PaymentDefaultDialog Could be Overlaid to Trick User into
Updating Default Payment App

Bug: 180104327
Test: build ok
Change-Id: Ia7786d05aae8e38a11bd73d02200640cb614e88a
2021-09-13 17:00:30 -07:00
Treehugger Robot
6eb3f3bf90 Merge "Support multi-users for NFC payments" am: 6eb702ed63
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1778405

Change-Id: I1f20e829bf513d8166458e1749bcc8c9fade07b2
2021-09-02 09:17:20 +00:00
Jack Yu
d2ca4038ce Support multi-users for NFC payments
Configure nfc payment settings based on different users.

Bug: 191851086
Bug: 191845397
Bug: 192994529
Test: nfc payment with 2nd user
      make RunSettingsRoboTests
      ROBOTEST_FILTER=DefaultPaymentSettingsPreferenceControllerTest
Change-Id: I52440e77b6b5837b978b381e1c1694d2b29f048e
2021-08-23 16:18:08 +00:00
Stanley Wang
10b7a7d483 Use MainSwitchPreference to replace the button style switches.
Fix: 177967926
Fix: 177968295
Fix: 177967925
Fix: 177968078

Test: Run robotest and apply the widget in Settings and see the ui
Change-Id: Ie854de96e5495fa564fb8a097ed4547bbd2b10c5
2021-02-02 08:39:37 +00:00
Stanley Wang
b87ddba6cd Use SettingsLib's MainSwitchBar to replace SwitchBar in Settings.
To log Settings metrics, the MainSwitch extends MainSwitchBar and
replace the SwitchBar in SettingsActivity.

Bug: 175181773
Test: Run robotest and apply the widget in Settings and see the ui

Change-Id: I3add3702e9058ad9192b5172c7cf0e2ccfb55a70
2021-01-14 22:48:31 +08:00
Toby Chuang
36b00c5e4f Merge "[NFC] Add a picture under NFC settings to show NFC detection point." into rvc-dev 2020-04-06 07:28:00 +00:00
Toby Chuang
204fa8a420 [NFC] Add a picture under NFC settings to show NFC detection point.
Each smartphone has a different NFC antenna detection point,
users would confuse where the NFC antenna is and how to place the
smartphone close to the card reader/equipment.

Starting from Android R device, we move NFC antenna position from
top area to middle center of the phone.

From the OEMs perspective, they could implement their own picture
to indicate the best NFC detection point.Hence, we propose to
show NFC antenna position under NFC setting.

Bug: 142230563
Test: build pass
Change-Id: Ib3cd7fc3ea299be1667aba0aeebaa148fb49015f
2020-04-06 13:37:31 +08:00
Robert Luo
2f4ebf9475 Refine NFC payment wording for "Set default" and "Update" scenarios.
Fixes: 149270345
Test: manual and check if new string is applied
Change-Id: I4d7591882489d3892020f8fa2f963f7c90ec79e4
2020-03-30 13:25:39 +08:00
George Chang
5920f62784 Update OWNERS file
Test: None
Change-Id: Ifa7045000ce578a611bb065cd821a87a54edd49c
2020-02-18 17:32:09 +08:00
Yi-Ling Chuang
430c16c012 Make some existing slices public.
Only PreferenceControllers with isPublicSlice() set to true are exposed
to other apps. Others will be Settings only.

Bug: 141088937
Test: robotests
Change-Id: I5934e89bc1b268fdd44acd630621fa46987728ff
2019-11-28 14:32:15 +08:00
Sunny Shao
3526f666a8 Fix the display abnormal of Tap & pay screen in landscape mode
- Add a new layout for the landscape mode.
- Update the logic to show image when has no any visible preference.

Bug: 141559275
Test: manual view
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.nfc
Change-Id: Ib59ad3347e0635c07d61d557d75f8feaf78ff23c
2019-10-03 18:56:36 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Raff Tsai
e80f67b94b Replace png file with vector drawable
Fixes: 139336138
Test: visual
Change-Id: I6fa504d406e4b9b37b8260ec9fb92f265e4a45da
2019-09-16 11:41:37 +08:00
Raff Tsai
1f30b1cd67 Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
2019-09-12 11:09:09 +08:00
George Chang
6ddff97414 Fix NFC state switched off every time user entered connection preferences page
NfcAirplaneModeObserver added a scenario that
switched NFC off every time  a user entered connection
preferences page if airplane mode was on.
Even when a user manually switched on NFC, the observer would still
turn NFC off when re-entering connection preferences page.

GSAM TS.27 certification requires NFC state to be consistent
under AirplaneMode before and after reboot the device.
NfcAirplaneModeObserver breaks the requirement
because it would always switch NFC off under airplane mode
when a user checked the NFC state in settings page.

Fix it by removing NfcAirplaneModeObserver.
Keep the NFC state consistent.


Bug:128384879
Test: make RunSettingsRoboTests / Check Nfc on/off Status
Change-Id: If4c8e47c2509b09e8bc1a464e1ab329b945e3d20
2019-06-06 17:53:02 +00:00
George Chang
55890aab55 Update OWNERS file
BUG: 65294119
Test: None
Change-Id: I7def59a9f2c475ed8df76d339d98cb82fe9512a2
2019-05-29 22:44:58 +08:00
TreeHugger Robot
af9ef0ef06 Merge "Update OWNERS for nfc folder." into qt-dev 2019-04-11 01:48:30 +00:00
Raj Mojumder
70907f547f Update OWNERS for nfc folder.
BUG: 65294119
Test: gerrit upload
Change-Id: I71e6e39c61862529198378228d793d3a6ba14139
Signed-off-by: Raj Mojumder <rmojumder@google.com>
Exempt-From-Owner-Approval: Invalid owners.
2019-04-10 22:30:00 +00:00
Jack Yu
7b95c5d217 Correct SecureNfc behavior in setting page
1. String under SecureNfc should update immediately when NFC toggle
2. SecureNfc state should remain the same after NFC toggle

Bug: 129037278
Test: Toggle NFC/SecureNfc option and check behavior
Change-Id: I9cbac4951f0c70accd92c43fc62658cb5dbb5c9b
2019-04-09 21:29:11 +08:00
Ruchi Kandoi
d5ba12a94d Update Secure NFC API definitions
Bug: 124767797
Test: None
Change-Id: I90f109f08771f429966cd108eaacdf8b81d0a72e
2019-03-06 08:29:38 -08:00
Matthew Fritze
9e50419c75 Remove NFC Slice jank
The NFC Slice would jank on enable and disable, because of the
intent filter it registered with SysUI. The intent filter would
broadcast an update for four states:
1) On
2) Off
3) Turning On
4) Turning off

The first two caused no problems. The third and fourth caused jank,
since when clicked, the switch in the NFC slice would turn on / off
asynchronously - that is, it turned on or off based on the previous
state of the switch, rather than on the actual value of NFC. It does
this to feel fluid in the app in which it is rendered.

From the off state, the order of events is:
1.  Switch clicked
2.  Switch animates on
2.  Background intent is fired to settings to turn on Nfc (happens at
       the same time as animation)
3.  Settings calls the NFC enable API
4.  A broadcast for Turning On is sent
5.  The receiver in SysUI gets the broadcast and forwards it to settings
6.  Settings tells the Slice to make sure it is up to date
7.  The Slice checks for the current value - IMPORTANTLY - which is
        currently off, it is only in the process of being enabled.
8.  The Slice flips back off
9.  Nfc finishes getting enabled in the background
10. The framework pushes the NFC ON broadcast
11. SysUI gets the broadcast, and forwards it to settings
12. Settings tells the slice to update
13. The slice checks again and finds that NFC is on, flipping on.

This CL creates a new background slice worker for NFC and registers
the intent filter there, rather than in SysUI. When the background
worker gets the broadcast, it checks if it is in state 3/4, and if so,
it drops the update silently.

Fixes: 115737701
Test: robotests
Change-Id: I17043828ad3a67a2a5acdf5c75d9cc51ff7e91d0
2019-02-26 08:20:38 -08:00
George Chang
8adb77fd3d Replace Banner with App Title Text
Bug: 123719839
Test: switch different payment
Change-Id: Ica90394bf5d5d0062403f2a0888c56072fdce7ee
2019-02-18 16:38:07 +08:00
Fan Zhang
7db118e367 Mass clean up: don't cast class when not needed.
Bug: none
Test: rebuild
Change-Id: Ie3f58a3d5ae99ade28a33dcac80c18de90d4d5b2
2019-02-14 12:26:09 -08:00
Ruchi Kandoi
5bf4e1ec4f Add Secure NFC functionality
Secure NFC will permit NFC acitvity only when screen
is unlocked.

Bug: 117253725
Test: Manual; Toggle switch; check if HCE works with screen off
Change-Id: I9977d85065fc7ebca3ed4991ffa52fef0590cf90
2019-01-29 16:33:46 -08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Ruchi Kandoi
8b14531569 Don't start Android Beam Activity if feature is not supported
Test: manual; application using NFCSHARING intent
Bug: 117519147
Change-Id: I2caa881c73e3d5976b7b2666351e773e504a8925
2019-01-15 00:29:12 +00:00