Commit Graph

2417 Commits

Author SHA1 Message Date
Jimmy Chen
7dbcb4ea9c p2p: fix javadoc tag for interface reference
Bug: 64695709
Test: build
Change-Id: I74a48a9deb42f0a38133e6da0339981ab1824795
2018-11-29 18:43:09 +08:00
Jimmy Chen
f20ea0fa14 Merge "p2p: WiFi Direct API for requesting p2p info" 2018-11-29 04:57:32 +00:00
Roshan Pius
d5f319235b Merge "WifiNetworkConfigBuilder: Add support for SAE, OWE & SuiteB" 2018-11-27 00:13:42 +00:00
Ecco Park
ec55a1fe53 passpoint-r2: add not found failure for osuProvider
Bug: 119514793
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP
Change-Id: Iabc5bea2c3ca581061d34300c139c0bc7ee38bc8
Signed-off-by: Ecco Park <eccopark@google.com>
2018-11-21 22:26:53 -08:00
Roshan Pius
f51f7cfbea WifiNetworkConfigBuilder: Add support for SAE, OWE & SuiteB
Also, modified existing WPA2 API's to be symmetric with the new WPA3
API's.

Bug: 113878056
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I2f521e3893a8e5592757bd8aa7706f9145496de0
2018-11-21 09:01:43 -08:00
Jimmy Chen
52c949464d p2p: WiFi Direct API for requesting p2p info
Sticky broadcasts is planned to be eliminated. Because some
information is only in these broadcasts, provide API to retrieve
them on demand.

Bug: 64695709
Test: manual test
Test: Unit tests - atest frameworks/opt/net/wifi/tests/wifitests
Change-Id: I88167991a1af6b49d3f976bff1a88f59f6d6adfb
2018-11-21 11:56:12 +08:00
Roshan Pius
eb9f8195db Merge changes from topics "abort_network_request", "untrused_network", "on_match_scan_results", "network_suggestions_impl"
* changes:
  WifiManager: Add abort callback for network request
  WifiNetworkAgentSpecifier: Allow satisfiedBy call for 2 instances
  WifiConfiguration: Add a field to mark network as trusted
  WifiManager: Send list of matching scan results for network request
  WifiManager: Implement network suggestion API
  wifi(API): Send directed broadcast post connection for suggestions
2018-11-17 03:52:04 +00:00
Roshan Pius
7d18334f1d WifiManager: Add abort callback for network request
Add a callback to inform the UI that the active request has been
aborted.

Bug: 113878056
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I85bc1aee37af66b57471a7abf67dec55b13f97b0
2018-11-16 13:22:34 -08:00
Roshan Pius
9a8e181086 WifiNetworkAgentSpecifier: Allow satisfiedBy call for 2 instances
The specifier created for wifi network agent will end up being compared
with itself whenever there is a capability update sent for example.

Test: ./frameworks/base/wifi/tests/runtests.sh
Test: act.py -c wifi_manager.config -tb dut-name -tc WifiManagerTest
Change-Id: Id8c28fd96ac298df2c17f94476abf9cdbc5d23c9
2018-11-16 13:22:30 -08:00
Roshan Pius
db99b31cfa WifiConfiguration: Add a field to mark network as trusted
The |ephemeral| field (added for WFA) is currently used for 2 purposes:
a) Network is not persisted & network config
is automatically removed at the end of the connection.
b) Network is marked untrusted (in NetworkInfo capabilities) after connection.

For the new network request API, we want (a), but not (b) (Network should
be marked trusted because user explicitly allowed it).

Add a new flag to explicitly mark the network as trusted or not. Hence
(a) & (b) are now indicated by different flags.

Bug: 113878056
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: If4da84ca4fc03fd6a835b71a3e18e966c3b11f05
2018-11-16 12:13:39 -08:00
Roshan Pius
dc69f46807 WifiManager: Send list of matching scan results for network request
Change the arguments for the onMatch() callback to return a list of
|ScanResult| instead of |WifiConfiguration|. This allows the settings UI
team to reuse the existing infrastructure used for presenting list of networks in
the wifi picker UI.

