Commit Graph

58 Commits

Author SHA1 Message Date
Sunny Shao
6d60248053 Enable some settings pages to use paralleled-loading method
- Here these pages include AppInfoDashboardFragment, ConnectedDeviceDashboardFragment,
  DevelopmentSettingsDashboardFragment, NetworkDashboardFragment, ConfigureNotificationSettings.
- The TimeSpentInAppPreferenceController use the LiveDataController.

Fixes: 135299529
Bug: 137558156
Test: compilation
Change-Id: I455a16536c9966184f1b2bd81d1f1217f3e09f9d
2020-05-04 10:34:23 +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
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
tmfang
ec83f48e0d Use FooterPreference in xml explicitly
We don't rely on FooterPreferenceMixinCompat
to create footer preference in dashboard fragment.

Instead, declare a FooterPreference explicitly in
xml of screen.

Test: visual, robotest
Bug: 124129485
Change-Id: I4c5b60c3926583eb0d9f0d4cd6996bf169d6408c
2019-06-25 16:48:51 +08:00
Lei Yu
15899e8b0e Add SettingsPolicy to control BT feature
Fixes: 130302238
Test: RunSettingsRoboTests
Change-Id: I7e1bf55c476f8e4d3dec7a7dfc0e8d44e5bd53ae
2019-04-18 11:31:05 -07:00
jackqdyulei
ca21544f99 Add nearby device SlicePreference
Change-Id: I9e88602df9ab589c3eea087b1202cbc7615dc810
Fixes: 116327443
Test: RunSettingsRoboTests
2019-02-11 17:38:50 -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
Fan Zhang
130c477044 Remove DashboardSummary and all related classes.
- Condition is already supported in PersonalSettingsFragment
- Suggestion is already supported in PersonalSettingsFragment
- Static/dynamic tiles are supported in TopLevelSettings

Change-Id: I51882e3bd0919ad95109baefac683d98667c11e3
Fixes: 110405144
Test: robotests
2018-10-25 11:27:47 -07:00
Fan Zhang
9ce4a1fcde Use searchable="false" to suppress nonIndexables.
When possible, remove or simplify getNonIndexable() logic in fragments,
and use searchable="false" in xml to suppress index.

Change-Id: I5bdf5bc7d5494a64cdd9e230a51321a4b210af69
Fixes: 112608186
Test: robotest and manual search
2018-08-17 09:21:05 -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
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
timhypeng
444d490e7f Make device discoverable in Connected Devices settings page
* For fix the TreeHugger error in pi-dev, cherry pick the ag/4042235 in
  master and fix TreeHugger error. Change android.support.v7.* to androidx.*
* Set preference title by bluetooth state
* Enable bluetooth discoverable mode in Connected device page
* Add more test cases for DiscoverableFooterPreferenceController

Bug: 79294219
Test: make -j50 RunSettingsRoboTests
Change-Id: I6d4f8ec3870c43bf48e9666eabd60068aa8950bb
2018-05-21 10:42:36 +00:00
timhypeng
dd2d5c192f Add bluetooth discoverable footer preference in connected devices page
* For fix the TreeHugger error in pi-dev, cherry pick the ag/4042014 in
  master and fix TreeHugger error. Change android.support.v7.* to androidx.*
* Dynamicly add preference in controller
* Add test cases for DiscoverableFooterPreferenceController

Bug: 79294219
Test: make -j50 RunSettingsRoboTests
Change-Id: Id4c1e86c9a0a0cd69d8106a18f2cf4a0fa31782b
2018-05-21 10:41:54 +00:00
hughchen
5a8b5dd431 Using static method to get summary resource id am: 7f1345c3cd
am: 6a4174a079

Change-Id: I91b805e89e9f3d5a3259f10401a9963d25cb32e1
2018-05-21 00:12:18 -07:00
hughchen
7f1345c3cd Using static method to get summary resource id
* Using getConnectedDevicesSummaryResourceId() to get the resource id to shown the summary.

