278 Commits

Author SHA1 Message Date
James Mattis
4a3e2c1e93 Swap param order in registerSoftApCallback
Moving executor to be the first argument in registerSoftApCallback.

Bug: 144379300
Test: atest FrameworksWifiApiTests:android.net.wifi.WifiManagerTest
Manually on pixel 3

Change-Id: I7074278d16beac422ce7b29d4471b2794fa97825
Merged-In: I7074278d16beac422ce7b29d4471b2794fa97825
2019-11-18 13:48:29 -08:00
James Mattis
190e1cacde Marking SoftApCallback methods as SystemAPI
Making SoftApCallback methods available to @SystemAPI including
the API for registration of a SoftApCallback. This includes updating
registration to use an executor now vs a handler.

Bug: 143564153
Test: atest FrameworksWifiApiTests:android.net.wifi.WifiManagerTest
Also tested manually on a Pixel 3.

Change-Id: I22b5029a8dbd7a50ad6faf0bb3b15269af839956
Merged-In: I22b5029a8dbd7a50ad6faf0bb3b15269af839956
2019-11-14 10:48:33 -08:00
James Mattis
201a319860 Support for hotspot client visibility.
Adding support for visibility into clients that connect to an active hotspot.

Bug: 137309578
Test: atest FrameworksNetTests:com.android.server.connectivity.TetheringTest
atest FrameworksWifiApiTests:android.net.wifi.WifiManagerTest
atest FrameworksWifiApiTests:android.net.wifi.WifiClientTest
Tested manually on Pixel 3.

Change-Id: I1caeb10bc50202873e760a76b346bccd941e2574
Merged-In: I1caeb10bc50202873e760a76b346bccd941e2574
2019-11-11 22:10:35 -08:00
Roy Want
2d2b916cd3 Increased precision of Lat/Lng decoder and enabled BSSID list to be explicit (client)
Bug: 139448024
Bug: 139448573
Test: All tests pass (with increased precision), end-to-end tests pass.
Change-Id: I1e1dd3b26df707279e6cc2d59951f28d7878efe8
2019-08-16 21:11:21 +00:00
Otto Seiskari
f442263a08 Fix tests/runtests.sh
The location of FrameworksWifiTests.apk installed by the script
with adb seems to have changed. The path of the APK contains the
TARGET_ARCH environment variable, which is now fetched
with a similar method as in system/netd/tests/runtests.sh.

Noticed the issue with "lunch aosp_x86_64-eng". Before this fix,
the test script produced an error:

    adb: failed to stat [...]/FrameworksWifiApiTests.apk:
    No such file or directory

Bug: 128603658
Test: ./frameworks/base/wifi/tests/runtests.sh

