Commit Graph

240 Commits

Author SHA1 Message Date
Chiachang Wang
384b88e3fb Replace NetworkUtils methods
NetworkUtils is moved to connectivity mainline module which is
not accessible for module outside. getNetworkPart() method is
used by wifi lib and Settings but no usage inside the module,
so move the method to framework lib to share with wifi lib and
Settings.

Also, NetworkUtils.numericToInetAddress() method is also hidden
and deprecated. It should be replaced by
InetAddresses.parseNumericAddress().

Update the corresponding usage to refer to these methods.

Bug: 172183305
Test: atest SettingsRoboTests
Change-Id: I2fb674e0d7da0b11ba70177853fd6259bce372a3
2021-02-04 02:14:17 +00:00
Aaron Huang
f31cb783da Merge "Replace @hide API with public API" am: d52cff9b57 am: 3178dfc76a am: 68bdb8e8b8
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1566248

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I71dd0c79cdf216746d57ea6686c3d8141c721a57
2021-02-03 10:23:59 +00:00
Aaron Huang
3bb961affd Replace @hide API with public API
ProxyInfo is inculded in framework-connectivity module
which should not have external dependencies on its hidden API.
Thus, migrate getExclusionListAsString to getExclusionList.

Bug: 178777253
Test: build
Change-Id: I64b9d5be062bec43c7be3ea68d1f63054319df2d

Change-Id: I400df793fc669d0e574fb4cf022d021d99859d53
2021-02-01 19:16:23 +08:00
Jeremy Goldman
9d87cd9126 SubscriptionsPreferenceController shows the unique sim description.
Bug: 148303118
Bug: 150370656
Test: atest -c SubscriptionsPreferenceControllerTest
Change-Id: I041536fe0148087a068c6000383b382b0ff4e17c
2021-01-22 07:02:52 +00:00
Yan Zhu
460c2cbc0f Clean up split system user code in packages/apps/Settings/
Remove legacy code belonged to Andrometa project. Split system user
feature is always turned off now.

Bug: 137101239
Test: build, sync and reboot
Change-Id: Ieb84a6e131383dcd263a5d9b29a49dc64d905fe0
2021-01-12 16:57:49 -08:00
TreeHugger Robot
2acae9df4a Merge "[Wi-Fi] Support multi-SIM for SIM dependent EAP methods" into rvc-qpr-dev am: edd587c2a6 am: 48d768b00c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12167384

Change-Id: I559cee4b76432f72cab16b926ad7d8a2f87abedc
2020-08-07 12:04:56 +00:00
TreeHugger Robot
edd587c2a6 Merge "[Wi-Fi] Support multi-SIM for SIM dependent EAP methods" into rvc-qpr-dev 2020-08-07 11:37:27 +00:00
Arc Wang
b3952b0826 Merge "[Wi-Fi] Remove 'Do not validate' option in CA certificate spinner" 2020-08-01 02:32:08 +00:00
Arc Wang
33cde5dbee [Wi-Fi] Remove 'Do not validate' option in CA certificate spinner
"Do not validate" is not secure and must not be used in any production
network. R Suggestions API already does not allow connections with
no Root CA certificate.

Bug: 162466484
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test
      Manually add or edit  an EAP method Wi-Fi network and observe CA
      certificate spinner options.
Change-Id: Ica5ecf8805c51d7cdce7b16e02e0dd79d5f64754
Merged-In: Icf97199967faa2e359b0120a8c989bd1df2c6cea
2020-07-31 10:28:11 +08:00
Arc Wang
8734b131fb Merge "[Wi-Fi] Check if domain field is not empty when users choose a ca certificate" 2020-07-31 02:22:02 +00:00
Arc Wang
94b8579607 [Wi-Fi] Check if domain field is not empty when users choose a ca certificate
Domain is required for client to validate server's certificate.
This change disable Save button for a new Wi-Fi network of a
specified CA certificate but empty domain.

Bug: 161378819
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test
      manual
      1. Install a certificate.
      2. Add a new Wi-Fi network of EAP method PEAP
      3. Set CA certificate to the certificate installed at 1.
      4. Save button should be disabled.
      5. Input something in domain field.
      6. Save button should be enabled.
