Commit Graph

26 Commits

Author SHA1 Message Date
Bonian Chen
033d46c71c [Settings] Adjust code for performance
Reorder code flow to reduce redundent work.

Bug: 213836977
Change-Id: Ie83e41dd2664f0d7828c1e13060e669496c41591
Test: Junit VpnPreferenceControllerTest
2022-01-17 09:04:13 +00:00
Bonian Chen
3fe40484ba [Settings] Adjust code for performance
Reorder code flow to reduce redundent work.

Bug: 213836977
Change-Id: Ifd57d1f6a007d6a1c9bcae597e6e9674ce54d8bc
Test: Junit VpnPreferenceControllerTest
2022-01-14 08:41:46 +00:00
Bonian Chen
740809879f [Settings] Code refactor for modulization
Code refactor for clean up some internal dependencies.

Bug: 213836977
Test: Junit VpnPreferenceControllerTest
Change-Id: Ib6684c7b84bd04d9c1a015fa78d2c0ac5f1773c8
2022-01-11 15:55:13 +08:00
Bonian Chen
c2e72bc8ad [Settings] Code refactor for performance
Move some logic out of constructor to reduce the loading when launch UI.

Bug: 213836977
Test: Junit VpnPreferenceControllerTest
Change-Id: I90c7770f529b4710196697886e566dfe1be629e4
2022-01-10 17:09:32 +08:00
Zoey Chen
e714654c94 [Provider Model] Internal cleanup - remove Provider Model flag and deprecated legacy UI part.3
Test: atest DefaultSubscriptionControllerTest, NetworkProviderSettingsTest
Bug: 197066557
Change-Id: I7d29b58ca5476ae0bb6fe2e04fecb96164cb1ada
2021-11-17 13:09:48 +00:00
Jeremy Goldman
eecc97a339 Add additional strings to differentiate between single and multiple
insecure vpns

Although in english, the strings can be "N not secure", in other
languages translators have requested that we add "VPN" or "VPNs" after
the number for extra clarity. Thus, we split the string into two
depending on whether there is just one or more than one insecure VPN.

Bug: 184167494
Test: atest -c SettingsUnitTests
Change-Id: I93f0cbec5f22ffcac70ddc2ecf640729eef29c04
2021-04-14 11:52:38 +08:00
Jeremy Goldman
de9d641349 Update strings in main VpnPreference.
If there is an insecure VPN, don't display the name of the vpn in the
summary. Instead, display "Not secure" if there is only 1 total vpn
available, and display the number of insecure VPNs + " not secure."

Screenshot: https://screenshot.googleplex.com/9Bxn7frDm7aVHtG
Test: manual test (because the junit test for the controller has not yet
been cherrypicked into sc-dev)
Bug: 176821216
Change-Id: Ie454d9605effd5208457e8c91b08cc382d4992af
2021-03-25 03:23:36 +00:00
Jeremy Goldman
76de845f3d Connect VPN warning help icon with the network & internet page.
New VpnInfoPreference created to control the presence or absence
of the warning icon based on the vpn type.

The VpnPreferenceController type casts the preference based on
whether the provider model is enabled. It also detects legacy vpns
by using the LegacyVpnProfileStore, and comparing VPN profile
usernames with the active VPN config's user.

Screenshot: https://screenshot.googleplex.com/AfGrH8wRusTvbf4
Test: atest -c SettingsUnitTests
Bug: Bug: 176821216
Change-Id: I1aa93be5b90b404d9d9cb9bf47ea76fdc9aad401
Merged-In: I1aa93be5b90b404d9d9cb9bf47ea76fdc9aad401
(cherry picked from commit 7a68eb3b5e)
2021-03-24 01:07:28 +00:00
Bonian Chen
203f0fe89d [Settings] Code refactor - remove unused import lines
Remove some unused import lines within source code based on
https://source.android.com/setup/contribute/code-style

