Commit Graph

161 Commits

Author SHA1 Message Date
TreeHugger Robot
decea2055d Merge "Declare official platform slice" into pi-dev 2018-03-12 03:17:19 +00:00
Ben Lin
a53001dd13 Introduce boolean flag to show/hide Reset Options.
This adds one new flag:
config_show_reset_dashboard

Which when set to false, will hide Reset Options from System settings.

Bug: 74127210
Test: Updated robotests
Change-Id: I42b14a0abde575f5c4e51985125e8543716d206a
(cherry picked from commit bd180a62ec)
2018-03-10 00:26:15 +00:00
Ben Lin
1f61ff4cf9 Introduce boolean flags to show/hide Encryption status.
This adds one new flag:
config_show_encryption_and_credentials_encryption_status

Which when set to false, will hide Encryption status from Encryption &
credentials. This is when the storage is not being handed by Android,
and so this preference would not be necessarily correct.

Bug: 74127210
Test: Updated robotests
Change-Id: I13665fa369086ef29a4de5f99a78bfbaf96f2f6b
(cherry picked from commit 2d5df469d3)
2018-03-10 00:25:16 +00:00
Matthew Fritze
a4a3dfffa2 Declare official platform slice
Create the notion of an official platform slice.
This includes:
- Adding a second authority to the provider
- tagging slices in xml with a platform slice flag
- Including authority in the getUri method

Bug:73359139
Test: robotests
Change-Id: I5382be138a262dbc5a8324c34aab131c5d0d5516
Merged-In: I581ee6dfcdf935f452a15e89e5d055e375ff1877
2018-03-09 18:04:06 +00:00
Fan Zhang
59520b028a Fix tests
Change-Id: I8b750a87e6852d60ac2f8f61a955b1296cef759b
Fixes: 74234076
Test: robotests
2018-03-06 09:09:31 -08:00
Fan Zhang
f609cad6f0 Fix search non-indexable update
- When creating preference conotrollers, if one fail, skip that one
  instead of giving up entire operation.
- Fix BatterySaverController by providing a existing looper.

Change-Id: Iefe443b7fa91e51515c5c247fab4d9588867baef
Fixes: 73903739
Test: robotest
2018-02-27 16:15:56 -08:00
TreeHugger Robot
8e6d5ad27e Merge "Instantiate pref controllers from xml if it's defined." 2018-02-24 00:13:45 +00: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
Ben Lin
c64531bbce Revert "Add ability to show/hide Color Correction and Color Inversion."
This reverts commit f1346930bc.

Reason for revert: Moving logic elsewhere.

Change-Id: Ia07b3f4c33e0078e8f35c69d5ed51daf197ff165
2018-02-16 15:10:11 -08:00
Ben Lin
463c9a07f0 Revert "Add ability to show/hide accessibility_shortcut_preference."
This reverts commit 4983dc1227.

Reason for revert: Moving logic somewhere else.

Change-Id: I2f2e3ac6545e8599de32afb1fe6f6d108601e37d
2018-02-16 14:27:34 -08:00
Ben Lin
bba02d88a4 Introduce config_disable_uninstall_update flag.
This adds the following flag:
config_disable_uninstall_update

Which by default is false. When set to true, it will hide the "Uninstall
updates" menu item for all cases.

This is useful for cases where the device OEMs want to allow users to
install apps, but do not want the ability to roll back updates on system
applications.

Bug: 62379281
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppInfoDashboardFragmentTest
Change-Id: I55fe92467ca95c05f6682174c117031d8295790e
2018-02-13 14:45:34 -08:00
Ben Lin
3bf23ff59e Introduce boolean flags to show/hide battery/memory in App info.
This adds two flags:
config_show_app_info_settings_memory
config_show_app_info_settings_battery

Which when individually set to false, will hide them item from "App
info" which is accessed from clicking on an application in Apps &
notifications -> App info.

Bug: 62379413
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.applications

