Commit Graph

3290 Commits

Author SHA1 Message Date
David Su
5da04524ce frameworks/base/wifi: unpack non-updatable/ folder
Everything remaining in frameworks/base/wifi is non-updatable.
Thus, unpack non-updatable/ folder and move everything under
wifi/.

Bug: 137323948
Test: presubmit
Change-Id: I6e1bd3fe6335b5dbe5f8ffa84a84df6434c95674
Merged-In: I6e1bd3fe6335b5dbe5f8ffa84a84df6434c95674
2020-12-29 11:23:15 -08:00
Baligh Uddin
3139f6d12c Migrate frameworks/base/wifi & frameworks/base/packages/OsuLogin
Migrate to packages/modules/Wifi.  This CL will be presubmit tested
once migration is complete.  This CL drops the code from
frameworks/base/wifi and migrated to packages/modules/Wifi.
Also adjusts visibility rules in frameworks/base/Android.bp
Bug: 137323948
Test: TH
Merged-In: Id02e28648e922a30d6a81cf92b39eff4ca3cc002
Change-Id: I28e35cea55001c2333374c2342f496a0340f2f32
2020-12-24 03:46:32 +00:00
David Su
e0e31770cd frameworks/base/wifi: Move migration_samples to non-updatable directory
This is not part of the Wifi module, move it to the non-updatable
directory.

Bug: 176105484
Test: compiles
Merged-In: Ia95e300da9286d79ee57c285c3bfa88ecc98e326
Change-Id: I94cced501d7ffc2602b7672fa10999b1a1a8e5f6
2020-12-22 18:02:26 +00:00
David Su
4e461c5a9f Split updatable/non-updatable Wifi APIs into separate directories
This creates a clearer boundary between what is updatable
(part of the Wifi module) and what is not updatable (outside
the module).

Bug: 176105484
Test: compiles
Merged-In: Ia95e300da9286d79ee57c285c3bfa88ecc98e326
Change-Id: I656786c81c832611fc308ea3e42571a90df3de1c
2020-12-22 06:08:35 +00:00
Chalard Jean
53273965e6 Merge "Move module utils to the module package." into mainline-prod 2020-12-11 02:07:48 +00:00
Chalard Jean
6e6390a612 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: I067eeecd458c34b7f2fbfa439072682661ac750c
Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-11-25 06:01:49 +00:00
Hai Shalom
806fd81a82 Make app installed cert flags persistent
Store AppInstalledRootCaCert and AppInstalledPrivateKey flags
in the config store to make them persistent. Resolves the issue
of certs that remain on the device after a connection is removed.
The reasone was that these flags were not persistent which caused
the logic to treat the certs as installed by the user.

Bug: 168871784
Test: Manually verify xml file contents
Test: atest XmlUtilTest
Change-Id: I06e93fa8688d1b483b68983d10b53fbe5acae32b
2020-10-13 16:55:14 -07:00
TreeHugger Robot
6a512dadfc Merge "Fix WifiConfiguration#getAuthType" into mainline-prod 2020-09-30 05:10:21 +00:00
TreeHugger Robot
5d7e9937ab Merge "wifi: Move SAP passphrase ascii encodable check to wifi-service" into mainline-prod 2020-09-30 04:27:50 +00:00
lesl
deb4384198 wifi: Move SAP passphrase ascii encodable check to wifi-service
Add new overlay config to allow OEM bypass SAP passphrase ascii
encodable check since it depends on HAL and driver.

Bug: 168688691
Test: atest FrameworksWifiApiTests
Test: Manual test to add non ascii passphrase
Change-Id: If573acece96faf59c7804c6178d0f0200164f88e
Merged-In: If573acece96faf59c7804c6178d0f0200164f88e
2020-09-30 00:48:02 +00:00
Hai Shalom
452d4ff8ff Fix WifiConfiguration#getAuthType
Fix WifiConfiguration#getAuthType and add unit tests. The root
cause for the crash is due to the outdated implementation of this
method. When adding a suggestion of a WPA2/3-Enterprise network
via the the ACTION_WIFI_ADD_NETWORKS action, Settings calls this
method. WPA2/3-Enterprise networks have more than 1 bit set in
the allowedKeyManagement bitset which the old implementation
treated as an error and threw an exception.

Bug: 169626258
Test: atest WifiConfigurationTest
Merged-In: I85796299f119b84781148c949d701d10da506dc2
Change-Id: I00e112388b392868b0aa9e0ccb8a9b72236bfa2c
2020-09-29 16:50:22 -07:00
David Su
de61515593 Merge "LINK_CONFIGURATION_CHANGED broadcast: stop including EXTRA_LINK_PROPERTIES" into mainline-prod 2020-09-29 17:29:51 +00:00
David Su
4e723cd3ed LINK_CONFIGURATION_CHANGED broadcast: stop including EXTRA_LINK_PROPERTIES
This extra is unused, and potentially exposes sensitive information
that can be accessed without any permissions.