Change-Id: I65c8b29ec7a03b21403ddbfc087ce48c2a4a69e4
2020-07-31 10:06:48 +08:00
Arc Wang
21faffa23c [Wi-Fi] Remove 'Do not validate' option in CA certificate spinner
"Do not validate" is not secure and must not be used in any production
network. R Suggestions API already does not allow connections with
no Root CA certificate.

Bug: 162466484
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test
      Manually add or edit  an EAP method Wi-Fi network and observe CA
      certificate spinner options.
Change-Id: Icf97199967faa2e359b0120a8c989bd1df2c6cea
2020-07-31 09:58:20 +08:00
Arc Wang
8d5c8c2611 [Wi-Fi] Check if domain field is not empty when users choose a ca certificate
Domain is required for client to validate server's certificate.
This change disable Save button for a new Wi-Fi network of a
specified CA certificate but empty domain.

Bug: 161378819
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test
      manual
      1. Install a certificate.
      2. Add a new Wi-Fi network of EAP method PEAP
      3. Set CA certificate to the certificate installed at 1.
      4. Save button should be disabled.
      5. Input something in domain field.
      6. Save button should be enabled.
Change-Id: I65c8b29ec7a03b21403ddbfc087ce48c2a4a69e4
2020-07-29 15:13:28 +08:00
Arc Wang
c5c92eb342 [Wi-Fi] Remove the files which use SettingsLib Wi-Fi objects
This change removes

WifiDetailPreferenceController
WifiPrivacyPreferenceController

Bug: 152571756
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest
      Manualy add a Wi-Fi network of randomized MAC and a Wi-Fi network of device MAC
      in SetupWizard, then observe the MAC value in Settings Wi-Fi detail.
Change-Id: I82ef4e1d2c386d8bd751df8ff18c18163a0e9a6a
2020-07-28 17:36:41 +08:00
Arc Wang
2df3a3e7df [Wi-Fi] Support multi-SIM for SIM dependent EAP methods
Before this change, users are not able to choose SIM
card for SIM dependent EAP methods when a device supports
multi-SIM.

This change support to choose a SIM when adding an EAP
Wi-Fi network. And this change support to show the related
SIM information on Wi-Fi detail screen.

Bug: 142792009
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.WifiConfigControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.WifiConfigController2Test
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.details2.WifiDetailPreferenceController2Test
      Manually add an EAP Wi-Fi network of EAP-SIM type, observe the
      value in Wi-Fi detail screen.
Change-Id: I2910931166dc6541897663857c46abcc1b3115fa
2020-07-28 10:02:16 +08:00
Arc Wang
b33a59b860 [Wi-Fi] Add object comments for WifiTrackerLib migration
Migrating from Wi-Fi SettingsLib to to WifiTrackerLib, there are
both some Settings files of both version. Developers should
develop on new version files.

Bug: 152571756
Test: compile
Change-Id: I4446e2e333663bf69daa1ceff102775889021851
2020-04-27 14:28:13 +08:00
Arc Wang
57ff6599e7 Merge "[Wi-Fi] Fix Hidden network option scrolls to bottom problem" into rvc-dev 2020-04-10 07:50:49 +00:00
Arc Wang
d004dfc4b3 [Wi-Fi] Fix Hidden network option scrolls to bottom problem
Should not scroll to bottom since Hidden network option
is not at the bottom most.

Bug: 148036155
Test: manual
      Wi-Fi Setings -> Add network -> Advanced options ->
      click 'Hidden network' Yes -> should not scroll to bottom.
Change-Id: I6511f75441ebad62e2c28df76a39d702d78898a6
2020-04-10 13:19:30 +08:00
Arc Wang
98c17ee49f [A11Y][Wi-Fi] Fix multiple Spinner selected speak out at once.
When users select edit a Wi-Fi and select enterprise security,
there are multiple spinner shows with a default value.
This change does not allow TalkBack to speak out for multiple
Spinner text at one user selection.

Bug: 153272108
Test: manual
      Wi-Fi Settings -> Add network -> Security spinner
      -> WPA/WPA2/WPA3-Enterprise
      TalkBack should only speak out for the Security spinner.
Change-Id: Id9ab44e4da6d7abb5168e0ab7441ee1e226f5f68
2020-04-09 15:22:26 +08:00
Hai Shalom
5bb13ebefe [Settings] Use WifiConfiguration#setSecurityParams
Use WifiConfiguration#setSecurityParams instead of manually
initializing security params.