Change-Id: Ifb3b644901728dc7ea04d13198abddaa7b230538
2018-02-02 12:18:47 -08:00
Ben Lin
7190f85392 Add ability to show/hide different device information.
This introduces 3 boolean flags:

config_show_device_model
config_show_wifi_ip_address
config_show_wifi_mac_address

Which when set to false will hide their individual panes from "About
Phone" page.

Bug: 62414913
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.deviceinfo
Change-Id: Iaaf91ef41c9ec7b5bf233344e6a48d4b87fad291
2018-01-30 16:53:57 -08:00
Ben Lin
6fb9c9f4b0 Add ability to show/hide System Update.
This adds one flag:
config_show_system_update_settings

Which when set to false will hide "System update" from System page. This
is useful for devices that controls its system update elsewhere.

Bug: 69813881
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.deviceinfo
Change-Id: Ibd1291ffd8948419e8aa06d0721842246a069378
2018-01-23 13:51:25 -08:00
Ben Lin
2a63861a52 Clean up SystemUpdatePreferences tests.
SystemUpdatePrefenceControllerTest had some logic that seemed irrelevant
to its testing class, which seems to have moved to
AdditionalSystemUpdatePreferenceController. Removed the irrelevant
test cases and added additional test coverage on
AdditionalSystemUpdatePreferenceController.

Bug: None
Test: RunSettingsRoboTests
Change-Id: I5224900bc3449a9f329a1d02ee3cb597b4748d91
2018-01-23 13:39:12 -08:00
Jong Wook Kim
8c6d8daaf0 Wifi MAC Randomization: Developer Options
Add a toggle in developers options to turn on/off connected MAC
randomization for devices that support the feature. This toggle will be
only available on devices that support dynamic MAC address change and
indicated as so in config_wifi_support_connected_mac_randomization.

The toggle changes Settings Global value WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED, which the Wifi Framework will listen for to start/stop randomizing MAC addresses.

Bug: 67908229
Bug: 71548421
Test: RunSettingsRoboTests, manual testing checking that the toggle comes up and changes global settings value.
Change-Id: Ia4749cd0a1e7466333bd8a93088d6340f6567e25
2018-01-22 02:16:31 -08:00
Ben Lin
dd1e1e1d99 Introduce boolean flags to show/hide items in Security & location.
This adds 6 new boolean flags:
config_show_manage_device_admin
config_show_unlock_set_or_change
config_show_screen_pinning_settings
config_show_manage_trust_agents
config_show_show_password
config_show_trust_agent_click_intent

Which when individually set to false, will hide the item from "Security
& location". It will also hide them from surfacing in search results.

Bug:62379222
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.security
Change-Id: I58d82cbc7f366a9666cdb0f7cd1b90ebbaf418f4
2018-01-17 17:58:38 -08:00
Ben Lin
e5e8f0368f Add ability to show/hide airplane toggle.
This introduces a new boolean flag:
config_show_toggle_airplane

Which when set to false, will hide the airplane mode toggle in network &
internet.

Bug: 69813881
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=AirplaneModePreferenceControllerTest

Change-Id: I2cf682bf78231040eba5573fbcb55a65be2a13df
2018-01-16 18:23:52 +00:00
TreeHugger Robot
e31f582baf Merge "Introduce boolean flag to show/hide Location Scanning preference." 2018-01-12 21:53:12 +00:00
TreeHugger Robot
e9a3a14330 Merge "Add ability to show/hide individual settings in Sounds page." 2018-01-12 20:11:30 +00:00
Ben Lin
e8377718e0 Introduce boolean flag to show/hide Location Scanning preference.
This introduce one new flag:
config_show_location_scanning

Which when set to false, will hide "Scanning" in Location preference.

Some OEMs may control Bluetooth/Wi-Fi scanning themselves, so they may
want to hide the page from users.

Bug: 62418710
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=LocationScanningPreferenceControllerTest

Change-Id: I19f0020a2c94f70b3b7956529f57af098ccc79fd
2018-01-12 19:48:37 +00:00
Ben Lin
f1346930bc Add ability to show/hide Color Correction and Color Inversion.
This adds two new boolean flags:
config_show_color_inversion_preference
config_show_color_correction_preference