Change-Id: Id4a33ca89fa21a9a4ef791c5c1c5760e0e2badaf
Signed-off-by: Otto Seiskari <otto.seiskari@indooratlas.com>
2019-04-26 17:00:05 +00:00
Jimmy Chen
834487249d p2p: unit tests for WifiP2pWfdInfo
Bug: 130138124
Test: atest FrameworksWifiApiTest
Change-Id: I7368f9b4f3e67985f404f701e92dfe82286935be
Merged-In: I7368f9b4f3e67985f404f701e92dfe82286935be
2019-04-11 11:12:33 +08:00
Jimmy Chen
1c4257ddb2 p2p: unit tests for WifiP2pInfo
Bug: 130138124
Test: atest FrameworksWifiApiTest
Change-Id: I7a6bec4faf81ec6e9164b8737588a51503caaaf7
Merged-In: I7a6bec4faf81ec6e9164b8737588a51503caaaf7
2019-04-11 11:12:27 +08:00
Jimmy Chen
b20dfbbf23 p2p: unit tests for WifiP2pProvDiscEvent
Bug: 130138124
Test: atest FrameworksWifiApiTests
Change-Id: I3eb9f7bcd19e1ec074174cdb2a6822fb983976ba
Merged-In: I3eb9f7bcd19e1ec074174cdb2a6822fb983976ba
2019-04-11 11:12:20 +08:00
Jimmy Chen
25eb12cd7f p2p: unit tests for WifiP2pDeviceList
Bug: 130138124
Test: atest FrameworksWifiApiTests
Change-Id: I53d05702a50509117720a10f50df93e496ff9d65
Merged-In: I53d05702a50509117720a10f50df93e496ff9d65
2019-04-11 11:12:11 +08:00
Jimmy Chen
be65fa391d p2p: unit tests for WifiP2pConfig
Bug: 130138124
Test: atest FrameworksWifiApiTests
Change-Id: I5cb6c9e0c0125d87672401e0dbd227b646a3a9d4
Merged-In: I5cb6c9e0c0125d87672401e0dbd227b646a3a9d4
2019-04-11 11:11:56 +08:00
Jimmy Chen
3fbdff2dec p2p: unit tests for P2P UPNP service discovery
Bug: 130138124
Test: atest FrameworksWifiApiTests
Change-Id: Id3218378e6548ca013484f5f693db1863bf419e1
Merged-In: Id3218378e6548ca013484f5f693db1863bf419e1
2019-04-11 11:11:50 +08:00
Jimmy Chen
50902313c2 p2p: unit tests for P2P DNS SD service discovery
Bug: 130138124
Test: atest FrameworksWifiApiTests
Change-Id: I454441ab024f1a72f2e5a92e08894993be749d3d
Merged-In: I454441ab024f1a72f2e5a92e08894993be749d3d
2019-04-11 11:11:44 +08:00
Jimmy Chen
97e310111f p2p: unit tests for WifiP2pGroup
Bug: 130138124
Test: atest FrameworksWifiApiTests
Change-Id: I40818ac3ab02facecb0976cf4cd5ab0ca18d84d5
Merged-In: I40818ac3ab02facecb0976cf4cd5ab0ca18d84d5
2019-04-11 11:11:39 +08:00
Jimmy Chen
d5d85c28a7 p2p: unit tests for WifiP2pGroupList
Bug: 130138124
Test: atest FrameworksWifiApiTests
Change-Id: I51f6fb88983ce8d0f45139241954ca1de1553fcf
Merged-In: I51f6fb88983ce8d0f45139241954ca1de1553fcf
2019-04-11 11:11:24 +08:00
Etan Cohen
903c9bd539 [AWARE] Enable discovery/operation on 5G
Speed up discovery, increase robustness.

Bug: 129151127
Test: atest android.net.wifi
Test: atest atest com.android.server.wifi
Test: ACTS ThroughputTest:test_iperf_single_ndp_aware_only_ib
Change-Id: I83cf0720d07e5623b7861bf4cd73344bcff90ba5
2019-04-09 13:22:05 -07:00
Etan Cohen
6d98837eb6 Merge "[AWARE] Add unit test - fix hashing bug" into qt-dev 2019-04-08 18:21:58 +00:00
Etan Cohen
09231fb6e2 [AWARE] Add unit test - fix hashing bug
Adding unit tests to verify hashing code uncovered a bug (hashing
arrays) - fixed.

Bug: 130051430
Test: atest android.net.wifi
Test: atest com.android.server.wifi
Test: ACTS ThroughputTest:test_iperf_single_ndp_aware_only_ib
Change-Id: I4c654dd656b4bd1bce8077c73c66f458d103bc86
2019-04-06 22:28:35 -07:00
Roshan Pius
e602db5fb9 WifiScannerTest: More unit tests
Bug: 130035791
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ic4eb56fc3ba6bffd3df529432d17af0ba35b6333
2019-04-05 15:16:56 -07:00
Roshan Pius
35b304d2ff WifiScannerTest: Add unit tests
Bug: 130035791
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I7ba66213363cfd43a3c7d42e000165368dadeb8d
2019-04-05 15:16:56 -07:00
Roshan Pius
aca5281331 WifiManagerTest: Add unit tests
Bug: 130035791
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I4b4dba445e5f9fc2abfed584bc8bea5e4d0d8d8f
2019-04-05 15:12:10 -07:00
Oscar Shu
80dde957d2 Merge "new WifiConfiguration @hide API to get SSID + SecurityType" 2019-03-30 00:00:59 +00:00
xshu
0fa11fe4fc new WifiConfiguration @hide API to get SSID + SecurityType
Refactor for server side usage.
There is no funcational change.

