Commit Graph

3286 Commits

Author SHA1 Message Date
David Su
9548db78b0 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: I495b3edc6e7a6bbb7bae287e8bdd88243e72da70
2020-12-22 18:07:34 +00:00
David Su
512ba3c3d1 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: I1747f52f18210bb05bcc414461bf95aa461577a6
2020-12-22 06:10:40 +00:00
Chalard Jean
95b575f468 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: If5d1e4a58fb2d6d9544e6d01995dabe445cf1f25
Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-12-16 11:44:22 +09:00
Xin Li
d31ee38811 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
Aurimas Liutikas
46a165215b Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Merged-In: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:30:12 -08:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
David Su
f535f0a044 Merge "LINK_CONFIGURATION_CHANGED broadcast: stop including EXTRA_LINK_PROPERTIES" into rvc-qpr-dev 2020-09-29 17:29:41 +00:00
David Su
cfb033e324 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:20 +00:00
Kai Shi
dc0c7a41ea 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-19 23:17:41 +00:00
Hai Shalom
08744836fe [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)
2020-09-03 00:35:42 +00:00
Les Lee
bae844a14d Merge "wifi: Support SAE_TRANSITION when converting to WifiConfiguration" into rvc-qpr-dev 2020-08-14 05:27:24 +00:00
lesl
43a326cdb3 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
2020-08-13 23:28:45 +08:00
Hai Shalom
c527eed123 [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
2020-08-12 21:28:08 +00:00
Nate Jiang
a03bcee783 [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)
2020-07-29 22:24:40 +00: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
Hai Shalom
faac9ca5a9 Merge "[DPP] Fix typo in javadoc for SUCCESS_CONFIGURATION_APPLIED" into rvc-dev 2020-04-03 20:21:34 +00:00
Hai Shalom
c5962ff651 [DPP] Fix typo in javadoc for SUCCESS_CONFIGURATION_APPLIED
Bug: 153015500
Test: No code changes
Change-Id: I3275680ccd6161b703ad60dbe82e558fc17e37e5
2020-04-01 15:55:20 -07:00
Chalard Jean
2da4f9f9ae Rename satisfiedBy into canBeSatisfiedBy
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1
2020-03-27 23:46:30 +09:00
Les Lee
d6f3212620 Merge "wifi: Support setBssid for tethered mode hotspot" into rvc-dev 2020-03-26 00:23:14 +00:00