Bug: 162246414
Test: atest FrameworksWifiTests
Change-Id: I57c3db765283d8bbb410a0b790e27054c5ab561a
Merged-In: I57c3db765283d8bbb410a0b790e27054c5ab561a
2020-09-23 17:12:06 +00:00
Kai Shi
ae9beaa5d3 Bug fix of 6GHz band channelization
Move up 6GHz band start and end frequencies by 10MHz per IEEE 802.11ax
draft 7.0 Annex E Table E-4.
Add the special case of 6G band channel 2.

Bug: 167426957
Test: atest android.net.wifi
Test: manual test with 6GHz capable STA and AP
Change-Id: I24c9c4d38c74681cd7318a9b052d9c2cd4ddf87f
Merged-In: I24c9c4d38c74681cd7318a9b052d9c2cd4ddf87f
2020-09-21 20:40:50 +00:00
Hai Shalom
5527268270 [Suggestion] Fix setWpa3EnterpriseConfig
Add missing support for standard WPA3-Enterprise networks, which
are basically WPA2-Enterprise networks + PMF.
Add missing support in the Specifier as well, and add unit tests
to cover these use cases.
The logic detects 192-bit or standard mode by looking at the
certificates. If the certificates are Suite-B, then the 192-bit
mode is enabled. Otherwise, standard mode is enabled.

Bug: 166670837
Test: atest WifiNetworkSuggestionTest WifiNetworkSpecifierTest
Change-Id: I875d0d0584d71fe6dd3fedc8f5371e0b5ed2e5e5
Merged-In: I875d0d0584d71fe6dd3fedc8f5371e0b5ed2e5e5
(cherry picked from commit e1369b6275)
(cherry picked from commit 08744836fe)
2020-09-18 09:48:15 -07:00
lesl
6599f52203 wifi: Support SAE_TRANSITION when converting to WifiConfiguration
In android R, framework use SoftApConfiguratio to replace
WifiConfiguration. The mapping function between WifiConfiguration and
SoftApConfiguration was desinged to return Null when the type doesn't
support in WifiConfiguration. Likes security type WPA3_SAE_TRANSITION.
But it causes the app crash because unexpected Null config.
Solution:
Add the mapping, SAE_TRANSITION to WPA2, when converting to avoid break
the legacy apps since WPA2 config also works normally when LOHS enabled on
WPA3_SAE_TRANSITION mode.

Bug: 163687359
Test: atest FrameworksWifiTests
Test: atest frameworks/base/wifi/tests/
Test: atest -c android.net.wifi.cts.WifiManagerTest#testStartLocalOnlyHotspotSingleRequestByApps
Change-Id: I6afba22e4081ba58884ffd1b560b81b1e9960132
Merged-In: I6afba22e4081ba58884ffd1b560b81b1e9960132
(cherry picked from commit 43a326cdb3)
2020-09-18 09:47:25 -07:00
Hai Shalom
7b6187b654 [Passpoint] Changes to Unique ID
Modify Unique ID calculation to use only FQDN for HomeSP hash
and modify the hash of the Credential to produce an identical
hash for user credential changes, except for username which will
result in a different hash, and generate a different hash for
SIM credential, Cert credential and realm changes.
The result would allow multiple profiles with SIM credential
or Cert credential for the same network and overwrite profiles
with updates to the user credentials with changes other than
the username.

Bug: 161008339
Test: atest com.android.server.wifi
Test: atest PasspointConfigurationTest CredentialTest
Test: Install an OSU profile, then install R1 profile for the
same network (HomeSP has a different friendly name), verify
the OSU profile has been overwritten

Change-Id: Ice11158078b5b86c721747b0d67ecfb09731a3c5
Merged-In: Ice11158078b5b86c721747b0d67ecfb09731a3c5
(cherry picked from commit c527eed123)
2020-09-18 09:47:00 -07:00
Nate Jiang
b56395f738 [NetworkSuggestion] Fix getEnterpriseConfig
Return null when getEnterpriseConfig() on a non enterprise WifiConfig.

Bug: 162031037
Test: atest android.net.wifi
Merged-In: I874b2f99fef693b34bad4b075eed595a0d89f392
Change-Id: I874b2f99fef693b34bad4b075eed595a0d89f392
(cherry picked from commit 1312174396)
(cherry picked from commit a03bcee783)
2020-09-18 09:46:48 -07:00
Les Lee
f9836b0186 Merge "wifi: Update API java to match new design" into rvc-dev 2020-06-24 11:31:24 +00:00
Jimmy Chen
edddaef9a8 Merge "wifi: add constant for OCSP field" into rvc-dev 2020-06-24 07:52:09 +00:00
Jimmy Chen
103e59b78b wifi: add constant for OCSP field
Bug: 143381682
Test: N/A
Change-Id: I3eb92e63e5eb240848ca637dd6819ab838effdac
2020-06-23 18:56:35 +08:00
lesl
92c8f596f2 wifi: Update API java to match new design
Update the java doc to match new behavior as below:

ClientControlByUserEnabled (true)
-> disconnect new/unknown MAC + Callback;
New clients will need to attempt again and
will be allowed/disallowed based on user action
in the previous callback.

ClientControlByUserEnabled (false=default)
-> allow new/unknown MAC + Callback;
New clients will not disconnect unless the user
chooses to disallow the client by adding to the blocklist.

Bug: 159582750
Test: atest FrameworksWifiTests
Test: make docs frameworks/base/wifi/
Change-Id: I64a85db0a28342003f902c50f81531b2218a6252
2020-06-23 08:59:32 +00:00
David Su
151f172b26 Merge "CONFIGURED_NETWORKS_CHANGED_ACTION: update docs since we stop sending WifiConfiguration" into rvc-dev 2020-06-23 03:06:37 +00:00
Nate Jiang
0a327227ce Merge "Use installed keystore alias to check if enterprise config is insure" into rvc-dev 2020-06-20 00:01:11 +00:00
Nate Jiang
9b39089eba Use installed keystore alias to check if enterprise config is insure
Bug: 158582707
Test: atest WifiEnterpriseConfigTest
Change-Id: Ic5818db5eac19b9480e1b30a8e596b176fdbee4b
2020-06-19 22:48:31 +00:00
TreeHugger Robot
4058b3b950 Merge "[WifiEnterpriseConfig] Update javadoc for setCaCert/Path" into rvc-dev 2020-06-19 20:17:59 +00:00
Hai Shalom
21f67c5fb0 [WifiEnterpriseConfig] Update javadoc for setCaCert/Path
Update javadoc for WifiEnterpriseConfig#setCaCert, setCaCerts and
setCaPath to document that if not set, then the server certificate
validation is skipped and the connection is not secure.

Bug: 159458442
Test: No code changes
Change-Id: Icb26b340f743faf129544a0d889dcb7bc1a76551
2020-06-19 11:30:44 -07:00
David Su
4bd54c477c CONFIGURED_NETWORKS_CHANGED_ACTION: update docs since we stop sending WifiConfiguration
WifiConfiguration contains sensitive location
information, so this extra is no longer included
in the CONFIGURED_NETWORKS_CHANGED_ACTION
broadcast. Update docs to reflect this change.

Bug: 158874479
Test: compiles
Change-Id: I72ba9f75a89519ef136cc2766a8551b606b218c7
2020-06-18 18:38:24 -07:00
Remi NGUYEN VAN
6555756e90 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Roshan Pius
afef7f5b53 WifiManager: Fix javadoc in addNetworkSuggestions
The line break in the {@link} seems to be causing the formatting issue.

Bug: 159123619
Test: Compiles
Change-Id: I2ab1bb4da19fe74c850d66532380f1a1da9e7e03
2020-06-16 09:20:58 -07:00
Remi NGUYEN VAN
eee629f4c7 Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Also refine comments in DhcpResults following feedback in previous
change.

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-06-12 17:04:06 +09:00
lesl
95536ee341 wifi: fix incorrect java doc
Bug: 158734072
Test: make docs frameworks/base/wifi/
Change-Id: I4627175cc52c066db58c624efa7c56cc423bc21b
2020-06-11 19:24:21 +08:00
TreeHugger Robot
7b1e3c55f3 Merge "[Suggestion] block setting insecure enterprise config" into rvc-dev 2020-06-08 16:57:02 +00:00
Hai Shalom
0fcf6ff4a3 Merge "[Passpoint] Clean up exception messages in PpsMoParser" into rvc-dev 2020-06-06 01:33:58 +00:00
Nate Jiang
94268fd2ab [Suggestion] block setting insecure enterprise config
If App set insecure enterprise config to suggestion builder, an
exception will be raised.

Bug: 157822251
Test: atest android.net.wifi
Change-Id: I2e7a2421be2c1574801b853a1dddaff1d115a1b2
2020-06-05 17:36:49 -07:00
Hai Shalom
8cbfba234f [Passpoint] Clean up exception messages in PpsMoParser
Clean up exception messages in PpsMoParser.

Bug: 158325667
Test: Compiles. No changes to logic.
Change-Id: Icf93aa3a30b8c985047a542301de34294da37405
2020-06-05 14:20:31 -07:00
Ahmed ElArabawy
82e45e391b Wifi: Add definitions for 6GHz
This commit adds some definitions for 6GHz