Which whent set to false, will hide the color inversion and color
correction preference items, respectively.

Bug: 62378109
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=AccessibilitySettingsTest

Change-Id: I06eac8e141bd6564495298c6c6544a7b059a4e73
2018-01-10 18:33:01 -08:00
Ben Lin
921e3d14b8 Add ability to show/hide individual settings in Sounds page.
This adds the following 7 new boolean flags:
config_show_alarm_volume
config_show_charging_sounds
config_show_media_volume
config_show_notification_ringtone
config_show_notification_volume
config_show_screen_locking_sounds
config_show_touch_sounds

Which when set to false, will hide the respective preferences in Sounds
page.

Bug: 69813881
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.notification all pass.

Change-Id: I84a2ce66b07c00d658422ce1a0eacaf9a01fae8a
2018-01-10 13:58:58 -08:00
Ben Lin
c28b46f2ea Introduce boolean flags to show/hide items for Language & input.
This adds seven new boolean flags:
config_show_phone_language
config_show_virtual_keyboard_pref
config_show_physical_keyboard_pref
config_show_spellcheckers_settings
config_show_tts_settings_summary
config_show_pointer_speed
config_show_vibrate_input_devices

Which when individually set to false, will hide the item from "Language
& input" in System. It will also hide them from surfacing in search
results.

Bug: 62379555
Test: Individual controller tests are all updated.

Change-Id: I9ef1c3037b0bec6ffa5a627006507f4f16e534c4
2018-01-10 11:27:58 -08:00
Ben Lin
69084b3a8d Add ability to show/hide assist_and_voice_input preference.
This adds a new boolean flag, config_show_assist_and_voice_input, which
when set to false will hide the assist_and_voice_input preference item.

Bug: 62379282
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=DefaultAssistPreferenceControllerTest
Change-Id: I3bfc84f0fba07cd52679269daadbdcfccd205ff1
2018-01-05 10:03:17 -08:00
TreeHugger Robot
efac313a9b Merge "Add ability to show/hide accessibility_shortcut_preference." 2018-01-04 22:57:35 +00:00
Ben Lin
1ed3e36134 Add ability to show/hide items for Special Access.
This adds five new boolean flags:
config_show_high_power_apps
config_show_device_administrators
config_show_premium_sms
config_show_data_saver
config_show_enabled_vr_listeners

Which when individually set to false, will hide the respectively item
from "Special Access" in Apps & notifications. It will also hide them
from surfacing in search results.

Bug: 70907131
Test: Updated SpecialAccessSettingsTest, and created:
HighPowerAppsControllerTest
DeviceAdministratorsControllerTest
PremiumSmsControllerTest
DataSaverControllerTest
EnabledVrListenersControllerTest

Change-Id: I5ad58755643e71d4fb71774404ad96c127440ae4
2018-01-03 16:25:09 -08:00
Ben Lin
848f67d17a Add ability to show/hide Wi-Fi settings, and all related sub-settings.
This adds a new boolean flag, config_show_wifi_settings, which when set
to false will hide the "Wi-Fi" page in network & internet (there is no
key value associated with this preference page). It will also hide
nested pages from search results, such as Wi-Fi preferences.

Bug: 62379554
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=ConfigureWifiSettingsTest
and
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiSettingsTest
and
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiMasterSwitchPreferenceControllerTest
all pass.

Change-Id: Iedc6bc272e0cb2b561c6bf25968e70f355aaaa8e
2018-01-03 20:05:55 +00:00
Ben Lin
4983dc1227 Add ability to show/hide accessibility_shortcut_preference.
This adds a new boolean flag,
config_show_accessibility_shortcut_preference, which when set to false
will hide the accessibility shortcut preference item.