Bug: 182867979
Test: build pass
Change-Id: I76dbcfa9e5b435b2838401dfee15b12f472d07d0
2021-03-16 10:24:24 +00:00
Lorenzo Colitti
04d34ced59 Switch Settings from IConnectivityManager to VpnManager.
The VPN code is moving out of ConnectivityService to a new
VpnManagerService. Update Settings to call into the VpnManager
class instead of using the AIDL interface directly. This way,
the VPN code can be moved without touching Settings.

Bug: 173331190
Test: builds, boots
Test: manually verified VPN settings page
Change-Id: Id2731a166b5d6783acb1c711a54604b69aa8c0d7
2021-02-08 16:50:25 +09: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
Matthew Fritze
8f36eb8cfb Update airplane mode key to match framework constant
Change pref key for airplane mode to "airplane_mode" to match the
constant declared in SettingsSlicesContract.

Bug: 80106671
Test: robotests
Change-Id: I898befffbdafc3004fc127414edd04f60ff2554e
2018-05-22 18:51:11 -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
Doris Ling
0a66946d6b Use a different string for vpn summary.
- for legacy vpn config, we do not get the vpn name to show in the
preference summary, and we used to simply show "Connected" as the summary
text. However, the string was changed to include the connected device
name as the parameter. Change to use connected summary string that does
not requires any parameter.

Change-Id: Ia6191eb315f5f23e0e6bf8da2a9537c211e8188e
Fixes: 77618408
Test: make RunSettingsRoboTests
2018-04-12 14:04:10 -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
a7f135596d Switch to use ThreadUtils.postOnMainThread
Change-Id: I344d25a1a667de9c0b23d6d528d905b4da3a4c40
Fixes: 63896139
Test: rerun tests
2017-10-31 13:27:41 -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
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
Fan Zhang
50f82ac557 Update some strings to match spec
Change-Id: Iba242871fce9c9bca8fbbc5d3ad3f7948f35d3d0
Fix: 36234108
Test: make RunSettingsRoboTests
2017-03-16 09:59:42 -07:00
Fan Zhang
0ef0d5006d Display current vpn for Vpn preference summary text
Change-Id: Id9917a07e519d16e2000b4fa9888f783171e55f8
Fix: 34974598
Test: RunSettingsRoboTests
2017-02-13 13:22:48 -08:00
Fan Zhang
9b6f181340 Remove no-op handlePerferenceTreeClick from PrefControllers
Bug: 33429853
Test: RunSettingsRoboTests
Change-Id: I5633953e3d7b07f9006e541b96a24a2a769e2686
2016-12-07 15:34:31 -08:00
Robin Lee
8be8e626d2 Make Vpn.isAvailable return available, not unavailable
Also removed the check about secondary users. We already disable
adding a legacy VPN for secondary users inside the Settings page
itself.

We do not want to stop our users from configuring/disabling third
party VPNs, that's completely supported.

Bug: 23693383
Fix: 32308780
Test: manual, needs robotest
Change-Id: I99ab14b6b26582bdd7fc491c4b2542f3e653f3dc
2016-11-02 16:34:41 +00:00
Fan Zhang
242da31179 Fix logging spam in DashboardFragment.
When updating preferences managed through PreferenceController, the
fragment should skip prefs that are not available.

Bug: 32255863
Test: RunSettingsRoboTests
Change-Id: I2f9b6ddf8c78d40068dc18f07e60672dcba4474a
2016-10-25 17:14:47 -07:00
Fan Zhang
db1112a221 Add progressive disclsoure
- 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
2016-10-18 16:57:11 -07:00
Fan Zhang
7f1a4b5891 Add PreferenceControllers to Network page.
- Also made tiles refresh more efficient: when category changes, only
  refresh dynamic tiles. Static tiles from xml will not change due to
  category change.

Bug: 31799836
Test: RunSettingsRoboTests
Change-Id: I1e4c85f2c122c65ec99729e43a66c80acdd863c8
2016-10-12 15:04:39 -07:00