Bug: 139354972
Test: atest android.net.wifi
Change-Id: I2e3378a65cbf96c4249cb3c123712b8b20798dbe
2020-06-01 09:15:05 -07:00
Nate Jiang
57f81d36dc WifiNetworkSuggestion setIsMetered change to tri-state
setIsMetered: true for metered; false for not metered; not set for
detect automatically
Bug: 157341534
Test: atest android.net.wifi

Change-Id: If4c028e184b44ae53db80b94fe6d9ae7d06b3cb6
2020-05-28 23:58:54 -07:00
TreeHugger Robot
558351e00a Merge "WifiManager: Add a note for NETWORK_SETTINGS_RESET behavior" into rvc-dev 2020-05-15 23:21:38 +00:00
Roshan Pius
151cbf160b WifiManager: Add a note for NETWORK_SETTINGS_RESET behavior
Bug: 156657612
Test: Compiles
Change-Id: I668c625d5a0b20bbc9e3e1a5c15c1ada6e1fa2bb
2020-05-15 12:43:13 -07:00
Ahmed ElArabawy
8863a835cb Wifi: Add constant and utility method for bands
This commit adds a constant WIFI_BAND_ALL to refer to bit mask
for all bands.
It also adds a method to check on if previous scan covers all
supported bands.

Bug: 156053158
Test: atest android.net.wifi
Change-Id: I426dd3940b7efd67eaf6e12f862a1e3f0ebc177a
2020-05-12 09:33:25 -07:00
Ahmed ElArabawy
f7ccda0564 Wifi: Add definitions for bands frequency boundries
Channel frequency ranges for the three bands (2.4G, 5G, and 6G) are used
in different places with separate definitions or via literal numbers.
Also, the values are not accurate and sometimes not consistent.

This commit defines those ranges in a single place for use of other
classes. It also adds some utility methods that use those definitions.

Bug: 153896822
Test: atest android.net.wifi
Change-Id: Ifd19e245fd808c06d48d7557e30be3e92a9e7ec5
2020-05-11 09:44:53 -07:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Roshan Pius
79e555c4b9 WifiNetworkSpecifier.Builder: Fix formatting in build() javadocs
Bug: 146999777
Test: Compiles
Change-Id: I96fff2db5a285eeb2a1be36aa47a239939a9ae98
2020-04-22 08:40:53 -07:00
Roshan Pius
9f183e0108 WifiManager: Add @hide constant for sap
Reason code used to send out a disconnect when SAP is being shutdown.

Bug: 154286607
Test: Compiles
Change-Id: I3cb9b97960c1c9002435f23ba72ed14005a2d814
2020-04-20 10:11:01 -07:00
Roshan Pius
71709e04c9 WifiConfiguration: Add a method to check if keymgmt needs preShareKey
Bug: 153435438
Test: atest android.net.wifi
Change-Id: If67d853000d99f32204bf0b8b95465909e8740e2
2020-04-11 04:38:59 +00:00
Nate Jiang
69e1136884 Change doc for suggestion API
Add more explanation in doc, when app receive error code calling
suggestion API.

Bug: 150215899
Test: atest android.net.wifi

Change-Id: I8055546be8f12f807c35b9f50b239940a671482e
2020-04-09 18:18:01 -07:00
Roshan Pius
573e3fe6be WifiNetworkSpecifier: Ensure we don't match a regular wifi network
In Android 10, ClientModeImpl would always attach a
WifiNetworkAgentSpecifier for all wifi network agents created
(regardless of whether it was created in response to a specific request
or not). In Android 11, we changed that behavior to ensure that we
attach the WifiNetworkAgentSpecifier only for agents created in response
to a specific request. However, that is exposing a bug in
WifiNetworkSpecifier matching. WifiNetworkSpecifier attached requests
should not satisfy a generic wifi network agent. Fix the
canSatisfiedBy() matching to ensure that it only matches
WifiNetworkAgentSpecifier (or itself which cannot happen during network
matching)

Bug: 149500993
Test: Add a saved network manually while running the failing ACTS test:
act.py -c wifi_manager_cross.config -tb dut-name -tc WifiNetworkRequestTest:
test_match_failure_with_invalid_ssid_pattern
Test: atest android.net.wifi

Change-Id: I38d154bd0a5685fcc38de891256a8e1d4b8cfbb5
2020-04-07 06:45:46 +00:00
Roshan Pius
8a31e59ece Merge "WifiManager: Update doc for new metered change behavior" into rvc-dev 2020-04-04 00:31:04 +00:00
Roshan Pius
12e167b30e WifiManager: Update doc for new metered change behavior
Also, explictitly mark OVERRIDE_NOT_METERED in WifiConfiguration
when suggestion is not metered.

Bug: 153127005
Test: Compiles
Change-Id: I917de747406167fc38faa05e15d98a9b867a6ce8
2020-04-03 13:27:50 -07:00