Commit Graph

64 Commits

Author SHA1 Message Date
Weng Su
f0b9dc570b [Provider Model] Add Internet preference to replace Wi-Fi preference
- Change title from "Wi-Fi" to "Internet"
- Remove Wi-Fi switch
- Screenshot:
  https://screenshot.googleplex.com/9tmXYQXKSsuGwEY
  https://screenshot.googleplex.com/5uMCeruXsX3gP9j

Bug: 172295984
Test: manual test
  atest -c InternetPreferenceControllerTest
  make RunSettingsRoboTests ROBOTEST_FILTER=NetworkDashboardFragmentTest
Change-Id: Ie4a3c9aff45fbe7b28594afc9c603e6df57300bf
2020-11-19 14:51:56 +00:00
Zoey Chen
14602e302a [Provider Model] Use new entry xml of Network & Internet
Bug: 171874190
Test: manual
Change-Id: I542ba08c122cb50de37dafd06cfa08dead8e2e0f
2020-11-02 22:28:47 +08:00
govenliu
b70ddb9df7 [Wi-Fi] WiFi Settings inclusive language fix plan phase 1
Replace WiFi related terms which contain Master wording.
Goal: Create a fixit for Android Platform to reduce the use of non-inclusive language for all code.

Bug: 161425297
Test: make RunSettingsRoboTests -j or
make RunSettingsRoboTests ROBOTEST_FILTER=DashboardFragmentTest
make RunSettingsRoboTests ROBOTEST_FILTER=WirelessDebuggingPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AutomaticStorageManagementSwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AllInOneTetherPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=TopLevelNetworkEntryPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=PrimarySwitchPreferenceTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiPrimarySwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPreferenceControllerTest

Change-Id: I9395c50e092e124016609f88f7c8151554a0d874
2020-07-21 20:56:22 +08:00
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
Zhen Zhang
c2b9e5ef20 Update summary for AllInOneTetherPreference accordingly
The summary for AllInOneTetherPreference in NetworkDashboardFragment is
updated according to tethering state and tether interface chosen by
user.

Bug: 149256198
Test: AllInOneTetherPreferenceControllerTest, TetherEnablerTest,
CodeInspectionTest

Change-Id: I24ba4deabbb02b203e76d32048040d7ccf1b2d22
2020-02-14 00:14:23 -08:00
Zhen Zhang
31f1a34629 Add a Preference into "Network & internet" for new tethering UI
Adding a MasterSwitchPreference into "Network & internet" and create
corresponding controller. The preference is hidden by the feature flag.
It does NOT affect the existing UI.

Bug: 146147778
Test: CodeInspectionTest, TetherPreferenceControllerTest,
NetworkDashboardFragmentTest
Change-Id: Ida8e088efbb22d0c983acecbc420672206392dad
2020-02-12 23:55:02 -08:00
Edgar Wang
7312defa4a Fix Wifi & Bluetooth slice can't show on search result
root cause: we remove wifi & bluetooth preference screen key from search
indexing, this cause these 2 special slices can't map to correct key

solution: rename preference key for mapping

Bug: 149366072
Test: robotest & manual
Change-Id: Id424e63c4f97ccd6f58a80aaa414807774159512
2020-02-12 17:07:34 +08:00
Raff Tsai
8fe35bff52 Remove duplicate layout mobile_network_settings_container_v2
- MobileNetworkActivity can use settings_base_layout.xml as layout.
- MobileNetworkActivity need to use Theme.Settings.Home because
it requests Window.FEATURE_NO_TITLE. Otherwise MobileNetworkActivity
will show title defined in xml first then change to new title.

Fixes: 123794771
Test: rebuild, manual
Change-Id: I39ae25b6d335437ffddb2f1562e7a0347db97108
2019-11-08 12:04:16 +08:00
Raff Tsai
4992919d95 Remove unused resources
Bug: 123794771
Test: rebuild, robolectric
Change-Id: I22f43220cc9ad4ec2074af425b0da75f59e470a4
2019-11-07 18:12:34 +08:00
Raff Tsai
1eccd55a70 Remove mobile network v1
Fixes: 142920912
Test: rebuild, robolectric
Change-Id: Ib365ba712af62729ca35abbc370aef087ce52a90
2019-11-05 17:54:54 +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
Fan Zhang
1ef08ae814 Fix robotests
This is related to settings_network_and_internet_v2 flag turn on. Some
tests were assuming old flag behavior.