Bug: 62387367
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=AccessibilitySettingsTest
Change-Id: I3fd941695df1ad89f717f464d2383be909839a3b
2018-01-03 10:36:01 -08:00
TreeHugger Robot
3abedefd38 Merge "Add ability to show/hide default_home preference." 2017-12-20 07:47:08 +00:00
TreeHugger Robot
1b1602ab2d Merge "Index Data to build Slices in Settings" 2017-12-20 01:00:32 +00:00
Ben Lin
b60d2cbb5b Add ability to show/hide default_home preference.
This adds a new boolean flag, config_show_default_home, which when set
to false will hide the default_home preference item.

Bug: 62378256
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=DefaultHomePreferenceControllerTest

Change-Id: Ibbf17ebb76b61fc8b2eac84016e3d874ca15a513
2017-12-19 15:57:29 -08:00
Matthew Fritze
13c43f1900 Index Data to build Slices in Settings
The indexing is done by taking the indexable fragments from
search, grabbing their XML via SearchIndexableResources, and
then looking for controllers defined in preferences.

For each controller found, we take the combination of the
fragment providing the XML and the Preference info to create
an indexable row.

Buiding a Slice will be handled in a subsquent CL, but a
prototype can be found here: ag/3324435

Test: robotests
Bug: 67996923
Change-Id: I48668618079bcc3da55ab77b7323ee8e467073af
2017-12-19 09:47:07 -08:00
TreeHugger Robot
7393cd1cf1 Merge "Introduce config_show_wallpaper_attribution." 2017-12-18 20:46:59 +00:00
Ben Lin
e4ca92af6b Introduce config_show_wallpaper_attribution.
This introduces a boolean flag in which when set to true, Wallpaper
Attribution will be shown in the Legal page. When set to false, it
will be hidden. Wallpaper has always been removed from search results,
so that has not changed.

Bug: 62378616
Test: make RunSettingsRoboTests ROBOTEST_FILTER=LegalSettings passes.
Change-Id: Ia6f3e7d1ef471eecf79f1b46616fa4ba27d35748
2017-12-14 14:38:30 -08:00
Matthew Fritze
7d2b4f5fc7 Add PrefController in XML support
Add the ability to define a Preference Controller
in xml using the 'controller' tag.

This is useful for two reasons:
- It allows the controllers to be instantiated via
reflection for Slices and Dashboard fragment
- Removes the requirement that controllers be defined manually
in Fragments

In order to be instantiable, they must have a unified construction
following either:

  ClassName(Context)
  ClassName(Context, String)

Also added a robotest that verifies that all controllers defined
in XML follow the constructor schema, and extend
BasePreferenceController.

Test: robotests
Bug: 67996923
Change-Id: I304b35dc666daebecf0c9e286696f3f2a510704a
2017-12-12 14:21:12 -08:00
Ben Lin
607cd20a16 Add XML attribute to toggle on/off LocationModePreferenceController.
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=LocationModePreferenceControllerTest all pass.
Bug: 62378711

Change-Id: I0d054171b80b5677dba2a7a02fb076660ed5cc0d
2017-12-05 11:56:00 -08:00
Fan Zhang
0fea400314 Fix robolectric tests
- Override a button style to avoid dependency on new style name.

Change-Id: I62935afe16424d8ddf0c2448327d76eda00440a5
Fixes: 69918100
Test: robotests
2017-11-29 12:55:19 -08:00
TreeHugger Robot
cbe6f4a4cf Merge changes Icae52730,I38282b97
* changes:
  Move dashboard test package to sdk 26
  Update DashboardFeatureProviderImplTest to sdk 26
2017-11-28 19:32:46 +00:00
jeffreyhuang
c00ee9588a Update DashboardFeatureProviderImplTest to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I38282b97b3e0325a1568d1af9bd2b38b110736c1
2017-11-27 17:00:56 -08:00
jeffreyhuang
3b0b8b711e Update RecentAppsPreferenceControllerTest to sdk26
- Remove the usage of the mock context to avoid null pointers in sdk 26