Bug: 150889755
Test: Created new connections and manually connected to open, WPA2,
WPA3, EAP and SUITE-B networks.

Change-Id: I42f4c21a37428ee87be14f6ba09dc54fa327054a
2020-03-09 22:25:56 +00:00
Arc Wang
9730b5aa86 [Wi-Fi] Ignore incorrect user certificates
These incorrect user certificates displayed when users
editing a Wi-Fi network of WPA3-Enterprise in 192bit.

Bug: 149763958
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest2

Change-Id: Iab35ac975933abc54fda83b99a2109d53d6722d4
2020-02-24 15:23:56 +08:00
David Su
8de938499e Merge "Rename requirePMF to requirePmf" 2020-02-14 18:27:15 +00:00
David Su
59ab4ce478 Settings: remove usage of WifiConfig helper methods
These methods can be replaced with methods on
IpConfiguration itself. There is no need to expose
these as a @SystemApi, and they are being removed.

Bug: 146046526
Test: make RunSettingsRoboTests -j40
Change-Id: I592f277f5e23bf58e76b8c48a0f0370d53cc6b81
2020-01-30 10:53:48 -08:00
David Su
930a4ec30e Rename requirePMF to requirePmf
Rename to conform to API guidelines.

Bug: 146046526
Test: compiles
Change-Id: Ib888ca3fc14cf30c9217b1f573c2279627c65a22
2020-01-27 17:47:15 -08:00
Arc Wang
a6ec144392 [Wi-Fi] Revert "support SAE password identifier in wifi dialog"
Revert it because SPEC is not clear now.

Bug: 143379656
Test: manual
      Click "Add network" in wi-Fi picker and edit a WAP3-personal Wi-Fi network

Change-Id: Ifa859d53c29d0fa83f22cc2d0e50294d0a5c7fc9
2020-01-10 11:53:12 +08:00
govenliu
91d6dfc455 [Wi-Fi] Hide the Advanced Option after expanding the advanced option fields.
To align with other advanced option behaviors in other Settings items, hide the Advanced Option button after the hidden advanced options are show, which also solve the a11y issue.

Bug: 146908469
Test: Add test case getVisibility_whenAdvancedOptionClicked_shouldBeGone
to verify View is Gone.
Change-Id: I11b2f9b250a7d50d32b8c05207498f4cf14feb41
2019-12-30 12:48:29 +08:00
Steven Liu
2bd1d93555 Remove those stuff about CarrierAp, they are removed from FW.
Bug: 130875004
Test: atest SettingsRoboTests
Change-Id: I549eabd1699a617dd6e639b725ade361c64d5a67
2019-12-12 10:38:38 -08:00
Arc Wang
5f23a43660 [Wi-Fi] Fix transition mode problems
Replace SECURITY_PSK_SAE_TRANSITION & SECURITY_OWE_TRANSITION with
AccessPpoint#isPskSaeTransitionMode() &
AccessPpoint#isPskOweTransitionMode()

Bug: 144320676
Bug: 144320649
Bug: 144325162
Bug: 144321574
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi

Change-Id: Ic3c7ac1238a51b6e215ed63761720d2bc371d012
2019-12-06 18:17:07 +08:00
Arc Wang
41661fe69c [Wi-Fi] Force users to select a phase2 authentication for PEAP & TTLS
To improve security.

Bug: 143601727
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigControllerTest
Change-Id: I0cb1ceda6d89a52224f80ea5ffd1af709a6acace
2019-11-20 10:59:23 +08:00
Arc Wang
75dc89b122 [Wi-Fi] Create WifiNetworkDetailsFragment related version 2 files for WifiTracker2 development
Create below version 2 files for WifiTracker2 development, we can
check the feature flag only a few times and easily remove version 1
files in the future.

    src/com/android/settings/wifi/details2/
    src/com/android/settings/wifi/savedaccesspoints2/
    tests/robotests/src/com/android/settings/wifi/details2/
    tests/robotests/src/com/android/settings/wifi/savedaccesspoints2/

Bug: 143326832
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi.details2
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi.savedaccesspoints2