Fixes: 128356137
Test: robotests
Change-Id: I4eca49f24ad5a10a0fb40f2c02a2d139ba4cb1a4
2019-03-12 16:50:28 -07: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
Antony Sargent
f4ee4ef3bf Add page listing multiple mobile networks
When a device supports simultaneous connection to multiple mobile
networks, we want the "Mobile network" entry on the Network & internet
page to list the number of active SIMs and when clicked, go to a page
that lists them all.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: Ie642d7801cda07dcbbe74d42c234db6605566be4
2019-01-15 21:57:39 -08:00
Antony Sargent
0a830d4f48 Make Network & internet v2 feature flag be persistent
In ag/5386198 we added a flag to turn on the new features of the network
and internet settings page, but that flag resets to the default value
(currently false) every time you reboot, which is annoying and hostile
for dogfooders. This CL makes the flag persistent.

Bug: 116349402
Test: manual / should be covered by existing tests
Change-Id: I098073e81feb199751e967a9652bec6a6445b95e
2019-01-08 14:17:39 -08:00
Antony Sargent
e92e07eb97 Add subscriptions list to the multi-network header
The new UX for showing multiple active mobile plan subscriptions (SIMs,
eSIMs, etc.)  needs a header at the top of the Network & internet page
that shows wifi status and a list of active mobile subscriptions in the
form of one Preference per subscription.

This CL adds display of the mobile subscriptions to this header. It does
not yet show the correct summary text or do anything when you tap on
them - that will be coming in subsequent CLs. Also, since adding a
variable number of items to the top of the page messes up our current
strategy of having a fixed number of hidden items at the bottom based on
overall item count, this CL just makes all items visible. Subsequent CLs
can restore this behavior with dynamic adjustment.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: Ibfadf8cb61f6f5aff6ce38b7974267b1e4ddc719
2018-12-17 13:26:13 -08:00
Antony Sargent
2cbd720d21 Add a feature flag for new version of Network and internet settings page
In addition to adding the flag, this also adds a new xml layout that is
the same as the existing network and internet page, but will begin to be
changed in subsequent CLs. There is also a change in code to use this
new layout when the flag is turned on.

One other change is to make the list of displayed feature flags in
developer options be in sorted order instead of whatever semirandom
order they come out of the map's key set.

Bug: 116349402
Test: Manual (settings_network_and_internet_v2 flag should should up in
Settings -> System -> Developer options -> Feature flags, and those
flags should be in sorted order)

Change-Id: I5520d286efb6bec50ba4ca99f64aeca94f01d533
2018-10-31 05:29:34 +00: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
Ben Lin
3210396de9 Check for Data Usage intent before populating "Data Usage" summary.
On some devices, data usage is not available; thus, it is possible that
ACTION_DATA_USAGE_SETTINGS has no matching activity. If no matching
activity is found, we should not populate "data usage" in the summary
field.

Bug: 111398942
Test: Manual check. I see that data usage is no longer visible on
devices without Data Usage activity.
Test: make RunSettingsRoboTests

Change-Id: I838206b76497c6550ef4826ad19e605cd32906ee
2018-09-05 02:29:04 -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
Fan Zhang
25d9f3812b [Dynamic Home] Make a new page for all top level settings
Since we are moving conditionals/suggestions to a different place, there
is no need to use DashboardSummary to display top level settings any
more. We can simplify a lot of code for top level settings and reduce it
to a standard DashboardFragment.

- Create a new DashboardFragment + xml for all top level internal items
- Add a PreferenceController to provide summary for Network & internet
  item.
- Mark a bunch of things deprecated for future work.

Bug: 110405144
Test: robotests
Change-Id: I9f778777131c28eb836b722e089e026a59f5ddc6
2018-08-08 17:20:15 -07:00
Ben Lin
96dc235f6e Check for WiFi controller for summary population.
WiFiController might return not available, so we should only surface
"Wi-Fi" as a summary entry if it's available in the settings page.