Bug: 113878056
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ic7e0665bbef35a52df77be4d3c0574b01e0c8193
2018-11-16 12:13:39 -08:00
Roshan Pius
98b14ec2cb WifiManager: Implement network suggestion API
Bug: 115504887
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Iddbd4884f2af7ef4a8c2b32daa8268540ba8dce6
2018-11-16 12:13:39 -08:00
Roshan Pius
6a554a54b5 wifi(API): Send directed broadcast post connection for suggestions
Based on feedback received, moving away from using a PendingIntent for
post connection action (PendingIntent's are impossible to persist &
maybe too heavy for our use-case). We'll now send out a simple directed
broadcast to the app that added the network suggestion.

Also, added annotation indicating the permission requirement for using
the new API.

Bug: 115504887
Test: make api-stubs-docs-update-current-api -j128
Change-Id: Ide169b139ca16d43bd250de4d0447807d85a60ed
2018-11-16 12:13:01 -08:00
Ecco Park
8561aa3281 passpoint-r2: define getMatchingOsuProviders(List<ScanResult>) API
This API is required to support control of OSU Service Providers with
scan results on Setting UI.
Internally, previous API is merged into new API to take a list of
ScanResult Objects instead of a single ScanResult.

Bug: 119514793
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ib2f2e406c8c295c83924e7884657b4088dd23bb3
Signed-off-by: Ecco Park <eccopark@google.com>
2018-11-16 15:23:48 +00:00
Ecco Park
33ac9a434e Merge "passpoint-r2: define getAllMatchingWifiConfigs(List<ScanResult>) API" 2018-11-16 15:12:48 +00:00
Ecco Park
f035a04f59 passpoint-r2: define getAllMatchingWifiConfigs(List<ScanResult>) API
This API is required to support control of Passpoint configurations with
scan results on Setting UI.
Internally, previous API is merged into new API to take a list of
ScanResult Objects instead of a single ScanResult.

Bug: 119514793
Test: ./frameworks/base/wifi/tests/runtests.sh
Signed-off-by: Ecco Park <eccopark@google.com>

Change-Id: I1b9e1499081a8b005f10c249163185d0dc817b46
2018-11-16 03:19:21 -08:00
Les Lee
b6cc0e2890 Merge "p2p: add new API for acts test" 2018-11-16 06:21:48 +00:00
Hai Shalom
cc10721c48 Merge changes I3691ab5a,Ic79e533a
* changes:
  [WPA3] Make WPA3/OWE capability query API public
  [WPA3] Filter unsupported networks from scan results
2018-11-15 16:40:53 +00:00
lesl
7bfcf2cdd1 p2p: add new API for acts test
Bug: 118598975
Test: local ACTS test (topic: p2p_acts), included
1. Wpsinfo with PBC connection test,
   ping test from gc to go, reconnect test
2. Wpsinfo with display connection test,
   ping test from gc to go, reconnect test

Security Permission test:
Local Test Application test and confirm access deny
if application without NetowrkStack Permission

All of test cases are passed
Test Command: -tc WifiP2pManagerTest -ti 10 in shielding box

Change-Id: I963b54351f83747edf1d1d8a1db94af87728f37f
2018-11-15 12:04:56 +08:00
Hai Shalom
67e4303380 [WPA3] Make WPA3/OWE capability query API public
Make isWpa3SaeSupported, isWpa3SuiteBSupported and isOweSupported
methods public.

Bug: 112195778
Test: atest WifiManagerTest
Change-Id: I3691ab5a5c8c280b9ad6b07e3969b76801d3a5c9
2018-11-14 15:16:59 -08:00
Ecco Park
b0499e95cc passpoint-r2: add validate function for R2 configuration
Bug: 118506846
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP
Change-Id: I40d2363f2d88733ed02d145cf04332d781f10a8d
Signed-off-by: Ecco Park <eccopark@google.com>
2018-11-14 22:43:13 +00:00
Oscar Shu
28e1628e82 Merge "Handle hiddenSSID as one of soft ap config for backup & restore" 2018-11-14 19:08:41 +00:00
Daichi Ueura
4e7bbd8a64 Handle hiddenSSID as one of soft ap config for backup & restore
In addition to the change to persist hiddenSSID, this CL takes care of
backup and restore use case for hiddenSSID as one of soft ap config.