Bug: 79299421
Test: make -j50 RunSettingsRoboTests
Change-Id: I268de4d989fe01eff463a5ec1c0a174e094e56c0
2018-05-21 04:08:46 +00:00
TreeHugger Robot
d24c9e4a80 Merge "Grey the previously connected device preference" into pi-dev 2018-05-18 03:21:57 +00:00
hughchen
980b718989 Grey the previously connected device preference
* Add PreviouslyConnectedDevicePreferenceController to handle the preference should be
  enable or disable.
  Example: If there are no previously connected devices disable the preference otherwise
  enable it.
* Add PreviouslyConnectedDevicePreferenceControllerTest
  1. Verify the callback can be registered and unregistered
  2. Verify the preference is enable when there
     have more than 1 previously connected device
  3. Verify the preference is disable when there
     have no previously connected device

Bug: 78250052
Test: make -j50 RunSettingsRoboTests
Change-Id: I31b5d416aaf907c3bbf1cb61de6e7401463e3df7
Merged-In: I31b5d416aaf907c3bbf1cb61de6e7401463e3df7
2018-05-18 02:16:23 +00:00
hughchen
0404968d8b Grey the previously connected device preference
* For fix the TreeHugger error in pi-dev, cherry pick the ag/3935357 in
  master and fix TreeHugger error.
* Add PreviouslyConnectedDevicePreferenceController to handle the preference should be
  enable or disable.
  Example: If there are no previously connected devices disable the preference otherwise
  enable it.
* Add PreviouslyConnectedDevicePreferenceControllerTest
  1. Verify the callback can be registered and unregistered
  2. Verify the preference is enable when there
     have more than 1 previously connected device
  3. Verify the preference is disable when there
     have no previously connected device

Bug: 78250052
Test: make -j50 RunSettingsRoboTests
Change-Id: I31b5d416aaf907c3bbf1cb61de6e7401463e3df7
2018-05-17 16:55:31 +08:00
hughchen
52feedf354 Bluetooth and NFC added back to Connection preferences
* Bluetooth and NFC added back to "Connection preferences"

Bug: 79299421
Test: make -j50 RunSettingsRoboTests
Change-Id: I8f4c389c28c7cc752f198be2b59b28b6e9af2c90
Merged-In: I8f4c389c28c7cc752f198be2b59b28b6e9af2c90
2018-05-16 17:03:31 +00:00
hughchen
4bf7c3a921 Bluetooth and NFC added back to Connection preferences
* For fix the TreeHugger error in pi-dev, cherry pick the ag/4023339 in
  master and fix TreeHugger "Automatic merge failed" error.
* Bluetooth and NFC added back to "Connection preferences"

Bug: 79299421
Test: make -j50 RunSettingsRoboTests
Change-Id: I8f4c389c28c7cc752f198be2b59b28b6e9af2c90
2018-05-16 08:03:00 +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
hughchen
5620d28f3f Merge "Implement audio switch UI" into pi-dev am: 5a2f73151e
am: 608d436da0

Change-Id: Iea47d84345cfd10388a4c2ad34d5cedcfe7eaeb6
2018-04-16 12:12:21 -07:00
hughchen
bd3e5de207 Implement audio switch UI
* Implement available media devices group
* Add AvailableMediaDeviceGroupController to realize UI, the user can see the all device that can be activated in this group.
* ConnectedDeviceGroupController change to show the device that cannot be activated but is connected.
* Refactoring the below class, implement the controller in connected_devices.xml.
  ConnectedDeviceGroupController.java
  SavedDeviceGroupController.java
  ConnectedDeviceDashboardFragment.java
  connected_devices.xml
* Add AvailableMediaBluetoothDeviceUpdaterTest to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged
* Add test that used to verify device is connected or not in BluetoothDeviceUpdaterTest.
* Add test that used to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged in ConnectedBluetoothDeviceUpdaterTest.
* Add AvailableMediaDeviceGroupControllerTest to verify bluetooth feature is supported or not and test register callback.
* Add test that used to verify bluetooth feature is supported or not and test register callback in ConnectedDeviceGroupControllerTest.
* Add test that used to verify bluetooth feature is supported or not and test register callback in SavedDeviceGroupControllerTest

