Commit Graph

151 Commits

Author SHA1 Message Date
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
Ruchi Kandoi
aea07dc98a Add metric for Tap & Pay Foreground Setting
Bug: 111458041
Test: atest NfcForegroundPreferenceControllerTest
Change-Id: I090c223b65858535cc70e61820dc5d077de99a40
2019-01-11 15:21:16 -08:00
Ruchi Kandoi
8925004b51 Merge "Add support for FEATURE_NFC_ANDROID_BEAM" am: 6827785e52 am: 39845367ab
am: a7c886925f

Change-Id: I08ff3b1bd80e913aeec9800b1c5ddce69543ba3c
2019-01-04 14:19:23 -08:00
Ruchi Kandoi
b7251fa693 Add support for FEATURE_NFC_ANDROID_BEAM
Test: Check if app shows the Toggle switch
Bug: 117519147
Change-Id: I395653dd977dc9b149fc343b533d15df71affaf1
2018-12-18 16:08:43 -08:00
Philip P. Moltmann
e3f721132a RestrictedLockUtils was split into ...Internal
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.

This causes a lot of trivial code changes.

I also updated the ordering of the imports in all affected files.

Bug: 110953302
Test: Built
      make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
2018-08-30 08:11:39 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Aurimas Liutikas
b1af85d155 Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
Merged-In: I941dea40562170649bf056e675cc32e5163c0e39
(cherry picked from commit a290b873d0)
2018-08-28 11:48:56 -07:00
Ruchi Kandoi
37efa64d63 Fixes Settings app crashing when NfcAdapter is null
If a device doesn't support NFC then
android.settings.NFCSHARING_SETTINGS and
android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT intents shouldn't
do anything and gracefully exit.

Test: Manual; Emulate a non-NFC device and test with apks sending intents
Bug: 80094104
Bug: 80092438
Change-Id: I5b3c3fdd582679e2cb16f474ef3331bc246b0d42
2018-08-01 13:35:18 -07:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -07:00
Fan Zhang
af1552251f Add some pages to search index.
* Notification access page
* VR Listener page
* Feature flags in dev options
* QS Tile developer options
* User dictionary
* Billing cycle
* Some accessibilty pages

Bug: 70720645
Test: robotests
Change-Id: I4f7d3d65b2803cebf178ac345a79721232df707c
2018-07-11 16:39:29 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Doris Ling
6776da1cad Do not turn on NFC automatically when airplane mode is off.
- besides checking the value for AIRPLANE_MODE_TOGGLEABLE_RADIOS, also
check the value for AIRPLANE_MODE_RADIOS to determine if we should turn
off NFC when airplane mode is on.
- when user turns off airplane mode, only re-enable the NFC preference
and do not enable NFC by default.
- remove listening to airplane mode directly from the android beam
preference controller, as it is already listening to Nfc state, which
handles the beam state already.

Change-Id: Id41fef15fb2de873729d20d7f53b1a88b164cf95
Fixes: 80217047
Test: make RunSettingsRoboTests
2018-06-13 13:44:15 -07:00
Andre Garivay
6d48242da7 Removed guest user access to Tap & Pay via Search.
Gathered user info to verify that user is not a guest. If user is a
guest (and only a guest: other alternate users may use the feature),
they are not allowed to load the nfc_payment_settings xml file.

Change-Id: I5700b9cd4b639b031b6d464827d16f4ea4cfa03f
Fixes: 80111261
Test: Robotests
2018-06-01 09:57:23 -07:00
hjchangliao
51ea41a541 Update Android Beam screen layout
Use preference footer layout to replace
the old layout android_beam.

Change-Id: I878333ecc001631020706cb02edde48496859dcb
Fixes: 80085332
Test: Manual test
2018-05-28 11:27:26 +08:00
Chihhang Chuang
6719a9b73e Refactor nfc preference controller
- Remove BaseNfcPreferenceController.
- NfcPreferenceController inherit from TogglePreferenceController.
- AndroidBeamPreferenceController inherit from BasePreferenceController.
- Override getIntentFilter in NfcPreferenceController to listen changes.
- Add an API (hasAsyncUpdate) into BasePreferenceController to
distinguish the setting which is updated asynchronously.