Bug: 128911090
Test: unit tests
Change-Id: I84983d095ec70ba41325736f95235f09ece2c494
2019-03-29 12:39:13 -07:00
Hai Shalom
69d504b541 [WPA3/DPP] Add unit tests for WPA3, OWE and DPP feature support APIs
Add unit tests to verify feature support public APIs:
isEnhancedOpenSupported
isWpa3SaeSupported
isWpa3SuiteBSupported
isEasyConnectSupported

Test: atest WifiManagerTest
Bug: 129543813
Change-Id: I3a3b0a7a40d36a377c59e16450fe68b43f012177
2019-03-29 09:48:16 -07:00
Hai Shalom
f8865bd2d8 Merge "[WPA3] Initialize Suite-B ciphers correctly based on the CA cert type" 2019-03-24 16:46:58 +00:00
Kai Shi
555ae2e92e Wifi Usability: address comments from API review council
Rename getIsSameRegisteredCell() to isSameRegisteredCell().

Bug: 128919394
Test: wifi unit test with frameworks/base/wifi/tests/runtests.sh
Change-Id: I3549d9abbaba87971ea3c0a9edf4351289731912
2019-03-22 15:19:54 +00:00
Hai Shalom
90147e3222 [WPA3] Initialize Suite-B ciphers correctly based on the CA cert type
Initialize Suite-B ciphers correctly based on the CA cert type. Read the
cert type from key store, parse it and get the signature algorithm.
Enforce SHA384, and initialize AllowedSuiteBCiphers based on the
certificate type: RSA or ECSDA.

Bug: 128861164
Test: Verify Suite-B initialized correctly with RSA and ECDSA certs.
Test: Associate to SUITE_B_192 AP.
Test: atest WifiNetworkSuggestionTest
Change-Id: Ia9b8460caa586f695ed7aab3507ddeb4ecb8c3f3
2019-03-21 13:41:32 -07:00
Etan Cohen
d7c6a26a87 Merge "[AWARE] Update Aware NetworkSpecifier API per API council feedback" 2019-03-21 15:54:02 +00:00
Etan Cohen
28b6d6a936 [AWARE] Update Aware NetworkSpecifier API per API council feedback
API council feedback:
- Move required builder methods to the constructor
- Add IntRange to port and transport protocol APIs

Bug: 128904106
Test: atest android.net.wifi.aware
Test: atest com.android.server.wifi.aware
Test: CtsVerifier Aware tests
Change-Id: I9bc978732caeada792e997bdd6263a53efdf7071
2019-03-20 07:37:32 -07:00
Kai Shi
06d82fb327 Merge "Wifi usability: add four new fields to report the latest celluar signal strength" 2019-03-19 16:39:48 +00:00
Hai Shalom
ae8eb88f2f [Wi-Fi] Do not delete certs when forgetting network
Deleting EAP Wi-Fi configuration deletes shared credentials used by other
configs. To resolve this issue the following changes were implemented:
1. When manually adding Wi-Fi certs from storage, Wi-Fi will not attempt
to delete them when network is removed.
2. When apps use WifiEnterpriseConfig#setClientKeyEntry to add certs,
they will be deleted if the network is removed.
3. Allow the user to delete Wi-Fi certs the same way that allows the
user to add them. Make the "Remove" option available, and implement key
store removal in settings.

Bug: 30248175
Test: atest WifiEnterpriseConfigTest
Test: Load certs, remove certs from credentials menu
Test: Load cert, create 2 EAP networks that use it, forget one network
Change-Id: I5bb1a1e02437b4db4a9c0a289acc074c30a786ab
2019-03-15 13:47:02 -07:00
Roshan Pius
fdb80fc14e wifi: Fix runtest.sh
Bug: 128603658
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ica4754d2ed4154a1292ff4f0b65ac34cb281bee1
2019-03-14 09:16:23 -07:00
Roshan Pius
198fa8adbf WifiNetworkSpecifier/Suggestion: Address API council comments
Modified builder methods to:
a) Add boolean input for all boolean setters.
b) Add a public value for unassigned priority and added IntRange
annotation.