cherry-picked from aog/773385

Bug: 117052143
Test: Unit tests
Change-Id: I4af897f466c5d8fea66aec93e39faf3f13bd23fb
2018-11-12 23:18:25 +00:00
Hugo Benichi
311f0ff0b3 Merge "WiFi: Define a base abstract class for IWifiManager" 2018-11-09 03:28:46 +00:00
Jimmy Chen
53f58bc1c7 Merge "p2p: support factory reset for P2P group" 2018-11-09 02:47:08 +00:00
Hai Shalom
7212090a3e Merge changes from topic "SAE-OWE support"
* changes:
  [WPA3] Fix WifiConfigurtionTest to support OWE as open network
  [WPA3] Add new types for WPA3/OWE and device capabilities API
2018-11-07 18:28:13 +00:00
Roshan Pius
af319257bb Wifimanager/WifiConfiguration: Fix javadocs
Test: make docs
Change-Id: I2ef78b7e5fc7558d297337d4bd9b0265487365ea
2018-11-07 07:24:53 -08:00
Hugo Benichi
fe354b7825 WiFi: Define a base abstract class for IWifiManager
This patch creates a base abstract class that implements
IWifiManager.aidl with stub methods that throw runtime exceptions.

Actual implementations of IWifiManager can extend this class instead of
directly extending the autogenerated IWifiManager.Stub.

This allows adding new methods or modifying existing methods in
IWifiManager without requiring a synchronized change on all concrete
implementations.

Bug: 112338174
Test: Compiled, flashed marlin, booted. WiFi works.
Change-Id: I316c999d6c076f4e6ea1354bd558512915d551ed
2018-11-07 23:28:31 +09:00
Roshan Pius
bd22c4a57b WifiManager: Fix javadocs
Bug: 113878056
Test: make docs
Change-Id: Ia63e7df59d67def62b189b1bd98c0b21ce36d5f4
2018-11-07 05:30:35 -08:00
Marcin Oczeretko
726479fa28 Fix WifiNetworkConfigBuilder javadocs
Test: n/a
Change-Id: Iee1964687569e5ce9545513b31d087817a9ed1e9
2018-11-07 11:24:34 +00:00
Jimmy Chen
c4240a7ce8 p2p: support factory reset for P2P group
provide system API for Settings

Bug: 109866998
Test: Manual tests
      * manual trigger network reset in below conditions:
        * trigger network reset with P2P on
        * trigger network reset with WiFi on, P2P off
        * trigger network reset with WiFi off
        * trigger network reset with WiFi off then do reboot
      * check groups shown in WiFi Direct page
      * use wpa_cli -i p2p0 list_network
Test: CtsVerifier - WiFi Direct category
Test: Unit tests - atest frameworks/opt/net/wifi/tests/wifitests
Test: Permission check
      * call factoryReset as Guest
      * call factoryReset from 3rd-party application

Change-Id: Id487ebf4564b78b613b550c0f0266effb0ae793e
2018-11-07 09:57:23 +08:00
Roshan Pius
4e415edecd WifiManager: Mark isScanAlwaysAvailable() deprecated
This API is useful for the apps to decide when they can issue a scan
request. Since WifiManager.startScan() is deprecated, this should be
too. There is no functionality change for now, just a warning
that this will go away along with startScan().

Bug: 74448981
Test: `make api-stubs-docs-update-current-api`
Change-Id: I5310dc53dae244d7a99319bbde111254e9097a14
2018-11-06 13:46:30 -08:00
Hai Shalom
6adbc58858 [WPA3] Add new types for WPA3/OWE and device capabilities API
Add new types for WPA3: SAE and Suite-B-192, and Enhanced open: OWE.
Added a new API to get the device key management capabilities, because
not all devices using latest HAL have WPA3/OWE support. Updated
current.txt and system-current.txt accordingly.