Change-Id: I1abe4410169e305a0d6106e24c54e7f2e763fc91
Merged-In: I7c9c48ea7f1ad01a02524beabf9d30baa3db891f
Fixes: 67997761
Fixes: 74887543
Test: RunSettingsRoboTests
2018-05-24 10:31:44 +08:00
Chihhang Chuang
3b387a028a Refactor nfc preference controller
- Remove BaseNfcPreferenceController.
- NfcPreferenceController inherit from TogglePreferenceController.
- AndroidBeamPreferenceController inherit from BasePreferenceController.
- Override getIntentFilter in NfcPreferenceController to listen changes.
- Add an API (hasAsyncUpdate) into BasePreferenceController to
distinguish the setting which is updated asynchronously.

Change-Id: I7c9c48ea7f1ad01a02524beabf9d30baa3db891f
Fixes: 67997761
Fixes: 74887543
Test: RunSettingsRoboTests
2018-05-23 13:58:28 +08:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -07:00
chiujason
ff244c0e40 Migrate PaymentSettings to DashboardFragment
- Move preference related logic to controllers.
- Add some test cases for controllers.

Test: manual
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.nfc
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.core
      atest SettingsGatewayTest UniquePreferenceTest
Change-Id: I061a194c170f63fab51974f26c24be43d67d6f6f
2018-04-30 17:24:58 -07:00
hjchangliao
98015e7c93 Merge "Make Nfc/Beam searchable based on feature availability" into pi-dev am: dc09b3ff49
am: f549cd1e05

Change-Id: Ied4f01787aec0cf8f261483e942615abd1889918
2018-04-25 10:23:11 -07:00
hjchangliao
1ff466675d Make Nfc/Beam searchable based on feature availability
Update logic of updateNonIndexableKeys,
in BaseNfcPreferenceController to fix issue.
Add robotest to avoid same problem.

Change-Id: I1de5324b5a7147ff58e3c366ee7e8cf858e3283c
Fixes: 78540155
Test: make RunSettingsRoboTests
2018-04-25 17:12:33 +00:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
HJ ChangLiao
b247311b2a Move BT, NFC out of Conntection pref
Move BT, NFC preference out of Connection Preference,
To Connected devices page.
Because NFC and Android Beam are controlled by the same controller,
Create each controller for those preference and leave the sharing part.

Change-Id: I8bc303a5f487de9c667487119b49e1e4130aa80c
Fixes: 72458929
Test: manually test, make RunSettingsRoboTests
2018-03-28 09:55:22 +08:00
arangelov
e35badd9d5 Make "Action not allowed" dialog compliant with Material Spec and replace full screen activities with the dialog.
Bug: 64893948
Test: make ROBOTEST_FILTER=ActionDisabledByAdminDialogTest -j40 RunSettingsRoboTests
Test: make ROBOTEST_FILTER=ActionDisabledByAdminDialogHelperTest -j40 RunSettingsRoboTests
Change-Id: I9308d8d86a3789b8f2c92b9f4f20cf00cce71d14
2018-03-05 20:27:51 +00:00
Doris Ling
72489725c6 Change superclass to InstrumentedFragment.
- for fragments that do not implement the preference screen, change them
to inherit from InstrumentedFragment instead.

Change-Id: I791c2634024bd2c248efea955be5c680180d735c
Fixes: 68277111
Test: make RunSettingsRoboTests
2018-02-02 13:41:16 -08:00
Antony Sargent
2d4974a40b Show current setting for Tap & Pay
In Settings > Apps & notifications > Advanced > Default apps > Tap & pay
the setting labeled "Use default" is a drop down preference but wasn't
showing the current value it's set to in its summary. This CL fixes
that.

Change-Id: I891289abad781c3eeafa2d7979373f0d53faafc6
Fixes: 67754372
Test: make -j64 RunSettingsRoboTests
2018-01-17 11:30:45 -08:00
Doris Ling
4a01283309 Remove the feature flag for using new title.
- remove all code that check for the feature flag, and use the new logic
by default.

Change-Id: I7fbe60da84c1c0f35e7241402a71d2bc4cd300e6
Fixes: 64564191
Test: make RunSettingsRoboTests
2017-11-13 17:58:13 -08:00
Fan Zhang
a72620b67b Use setVisible instead of removePreference everywhere.
Change-Id: I2e8084b23d3cb2c0a31a38c01716fc76236734ea
Fixes: 68956750
Test: robotests
2017-11-09 13:22:36 -08:00