Bug: 128317241
Bug: 128317186
Test: Compiles
Test: ./frameworks/base/wifi/tests/runtest.sh
Change-Id: Iaf9d26ed857fe9337d3e4006c9c894efbcfa32dd
2019-03-14 07:51:25 -07:00
Kai Shi
dfef383995 Wifi usability: add four new fields to report the latest celluar signal
strength

cellularDataNetworkType
cellularSignalStrengthDbm
cellularSignalStrengthDb
isSameRegisteredCell

Bug: 123095038
Test: Unit tests for Wifi: frameworks/base/wifi/tests/runtest.sh

Change-Id: I090e2ab1a327894dfc84e6ce880e887311e1df7d
2019-03-12 15:42:29 -07:00
Mingguang Xu
e05b0ec4da Merge "Wifi usability: Comments from API review council are addressed" 2019-03-12 18:21:08 +00:00
Quang Luong
1fc84caa29 Merge "Added Passpoint prefix to Passpoint related methods in WifiInfo" 2019-03-12 02:29:06 +00:00
Etan Cohen
0ccb0c81c7 [AWARE] Move WifiAwareNetworkSpecifier Builder to its parent class
Note: API only change - no functional changes

Move the Builder class and method which generates WifiAwareNetworkSpecifier
to the class it actually builds and have it return that type.

Per API council feedback to match standard builder patterns.

Bug: 126700127
Test: builds + make docs
Test: atest com.android.server.wifi.aware
Test: atest android.net.wifi.aware
Test: atest SingleDeviceTest (CTS)
Change-Id: If4d58e96b4a268df7afe58bc3d883b6c54ec889d
2019-03-10 18:15:31 -07:00
Mingguang Xu
e77cabc488 Wifi usability: Comments from API review council are addressed
Addressed all comments from API review council:
1. Rename WifiUsabilityStatsListener to OnWifiUsabilityStatsListener.
2. Change the modifier of member variables in WifiUsabilityStatsEntry.java to private and use getters.
3. Document the unit of predicitonHoirzonSec and its expected range.
4. Add @ProbeStaus in probeStatusSinceLastUpdate.
5. Rename probeElapsedTimeMsSinceLastUpdate to
ProbeElapsedTimeSinceLastUpdateMs.
6. Marked @NonNull for Argument 3 in onWifiUsabilityStats.

Bug: 126391553
Bug: 126699865
Bug: 113262380

Test: frameworks/base/wifi/tests/runtests.sh

Change-Id: I20d9ad05dc0bb537b09006ca44a447401b3e1001
Signed-off-by: Mingguang Xu <mingguangxu@google.com>
2019-03-08 17:24:27 -08:00
Quang Luong
2a6cdc554e Added Passpoint prefix to Passpoint related methods in WifiInfo
Passpoint prefixes were added and changed getter methods to public API

Bug: 127544936
Test: atest AccessPointTest && atest WifiInfoTest
Change-Id: I445606e76352dfc445344109be735da4bbab12be
2019-03-08 17:16:38 -08:00
Jimmy Chen
367763b99c Merge changes I105589aa,I3674fd5b,I215962fa,I5ca97e26,Ib47a1a6d
* changes:
  p2p: add valid string documentation for network name and passphrase
  p2p: rename the annotation to match the API names.
  p2p: add annotation for WifiP2pConfig.Builder public API
  p2p: add annotation for WifiP2pConfig.Builder public API
  p2p: add annotation for WifiP2pConfig.Builder public API