Change-Id: I4d2caf1ce313871605252395764b02747240f217
2019-11-15 14:41:23 +08:00
Roshan Pius
f13145b323 Settings: Use public API for mac randomization support
Also, don't directly reference the default tether ssid overlay. This info
should always be retrieved from wifiManager.
This ensures that we don't use wifi overlays in settings.

Bug: 143464763
Test: atest com.android.server.wifi
Change-Id: I893a4ca0f4243e1eb6f9c8bef810d0b4a493fb88
2019-11-06 07:58:19 -08:00
Aaron Huang
9fd9700a8a Merge "Replace getNetworkPrefixLength() with public API" am: f67076dad5 am: 7b82097220 am: 5b182f20cb
am: 9c39357454

Change-Id: Id0f3c816bb95d891cfb9f0109c0afedb7494f222
2019-10-24 22:55:54 -07:00
Aaron Huang
9c39357454 Merge "Replace getNetworkPrefixLength() with public API" am: f67076dad5 am: 7b82097220
am: 5b182f20cb

Change-Id: Ib6f188586b486fa5af0a8df57a65db654f66e311
2019-10-24 22:49:20 -07:00
Aaron Huang
9251280615 Replace getNetworkPrefixLength() with public API
Use public API getPrefixLength() instead

Test: build pass

Change-Id: Ib85aa12dc22ac5b03c9bb7101beaf340014eb4fd
2019-10-24 10:51:53 +00:00
govenliu
116060e011 [Wi-Fi] [a11y] The "Advanced options" should be accessible by Voice Access and pronounced by talkback correctly.
The checkbox is unclickable via Accessibility.

Solution: Refine the solution of b/30079196 to let checkbox be focusable and clickable by Accessibility, and remove unnecessary Accessibility pronunciation strings.

Bug: 141588638
Bug: 141588161
Test: Add unit test to check the content description of the checkbox.
Change-Id: I2e7932f64ae29a13b793276eab6705009af20104
2019-10-17 17:10:17 +08:00
Arc Wang
44fa9d579d [Wi-Fi] Improve UX when there is no user certificate to choose for WPA-Enterprise 192-bit
Show error message when a user does not specify a user certificate
for WPA3-Enterprise 192-bit.

Bug: 138417816
Test: visual
Change-Id: Ifc519d484dbf78dad37ad7047e8b9bb40685d54c
2019-09-23 09:39:20 +08:00
Arc Wang
30c1767c0a [Wi-Fi] Fix robolectric test broken
1. WifiConfigController#setSelection triggers onItemSelect, it uses
   mEapUserCertSpinner without adapter.
2. refreshSummary should use parameter preference instead of mPreference.

Bug: 140771897
Test: WifiConfigControllerTest
      WifiWakeupPreferenceControllerTest

Change-Id: I963260bd82e7387052cacae89bdbe46da841e341
2019-09-10 11:41:35 +08:00
Jimmy Chen
33a05692f0 Merge "wifi: support OCSP in Wifi dialog for certifiate-based EAP type" 2019-09-09 02:23:07 +00:00
TreeHugger Robot
9ea11ac24d Merge "[Wi-Fi] Can't change EAP method for a saved enterprise Wi-Fi network" 2019-09-05 10:09:32 +00:00
Arc Wang
9db4bf7dbb [Wi-Fi] Can't change EAP method for a saved enterprise Wi-Fi network
Should only allow saved network UI initialization for once.

Bug: 140362368
Test: WifiConfigControllerTest
      manual:
      Manually change EAP method and other security fields for a saved
      Wi-Fi neterprise network.

Change-Id: Iddc1dae53849760f43b41b75262358dff6ba09af
2019-09-05 16:07:08 +08:00
Jimmy Chen
3612d3ebc9 wifi: support OCSP in Wifi dialog for certifiate-based EAP type
Bug: 136720092
Test: tested with OCSP supported profile
Change-Id: Ieb0fec5026ea06f88d44361d0c579be2a18ed99a
2019-09-05 15:39:12 +08:00
Arc Wang
31a79feccd [Wi-Fi] Can't change EAP method for a saved enterprise Wi-Fi network
Should only allow saved network UI initialization for once.

Bug: 140362368
Test: WifiConfigControllerTest
      manual:
      Manually change EAP method and other security fields for a saved
      Wi-Fi neterprise network.