Test: make RunSettingsRoboTests -j40
Change-Id: I73dac0c91e56d84cdec0314a4ec5754a0a98c54b
2017-11-27 13:37:31 -08:00
Chien-Yu Chen
5d242df477 Settings: Remove HAL HDR+ option
Test: RunSettingsRoboTests
Bug: 68223991
Change-Id: I9eb27c7e205ac005c6a71726e125ed1e512da33b
2017-11-10 14:32:25 -08:00
Fan Zhang
a8cac7a409 Move ManageApplications to sub package and remove dead code
Bug: 64804294
Test: rerun test
Change-Id: I23cbd8da9b65f52470030ba3b9b676ece2bada11
2017-10-12 13:48:54 -07:00
TreeHugger Robot
0e680b3cfd Merge "Introduce ConnectivityMonitorPreferenceCtrlV2" 2017-09-27 21:36:55 +00:00
jeffreyhuang
b8d67f2d9e Fix a bug in CameraHalHdrPlusPrefCtrlV2Test
- Fix a bug where an incorrect config value was being passed

Bug: 34203528
Test: make RunSettingsRoboTests -j40
Change-Id: Ic42d94867097f7944e66ecc3abc42bb8b72608a2
2017-09-26 16:40:25 -07:00
jeffreyhuang
141c92bf62 Introduce ConnectivityMonitorPreferenceCtrlV2
- Create new ConnectivityMonitorPreferenceControllerV2
 - Deprecate ConnectivityMonitorPreferenceController
 - Create controller inside the DashboardFragment
 - Copy logic from ConnectivityMonitorPreferenceController with slight
 modifications for dashboard fragment compatibility

Bug: 34203528
Test: make RunSettingsRoboTests -j40
Change-Id: Ibba32208abb2535e1d13b299705e4f4e63aef8c8
2017-09-26 16:39:01 -07:00
jeffreyhuang
2145f8a275 Introduce CameraHalHdrPlusPreferenceControllerV2
- Create new CameraHalHdrPlusPreferenceControllerV2
 - Copy logic from CameraHalHdrPlusPreferenceController with slight
   modifications for dashboard fragment compatibility
 - Deprecate CameraHalHdrPlusPreferenceController

Bug: 34203528
Test: make RunSettingsRoboTests -j40
Change-Id: I9b88286d16930df208c7c413728c816637409c81
2017-09-26 09:59:39 -07:00
TreeHugger Robot
36fe2ca3dc Merge "Move the indexing back into DatabaseIndexingManager" 2017-09-26 04:21:45 +00:00
Matthew Fritze
80e54df833 Move the indexing back into DatabaseIndexingManager
For the sake of incremental updates, we moved all of the
conversion from PreIndexData to IndexData, and the
insertion of the rows into the SQLite DB into a new class,
IndexDataConverter. However, it's real role is just to
convert PreIndexData into IndexData.

So this CL moves the insertion of the rows back into
DatabaseIndexingManager.

Again, for the sake of simplicity, I did not change the
conversion flow. Rather, instead of inserting a row at the
end of the conversion, I just put it into a list which is
then returned. This lets me move the tests to appropriate
locations, without having to change them too much.

In the tests, the references to real xml layouts are
changed to fake references. Hooray for being less brittle.
IndexDataConverter now just tests that the IndexData
has the appropriate data from PreIndexdData.

Independently, we test that IndexData gets inserted in
DatabaseIndexingManager.

In the next CL, I'll refactor the conversion
flow for readability.

Bug: 33577327
Test: make RunSettingsRoboTests
Test: Took a database dump before and after change,
      and they were the same. Cool.

Change-Id: I39cc812d1f736e13a0a51af50984c239961ecf7a
2017-09-25 16:48:22 -07:00
jeffreyhuang
c215b3c4e9 Introduce CameraLaserSensorPreferenceControllerV2
- Create new CameraLaserSensorPreferenceControllerV2
 - Copy logic from CameraLaserSensorPreferenceController with slight
 modifications for dashboard fragment compatibility
 - Deprecate CameraLaserSensorPreferenceController

Bug: 34203528
Test: make RunSettingsRoboTests -j40
Change-Id: I8854d3e891afab607025a427a376e33e9b61dcc3
2017-09-25 12:42:47 -07:00