2019-03-07 02:45:12 +00:00
TreeHugger Robot
a89f1caec9 Merge "[WPA3] Add missing SUITE_B_192 to getKeyIdForCredentials" 2019-03-07 02:18:38 +00:00
Jimmy Chen
a969d029b3 p2p: add valid string documentation for network name and passphrase
Bug: 126614191
Test: Unit tests - atest FrameworksWifiApiTests
Change-Id: I105589aa3b6ee184be7fe82a8b657c76247f9ad6
2019-03-07 10:13:14 +08:00
Roy Want
d34680d2d2 RTT LCI API *UPDATE* (Client Side)
Bug: 111439464
Test: All unit tests pass; end-to-end tests pass.
Change-Id: I026f0cdec93df8f54ad4f8f24df0258cceb87b6e
2019-03-06 13:18:16 -08:00
Hai Shalom
0a26418779 [WPA3] Add missing SUITE_B_192 to getKeyIdForCredentials
Add missing SUITE_B_192 to getKeyIdForCredentials.
Add new unit test.

Bug: 127651674
Test: atest WifiConfigurationTest
Change-Id: I0961f332e25e06bb253593407f338f5197f39099
2019-03-06 11:41:29 -08:00
Roshan Pius
ede298f966 WifiConfiguration: Add @hide method to set security params
Setting of these security params is duplicated in multiple parts of the
wifi stack. So, centralize this.

a) Move the security type enum from ScanResultMatchInfo class internally
into WifiConfiguration. (Note: Values don't change, just the name & location
since this is being persisted in multiple places)
b) Add a helper method to set the various security params required for
each security type.

Also, removed setting defaults in WifiNetworkSpecifier &
WifiNetworkSuggestion. This will anyway be handled by WifiConfigManager
on network addition. There is no need to replicate this in the API
surface.

Bug: 124071722
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I382c497dfe331ee59f3560a8272b0e4ecf6ff8fc
2019-02-26 21:46:37 -08:00
Jimmy Chen
f33cb878f4 p2p: sanity check for network name
Bug: 120259460
Test: Unit test - atest android.net.wifi.p2p.WifiP2pConfigTest
Change-Id: I4ba5643a9fdded7b9f9837a21b24a89fac98a5ce
2019-02-26 06:10:22 +00:00
Hsiu-Chang Chen
2a2e15cb78 Merge "p2p: fix the copy constructor of WifiP2pDevice" 2019-02-23 01:27:15 +00:00
Ecco Park
3f94ad15cd Passpoint: add FQDN and Provider name field in WifiInfo
As part of new Passpoint UX, quick Setting and "Network &* internet"
screen of Settings needs to present Provider name when Passpoint AP is
connected instead of displaying SSID of the AP.

In addition, Wifi Picker needs to match current passpoint connection
info with Passpoint AccessPoint by FQDN.

So, the two fields are added in WifiInfo

Bug: 124462043
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: Tested with Passpoint AP and confirmed that the info is set
correctly.
Change-Id: I7215cba671e1c7eb07fbacb9d546d810cc26e826
Signed-off-by: Ecco Park <eccopark@google.com>
2019-02-15 10:16:12 -08:00
Etan Cohen
a3be9e2506 Merge changes from topic "parcelable_peer_handle"
* changes:
  [AWARE] Create a Parcelable version of PeerHandle
  Revert "[AWARE] Make PeerHandle parcelable"
2019-02-12 00:13:47 +00:00
Etan Cohen
bd0ebf80b4 [AWARE] Create a Parcelable version of PeerHandle
Extend PeerHandle to create a parcelable version. Cannot simply
add parceling to the original class since it is not version safe
(new apps running on old operating systems will crash).

Bug: 119594815
Bug: 122984982
Test: atest android.net.wifi.aware
Change-Id: If6edb9f43ad89d1438eb0969292fe55904677d2d
2019-02-08 08:29:43 -08:00
Etan Cohen
ea792225c4 Revert "[AWARE] Make PeerHandle parcelable"
This reverts commit a36b5c5815e0b3e8aef7ba7866a82773b0945561.

Can't change the behavior of PeerHandle in-place. Will create
a new class which extends it.

Bug: 122984982
Test: atest android.net.wifi
Change-Id: I14da17680fcbf20ece84631896d10cfaa53e33dc
2019-02-08 08:29:15 -08:00