Bug: 74134939
Test: make -j40 RunSettingsRoboTests
Change-Id: I54d03c2ddadc6a4be7519dd74cdbcb5055d44083
2018-04-15 04:22:25 +00:00
Salvador Martinez
9eac182805 Update bluetooth preference to take user to new screen
This CL removes the toggle from the bluetooth preference and instead
takes users to a new dedicated screen for toggling bluetooth status.
On this screen we show a different summary text depending on whether
bluetooth and bluetooth scanning are on/off. Also, we were able to
delegate most of the UI/bluetooth handling to already existing
classes.

Test: robotests
Bug: 77543471
Merged-In: I036a3992bbd78896da8364b55ecc51afc4464b6e
Change-Id: I036a3992bbd78896da8364b55ecc51afc4464b6e
2018-04-13 15:07:45 -07:00
Salvador Martinez
21c5ed2894 Update bluetooth preference to take user to new screen
This CL removes the toggle from the bluetooth preference and instead
takes users to a new dedicated screen for toggling bluetooth status.
On this screen we show a different summary text depending on whether
bluetooth and bluetooth scanning are on/off. Also, we were able to
delegate most of the UI/bluetooth handling to already existing
classes.

Test: robotests
Bug: 77543471
Change-Id: I036a3992bbd78896da8364b55ecc51afc4464b6e
2018-04-13 10:57:16 -07:00
hughchen
aa31bd43a3 Implement previously connected device UI
* Move save device group to "Previously connected devices"

Bug: 74134939
Test: make -j60 RunSettingsRoboTests
Change-Id: Iff7894033df402d42dcc0ccaea6db3106edb7013
Merged-In: Iff7894033df402d42dcc0ccaea6db3106edb7013
2018-04-12 17:10:40 +00:00
hughchen
a05d1fc769 Implement previously connected device UI
* For fix the conflicts in pi-dev, cherry pick the commit 86d3e58c8d in
master and merge the conflict.
* Add @SearchIndexable in
PreviouslyConnectedDeviceDashboardFragment.java
* Move save device group to "Previously connected devices" preference

Bug: 74134939
Test: make -j60 RunSettingsRoboTests
Change-Id: Iff7894033df402d42dcc0ccaea6db3106edb7013
Merged-In: Iff7894033df402d42dcc0ccaea6db3106edb7013
2018-04-12 09:57:08 +08: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
Lei Yu
dec7a719d1 Remove the obsolete bluetooth code
Also update the shortcut:
1. Change the name to "Devices"
2. Change it point to "Connected device" page

Bug: 74806595
Fixes: 69926683
Test: robo test still pass

Change-Id: Ic57756fc955dc622cc22d0be64f02b5ae07a2915
2018-03-30 11:24:26 -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
Lei Yu
687964cf28 Add search index provider for bt page
1. Implement the search index provider for
ConnectedDeviceDashboardFragment.
2. Since in SEARCH_INDEX_DATA_PROVIDER fragment is null,
so we need to pass in context to all components
instead of getting it from fragment.
3. Update test for it as well as creating new shadow.

Change-Id: If0aa67d5b6ca207c6b728c8355581bf414577091
Fixes: 69333961
Test: RunSettingsRoboTests
2018-03-21 10:46:02 -07:00
Fan Zhang
f7843adabd More renaming in DashboardFragment
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936

Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
2018-02-23 16:56:30 -08:00
Fan Zhang
917f101899 Instantiate pref controllers from xml if it's defined.
- If a <preference> tag also defines a controller, we will try to
  instantiate it before displaying the UI. The same logic is shared by
  BaseSearchIndexProvider so it also drives search suppression.

- If user also defines a list of controllers programatically, the
  programatically created ones takes precedence.

Bug: 73668763
Test: WIP
Change-Id: I7aecec270bcd3af261e012ef1f6995d2a523cfa1
2018-02-23 14:08:51 -08:00
jackqdyulei
b79e0d4279 Add preferences in new connected device page
1. Add device preference
2. connection preference

This cl add click action for Add device preference. Action for
connection preference will be added in future cl.

Bug: 69333961
Test: Screenshot | RunSettingsRoboTests
Change-Id: Ifb1afc8371ee45165ea22a7a195a774ba04fdeea
2017-12-01 12:28:15 -08:00
TreeHugger Robot
4031bc78e4 Merge changes from topic "settings_presubmit_instr_test"
* changes:
  Refactor help menu stuff into a controller
  Fix UniquePreferenceTest