Change-Id: Iddc1dae53849760f43b41b75262358dff6ba09af
Merged-In: Iddc1dae53849760f43b41b75262358dff6ba09af
2019-09-05 14:57:07 +08:00
Jimmy Chen
7157508edc Merge "wifi: support SAE password identifier in wifi dialog" 2019-08-28 15:31:18 +00:00
govenliu
c3eab6a9d9 [Wi-Fi] Hide SoftKeyboard temporary when user tap the advanced button.
When tapping on the advanced button during configuring a network, some items in the expanded list are covered by IME keyboard, which may cause user to ignore them accidently.

To improve it, hide the IME temporary to let user can see most of them.

Bug: 78441374
Test: Use ShadowInputMethodManager to check if the keyboard is hide or not after tapping on the advance button.
Change-Id: I0677d96febc90c66d1cf6f98555bbb436a654660
2019-08-20 10:55:44 +08:00
Jimmy Chen
d79363fec6 wifi: support SAE password identifier in wifi dialog
Bug: 138305265
Test: atest FrameworksWifiApiTests
Test: atest FrameworksWifiTests
Test: connect to a WPA3 SAE access point with different
      password/identifer combinations.

Change-Id: Idf1f82faaafa9c5f2212a0fa1dcc2eec53a9dbd5
2019-08-19 13:31:53 +08:00
govenliu
8d6e5d14cb [Wi-Fi] Add a new fragment for configuring a new AccessPoint network.
When configuring a new access point in Wi-Fi settings page, it's hard to figure out there are some other option items after you tapping the "Advanced options" button.

To improve it, use full screen fragment to present the configuration items, so user can see as many items as possible.

Bug: 31052996
Test: Mock this fragment and check each button status run as expected.
Change-Id: I1c8e552fcabb1414bb500d918ed61287bf4aece2
2019-08-10 21:01:01 +08:00
Arc Wang
bde8c0a64d [Wi-Fi] Remove unsupported EAP methods for WPA3-Enterprise 192-bit
1. Only support EAP-TLS for WPA3-Enterprise 192-bit
2. Remove "Do not validate" from the CA certificate menu
3. Remove "Do not provide" from user certificate menu

Bug: 135127581
Test: WifiConfigControllerTest
Change-Id: Ibf904da9407ec803afb8bb995e9df1a2e25f0dcb
Merged-In: Ibf904da9407ec803afb8bb995e9df1a2e25f0dcb
2019-08-08 14:52:08 +08:00
Arc Wang
eca48078d5 [Wi-Fi] Remove unsupported EAP methods for WPA3-Enterprise 192-bit - II
Refine code:
1. Change method name from getSpinnerAdapterWithEapMethods to getSpinnerAdapter
   and apply it to other Spinner adapters.
2. Change method name from getSpinnerArrayWithEapMethodsTts to
   getSpinnerAdapterWithEapMethodsTts and it will
   setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
   for adapters.
3. Remove the code of ag/8693033
4. Improve indentation.

Bug: 135127581
Test: WifiConfigControllerTest
Change-Id: I653eda11ca1b8235c5ecaa1a826a2fddd004d2e1
2019-07-25 14:51:35 +08:00
Arc Wang
6351f7c37a [Wi-Fi] Remove unsupported EAP methods for WPA3-Enterprise 192-bit - I
1. Only support EAP-TLS for WPA3-Enterprise 192-bit
2. Remove "Do not validate" from the CA certificate menu
3. Remove "Do not provide" from user certificate menu

To reduce review effort, I left refine code change in another CL.

Bug: 135127581
Test: WifiConfigControllerTest
Change-Id: Ibf904da9407ec803afb8bb995e9df1a2e25f0dcb
2019-07-25 14:27:41 +08:00
Hai Shalom
f2b52be493 Reject SUITE_B_192 network creation for non EAP-TLS
Reject creation of WPA3-Enterprise 192-bit network in Settings app if
the selected EAP method is not EAP-TLS, as mandated by the
specification.

Note that this is just a protection against invalid networks, a UI
change to prevent this in Settings will follow.

Bug: 135127581
Test: atest WifiConfigControllerTest
Test: Create invalid network, verify it is not saved
Change-Id: I2978c2c71a90433778b6187a986e3284e9095d41
2019-07-19 10:54:19 -07:00