summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/nfc/NfcPreferenceController.java
Commit message (Collapse)AuthorAgeFilesLines
* Use MainSwitchPreference to replace the button style switches.Stanley Wang2021-02-021-12/+21
| | | | | | | | | | Fix: 177967926 Fix: 177968295 Fix: 177967925 Fix: 177968078 Test: Run robotest and apply the widget in Settings and see the ui Change-Id: Ie854de96e5495fa564fb8a097ed4547bbd2b10c5
* Make some existing slices public.Yi-Ling Chuang2019-11-281-2/+2
| | | | | | | | | Only PreferenceControllers with isPublicSlice() set to true are exposed to other apps. Others will be Settings only. Bug: 141088937 Test: robotests Change-Id: I5934e89bc1b268fdd44acd630621fa46987728ff
* Fix NFC state switched off every time user entered connection preferences pageGeorge Chang2019-06-061-13/+0
| | | | | | | | | | | | | | | | | | | | | | 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
* Remove NFC Slice jankMatthew Fritze2019-02-261-11/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Sort importsFan Zhang2018-08-281-4/+4
| | | | | | | | Having consistent import order will reduce chance of merge conflict between internal and external master Test: rebuild Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
* Reorder and clean up imports.Fan Zhang2018-06-181-5/+3
| | | | | Test: rebuild Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
* Do not turn on NFC automatically when airplane mode is off.Doris Ling2018-06-131-6/+13
| | | | | | | | | | | | | | | - 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
* Refactor nfc preference controllerChihhang Chuang2018-05-231-7/+90
| | | | | | | | | | | | | | - 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
* Migrate Settings to androidx.Aurimas Liutikas2018-04-201-2/+2
| | | | | | Test: make Settings Bug: 76692459 Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
* Move BT, NFC out of Conntection prefHJ ChangLiao2018-03-281-116/+5
| | | | | | | | | | | 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
* Use setVisible instead of removePreference everywhere.Fan Zhang2017-11-091-3/+3
| | | | | | Change-Id: I2e8084b23d3cb2c0a31a38c01716fc76236734ea Fixes: 68956750 Test: robotests
* Merge "Make nfc toggability logic static and public." into oc-dr1-dev am: ↵Daniel Nishi2017-08-011-3/+7
|\ | | | | | | | | | | | | | | b27d65fa55 am: db1158f855 Change-Id: I39a83eff9705f8ed5e66a4ea4aeada9f262d12aa
| * Make nfc toggability logic static and public.Daniel Nishi2017-07-271-3/+7
| | | | | | | | | | Test: exercised in other robotests Change-Id: Id51c9fd820afd539c1d647feb90eecf73ffbf4a7
* | Make PreferenceController a mixinTony Mantler2017-06-261-6/+4
|/ | | | | | Bug: 62912136 Test: Existing tests in BaseSearchIndexProviderTest Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
* Depend on SettingsLib's version of lifecycle and FooterMixin.Juan Lang2017-05-121-3/+3
| | | | | | | | | | The implementations have been imported into SettingsLib. Setting's copy can now be removed, which this change also does. Test: Manually check battery status, which uses FooterMixin, looks OK. make RunSettingsLibRobotTests && make RunSettingsRoboTests && make RunSettingsGoogleRoboTests Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
* Add searchable index for Bluetooth and Nfc only if the feature existsRuchi Kandoi2017-04-241-2/+2
| | | | | | | Test: make RunSettingsRoboTests Bug: 35657961 Change-Id: Ie2f4722b2b1599981c933f87f95016909ba92022 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
* Remove code that check for dashboard feature.Doris Ling2017-03-071-9/+2
| | | | | | | | | - remove DashboardFeatureProvider.isEnabled() and all relating code and tests. Bug: 35764802 Test: make RunSettingsRoboTests Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
* Implements queryNonIndexableKeys for SettingsMatthew Fritze2017-01-251-2/+1
| | | | | | | | | queryNonIndexableKeys returns a list of all of the non-indexable keys for all providers in Settings Change-Id: Id53cb2f55662e85c66f1c3f0c0e7d933b19fedaf Fixes: 34623460 Test: RunSettingsRoboTests
* Remove no-op handlePerferenceTreeClick from PrefControllersFan Zhang2016-12-071-5/+0
| | | | | | Bug: 33429853 Test: RunSettingsRoboTests Change-Id: I5633953e3d7b07f9006e541b96a24a2a769e2686
* Fix logging spam in DashboardFragment.Fan Zhang2016-10-251-1/+1
| | | | | | | | | When updating preferences managed through PreferenceController, the fragment should skip prefs that are not available. Bug: 32255863 Test: RunSettingsRoboTests Change-Id: I2f9b6ddf8c78d40068dc18f07e60672dcba4474a
* Add progressive disclsoureFan Zhang2016-10-181-1/+1
| | | | | | | | | | | | | | - Add a ProgressiveDisclosureMixin that contains all logic for collapse preference list when it's too long - Refactored PreferenceController's updateState to take a preference instead of PreferenceScreen, because with progressive disclosure the preference can either be in screen or the mixin. DashboardFragment is responsible finding the preference before passing it to controller. Bug: 32255863 Test: RunSettingsRoboTests Change-Id: I6713abd61c954ce12732902e5b3ca4d4c0b1563e
* Add nfc preference controller.Doris Ling2016-10-131-0/+172
Update connected devices and wireless setting to use the nfc preference controller for displaying the nfc and bean settings. Test: RunSettingsRoboTests Bug: 31800290 Change-Id: I06eee6b7bfe1d8b767216198bd37f1c79e53d992