2017-11-30 01:38:33 +00:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
jackqdyulei
aec5543841 Add preference group for saved devcies.
Currently it only contains bluetooth devices.

Bug: 3240835
Test: RunSettingsRoboTests
Change-Id: Ief102e7174a4c4610dbda6b728419b303ff928f9
2017-11-27 12:56:44 -08:00
jackqdyulei
75ea67c9f4 Update ConnectedDeviceGroupController
Get the PreferenceGroup there and add/remove preference
through the callback

Also add ConnectedBluetoothDeviceUpdater which only filter
the connected device.

Bug: 69333961
Test: RunSettingsRoboTests

Change-Id: Ia2ab6b6708329227929d6fe442df3a8d45bf86f5
2017-11-21 14:44:35 -08:00
jackqdyulei
76ba0f72e4 Add feature flag for connected device
Add feature flag to toggle connected device between new and old
feature.

ConnectedDeviceDashboardFragment will contain new feature will
ConnectedDeviceDashboardFragment2 will hold old feature.

Bug: 69333961
Test: Build
Change-Id: I0ea932c69dea5242129aab994d5142b1f87fbea0
2017-11-20 15:29:28 -08:00
Oren Blasberg
d33dcf13ee Settings: Add SMS Mirroring.
Bug: 37546615

Test: Updated Robolectric suite with new unit tests.

Change-Id: I02e1723e1b125b004ff679d6242df14bca4f08ce
2017-07-19 08:07:11 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Fan Zhang
179645eecd Add help url placeholders for new pages
Bug: 38412798
Test: visual
Change-Id: I4ede523cb13790ea05309279f80a778b2086f850
2017-06-05 14:50:01 -07:00
Fan Zhang
82be5f0c3f Misc fixes to search and UI.
- Use prefContext to create preference.
- rename "Gestures" to "Gesture shortcuts"
- Add search keyword to individual gesture settings so when search
  "gesture" they also show up.
- call super() for all getNonIndexableKeys() in search provider

Fix: 38327387
Fix: 36621897
Fix: 36685646
Test: make RunSettingsRoboTests

Change-Id: Ia5ddfeae08cb27c278dfb8d2376594e21d8f283c
2017-05-23 14:55:23 -07:00
jackqdyulei
5333ecd1fb Dupe BluetoothSettings and DeviceListPreferenceFragment
Create the obsolete version of the belowing fragments, so we could
flip between old page and new page.

BluetoothSettingsObsolete and DeviceListPreferenceObsoleteFragment
contains all the old logic but:
1. Logic about BluetoothPairingPreferenceController(ag/2239482),
since this preference shouldn't be checked in without the flag :(

This cl also adds logic in MasterSwitchPreferenceController to flip
these two pages.

Following cl will refactor these fragment to make it compatible
to new framework.

Bug: 35877041
Test: RunSettingsRoboTests
Change-Id: I1cc1bc2d49d8a3e11c3127e56f6409fbc84028d8
2017-05-18 14:12:02 -07:00
Fan Zhang
7c3a87ebd3 Dynamic summary text for network/connected device screen.
Change-Id: I3254c63b7c241e2de9251b3c2d2a0106fb049ece
Fix: 36768218
Test: make RunSettingsRoboTests
2017-05-18 09:52:43 -07:00
Juan Lang
777ed2535a Depend on SettingsLib's version of lifecycle and FooterMixin.
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
2017-05-12 11:10:46 -07:00
Matthew Fritze
2caaa7420d Remove search duplicates for Wifi and Bluetooth
Remove the master switch duplicates between the switch
and their targets. Only show the actual Wifi and Bluetooth
settings as search results.

Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I226cc8db40a308bd9bcfacdd4fc6ae709fb809c5
2017-04-27 12:36:16 -07:00
Ruchi Kandoi
7ca6c2410c Add searchable index for Bluetooth and Nfc only if the feature exists
Test: make RunSettingsRoboTests
Bug: 35657961
Change-Id: Ie2f4722b2b1599981c933f87f95016909ba92022
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2017-04-24 13:15:35 -07:00
Doris Ling
f2cf2aea37 Remove code that check for dashboard feature.
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.

Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
2017-03-07 11:15:03 -08:00