Bug: 112195778
Test: atest com.android.server.wifi

Change-Id: Idceb28dd8663349013243f69b8f20c0c8606581c
2018-11-06 10:11:07 -08:00
Roshan Pius
d84d668d45 Merge changes from topic "network_request_match_callback"
* changes:
  WifiManager: Network request match callback registration
  wifi(API): NetworkSpecifier for Wifi NetworkAgent
  wifi(API): Mark old API's deprecated
  wifi(API): New API surface for network suggestion
  wifi(API): New API surface for connection via NetworkRequest
2018-11-06 17:42:58 +00:00
Oscar Shu
28de999efe Merge changes from topic "PnoPipeline"
* changes:
  Pno frequency culling: Settings.Global flag
  Pno frequency culling: add frequencies field
2018-11-06 01:45:19 +00:00
Jong Wook Kim
06432b66d9 Merge "Add MacRandomizationSetting to WifiConfiguration" 2018-11-02 19:52:23 +00:00
xshu
b0856c531c Pno frequency culling: add frequencies field
Add a field to pass frequencies per PnoNetwork

Bug: 64312268
Test: compile, unit test
Change-Id: Ib9a6b9da8345c1719dbd394763fda2a3e8d1f147
2018-11-01 11:02:09 -07:00
Roshan Pius
3c38ee435a WifiManager: Network request match callback registration
Add and Implement the new network request match callback register/unregister
@hide methods to be used by settings UI.

Note: This uses the same pattern used for other callbacks to settings
like traffic state change, softap.

Bug: 113878056
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ia4964759c6b10790dda0fc61a41c4d95dab904c9
2018-10-31 09:23:15 -07:00
Roshan Pius
99cfe09fa2 wifi(API): NetworkSpecifier for Wifi NetworkAgent
Create an @hide NetworkSpecifier to use by the Wifi NetworkAgent. This
will be used by connectivity service to match the incoming
NetworkRequest (with WifiNetworkSpecifier) with the NetworkAgent we
created to serve that request.
The WifiNetworkAgentSpecifier will hold the current connected wifi
network configuration which will be used to pattern match the
WifiNetworkSpecifier from NetworkRequest's.

Also, added a @hide helper method in MacAddress to help with matching
bssid pattern.

Bug: 113878056
Test: Unit tests
Change-Id: I9a643f0b914d48ff64104c798ec2869db40cb24b
2018-10-31 09:23:15 -07:00
Roshan Pius
914a64ecd2 wifi(API): Mark old API's deprecated
List of API's that are obsoleted by the new connection API proposed for
Q. These API's will continue to work with some restrictions for apps
targeting older SDK.
Also, removes the ability for 3p apps to toggle wifi state regardless of
target SDK. This will be limited to 1p apps like settings/setup wizard.

Bug: 115504728
Test: Compiles
Change-Id: Ifec5ab721b37bc334ff7448b7829df4be2dcab37
2018-10-31 09:23:15 -07:00
Roshan Pius
bc662b1844 wifi(API): New API surface for network suggestion
Allows apps to provide the platform a list of wifi network credentials
that the device is allowed to connect. Each NetworkSuggestion instance
will hold a standard WifiConfiguration object to represent network
credentials along with some other meta info that will help the platform
make good network selection decisions. NetworkConfigBuilder will be
reused for building the NetworkSuggestion objects as well.
Apps also have a mechanism to register to be awakened via PendingIntent
when the platform connects to one of their suggestions. This mechanism
will require the app to
a) Hold location permission, and
b) Registered PendingIntent should hold a foreground service (to prevent
abuse of this mechanism to bypass platform background limit checks).

