Commit Graph

4 Commits

Author SHA1 Message Date
Weng Su
28be567a83 Show policy transparency dialog for Wi-Fi network restrictions
- In order to support various user restrictions of individual Wi-Fi networks, WifiEntry provides the hasAdminRestrictions method for unified management.

- Settings will refer to WifiEntry#hasAdminRestrictions to restrict individual Wi-Fi networks.

Bug: 289448751
Bug: 289951241
Test: manual test
atest -c LongPressWifiEntryPreferenceTest

Change-Id: Iae5996a87ee72a3073300c7f62dfa14a9f31c21d
2023-08-04 07:18:28 +00:00
Weng Su
10ef69316f Refine the check restriction function in WifiEntryPreference
- Move checkRestrictionAndSetDisabled function from WifiEntryPreference to necessary child-classes to avoid impacting other child-classes such as SavedAccessPointsPreference.

- Avoid adding ShadowRestrictedPreference to the unnecessary test class.

Bug: 233871529
Test: manual test
make RunSettingsRoboTests

Change-Id: Ia2145401558b293b5f4eaa0860f83b7d3bbab548
2022-10-13 03:52:08 +08:00
Weng Su
f86bdc9c69 Restrict WiFi network connection
- Use StandardWifiEntry#canConnect() to determine if the network should
  be disabled or not.

- Use StandardWifiEntry#getSummary() to retrieve the restriction message.

- Disabled WiFi network if it cannot connect.

- If WiFi network is connected or saved network, leave it enabled to
disconnect or configure.

- See the result screenshot in b/203168943#comment11

Bug: 203168938
Bug: 203168943
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=LongPressWifiEntryPreferenceTest
make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest

Change-Id: I04aafaa5b383598a0f87eea15d06b38bbc662b9e
2022-03-08 04:27:28 +08:00
Quang Luong
91dcd42319 Add WifiTrackerLib as separate dependency from SettingsLib
WifiTrackerLib should be removed from SettingsLib to avoid tying it to
SettingsLib's min_sdk_version. Modules that need WifiTrackerLib should
now explicitly add it as a static_lib.

Bug: 187099809
Test: build, make RunSettingsRoboTests
ROBOTEST_FILTER=WifiEntryPreferenceTest

Change-Id: I09b7cad0b3b17ba1a24c1200b7ea3255ca4e227f
2021-06-10 14:33:05 -07:00