This also checks for empty strings in case they are declared as such in
the XML (since XML can be device/product overlay'd), to avoid situations
such as ", data usage".

Bug: 111398942
Test: Manual check, and I see Wi-Fi no longer visible for cases where
Wifi controller isn't available.
Test: make RunSettingsRoboTests
Change-Id: I24736a6240c50e2ea38ce424fbac2316721290d8
2018-07-25 14:14:11 -07:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08: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
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
4db6aac464 Use ListFormatter to join strings for network dashboard
Test: robotests
Change-Id: Ie15512acb35c185f9a59bf268303b7993cc40947
2018-04-19 00:40:53 +00:00
Fan Zhang
da52162eba Merge "Fix an RTL issue in Network dashboard's summary text." into pi-dev am: d743f20618
am: fc47444c61

Change-Id: I0de8b7e6780768fe32fe5fe0eb3ae42c2f78f8d4
2018-04-16 18:47:22 -07:00
Fan Zhang
ae131c4786 Fix an RTL issue in Network dashboard's summary text.
Bidi wrap the word "Wi-Fi" so it's RTL'd correctly in all languages

Change-Id: Ia228b8f182ba6c7b5db5c310ecb54b25937e6ab7
Fixes: 78120642
Test: visual
2018-04-16 14:59:22 -07:00
Andrew Sapperstein
4eae68681c Merge "Remove menu from Network & Internet screen." into pi-dev am: 23035d558a
am: 3fdfb99375

Change-Id: I88a8e8d7ee77bafb5b8180d6d882d1ed9c09bd1f
2018-04-14 18:18:53 -07:00
Andrew Sapperstein
e358876bc1 Remove menu from Network & Internet screen.
Only one item was left "reset wi-fi, mobile & bluetooth"
which is also an option in Reset. So we're just removing
it so that there's no overflow menu at all.

Change-Id: I0298192667fb4ac2f58f51232ae2da1842e6c27e
Fixes: 77986130
Test: robotests
2018-04-13 13:48:05 -07:00
CY Cheng
f7e01e1294 Merge "Refactor airplane mode preference controller." into pi-dev am: 0375bbc709
am: 3d3e2609bc

Change-Id: I5e681d39a118bd88915815e4a27b561b57425171
2018-04-12 13:40:34 -07:00
CY Cheng
fee4807dc0 Refactor airplane mode preference controller.
- Convert inheritance from AbstractPreferenceController to
TogglePreferenceController.
- Register AirplaneModePreferenceController in XML.
- Decouple AirplaneModeEnabler with preference, leave the UI be
controled by PreferenceController.
- Add RoboTests test cases for AirplaneModePreferenceController.

Fixes: 67997339
Test: RunSettingsRoboTests
Change-Id: I7398943ed51345e014ee7aa774bfae1ca28632f1
2018-04-12 14:10:35 +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
Chalard Jean
42405603c7 Move the Private DNS dialog back to the top level.
Bug: 64133961
Fixes: 74844869
Test: visual test and interaction
      also updated tests and checked they pass
Change-Id: I7c8d50e5941c2a7dd46014932bdace14dc222c80
2018-04-02 09:58:12 +00: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
aed8994f6f Rename Indexable::getAllPreferenceControllers.
To getPreferenceControllers. "all" is redundant. Then internally, the
old getPreferenceControllers() is renamed to
createPreferenceControllers() to emphasize the controllers are created
from code (versus the ones created from xml).

Bug: 73668763
Test: robotest
Change-Id: Ifec46aefdc2a418031c8e152028b30bdcd396fc7
2018-02-23 16:37:28 -08:00
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08: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
05cb931a31 Add private dns dialog in wifi settings
This option lives in menu. A dialog will show up once this menu
is clicked.

We reuse most of the logic in go/aog/524415 with the following
updates:
1. Use radioGroup instead of directly control radioButton
2. remove bunch of methods if they are only used once.

Following cl will:
1. Remove this feature in development page
2. Add the help link at the bottom of the dialog
3. Disable "Save" button when hostname is invalid.

Bug: 68030013
Test: add for later

Change-Id: I4c6d359dc9c55675858c20e47953ef677b31c3b5
2017-11-13 14:53:14 -08:00
Fan Zhang
af6fce6335 Use pref controller to get non-indexable in network setting
Change-Id: I2bcc9047146f4ad014d5929e66ee895ee497b641
Fix: 62555826
Test: robotests
2017-07-11 14:58:38 -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
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