Bug: 115504887
Test: Unit tests
Test: `make api-stubs-docs-update-current-api`
Change-Id: I9f5223fa45d49c22ce8f81d0ba56e5d12565381d
2018-10-31 09:23:14 -07:00
Roshan Pius
819e1a749c wifi(API): New API surface for connection via NetworkRequest
Adds a new builder class build a NetworkSpecifier that can be
used along with a standard ConnectivityManager.requestNetwork() to
request connection to a specific wifi network.
To avoid referencing any params from WifiConfiguration class (which is
going to be deprecated), copy over all public non-deprecated constants
to the new builder class.
Note: Most of these fields will be needed for |NetworkSuggestion| as well,
hence moving it to this common builder.

Since all the internal modules of wifi stack use WifiConfiguration,
WifiNetworkSpecifier embeds a standard WifiConfiguration field to hold
the relevant network credentials. There are 2 fields added in
WifiNetworkSpecifier to allow apps to specify a SSID/BSSID pattern to
match.

Bug: 113878056
Test: Unit tests
Test: `make api-stubs-docs-update-current-api`
Change-Id: I9c8919deb23024123f2b69c6fd705092976a1acf
2018-10-31 09:23:14 -07:00
Ecco Park
58100660ed passpoint-r2: change the status for server connection
Connection status for server is not well-defined.
So, change the status to be meaningful.
Bug: 117728536
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP
Signed-off-by: Ecco Park <eccopark@google.com>

Change-Id: Ie4dfb3b46926efb26d156bc41bff3709fa60d01e
2018-10-30 23:21:12 +00:00
Jong Wook Kim
cbe2e7a746 Add MacRandomizationSetting to WifiConfiguration
Allow setting different levels of MAC randomization for each network.
For now, we are going to support "Persistent" which generates randomized
MAC once and persist that MAC, and "Trusted" which uses the factory MAC.

Bug: 118396042
Test: Existing unittest verifying parcel
Test: adb shell dumpsys wifi | grep -B8 "MacRandomizationSetting"
Change-Id: I067f21a9a9a42370aa8dfe80b05aef3a4f9a7fad
2018-10-30 10:23:22 -07:00
Ecco Park
c2896a27fa Merge "passpoint-r2: add the status for Trust CA certs and Provision completion" 2018-10-23 14:15:54 +00:00
Ecco Park
55b5f249ce passpoint-r2: add the status for Trust CA certs and Provision completion
Bug: 74244324
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP

Change-Id: I1f875e7b0eb30ce7b5c992b194187a922d27cde3
Signed-off-by: Ecco Park <eccopark@google.com>
2018-10-16 13:53:22 -07:00
David Su
4ed4874429 Merge "Moved WifiWakeReasonAndCounts.java out of base/wifi" 2018-10-15 17:08:18 +00:00
David Su
7914b7246b Moved WifiWakeReasonAndCounts.java out of base/wifi
Moved WifiWakeReasonAndCounts out of base/wifi and
into opt/net/wifi, since this class is only used
internally and not exposed in the public API.

Bug: 73503971
Fix: 73503971
Test: frameworks/base/wifi/tests/runtests.sh
Change-Id: Ibd519f3d3357092ed1b7364b15b63a3cd58c5fa5
2018-10-10 16:49:24 -07:00
Ecco Park
8bdec9e823 passpoint-r2: add the status for starting third soap exchange
Bug: 74244324
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP
Change-Id: I526c23681f79967cfa644d18d59166e9c7682f33
Signed-off-by: Ecco Park <eccopark@google.com>
2018-10-05 15:19:31 -07:00
Andrew Solovay
5c05dedda1 cherry-pick from pi-dev docs: Replacing {#link with {@link
Several java files had the typo {#link (for cross-references to other
Javadocs) instead of the proper {@link format. This was confusing the
new doc publish tool (Mivi) since that's the format used for {# Django
comments #}.

Fixed a couple of links that had other errors (which prevented building
once the {# -> {@ was done) and other typos.

Replaced throughout the frameworks/base project; I'll need a separate CL
for the AndroidX fixes.

(Other files were not in the public Javadocs.)

Bug: 111925950
Test: make ds-docs
Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Original Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Exempt-From-Owner-Approval: Docs-only change
2018-10-04 18:17:05 +00:00