2534 Commits

Author SHA1 Message Date
Adrian Roos
66f859135b API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-11 20:38:02 +01:00
TreeHugger Robot
f33e2a1312 Merge "WifiScanner: Pass the band scanned in ScanData" 2018-12-06 03:22:56 +00:00
Roshan Pius
680b48e0b9 Merge "WifiManager: Add a error code for suggestion API's" 2018-12-06 03:13:17 +00:00
TreeHugger Robot
9f1505b460 Merge "p2p: hide factoryReset API" 2018-12-05 18:50:49 +00:00
Ahmed ElArabawy
72add40acd Add capability flag for low-latency support
This commit adds a flag for low latency support. This flag will be
checked when supported features are queried thorugh the HAL.

Bug: 34905427
Test: Unit test
Test: ./tests/wifitests/runtests.sh
Change-Id: I5cc5405ca0004c8ccea9f0b49c483936b5124d31
2018-12-04 21:39:18 +00:00
Roshan Pius
7b9114f938 WifiManager: Add a error code for suggestion API's
When the user disallows CHANGE_WIFI_STATE app-ops, the suggestion API
surface will return the new error code.

Bug: 120072329
Test: Compiles
Change-Id: I59a62a64541120cad738e821ec6d70e320f79174
2018-12-04 07:19:23 -08:00
Ahmed ElArabawy
390de008b0 Merge "Support of Low Latency mode for WifiLocks" 2018-12-03 22:26:35 +00:00
TreeHugger Robot
cee08bd900 Merge "Revert getMatchingOsuProviders(List<ScanResult>) API referencing hidden type" 2018-12-03 19:29:32 +00:00
Roshan Pius
7b2cd90375 Merge "WifiNetworkSuggestion: Allow apps to provide granular suggestions" 2018-12-03 19:12:48 +00:00
Soonil Nagarkar
5494113f67 Merge "Add ignoreLocationSettings to WifiScanner" 2018-12-03 16:26:39 +00:00
Roshan Pius
b0618c7f09 WifiNetworkSuggestion: Allow apps to provide granular suggestions
Allow apps to provide suggestions at the BSSID level for more fine
grained control.

Also,
a) Added some more documentation for
WifiNetworkConfigBuilder#buildNetworkSuggestion.
b) Added a missing match-none bssid pattern to validate.

Bug: 115504887
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ie551ea6753edba9bb0d05181390ab430f5510a63
2018-12-03 15:52:20 +00:00
Adrian Roos
68877da9bb Revert getMatchingOsuProviders(List<ScanResult>) API referencing hidden type
This partially reverts commit 8561aa3281a01486e9197adcc2d82ca81fb9a2e5 because
the added API references the OsuProvider type which is not part of the API.

Bug: 119556446
Test: make droid
Change-Id: Id13857bcb52e715148b06d27cf4096d08f751d37
Exempt-From-Owner-Approval: API only change
2018-12-03 16:48:21 +01:00
Roshan Pius
4762f45bb4 Merge "WifiManager: Set a max limit on num of suggestions" 2018-12-03 14:51:22 +00:00
Ahmed ElArabawy
0008fa8d5c Support of Low Latency mode for WifiLocks
This commit is part of adding the support for low latency mode
wakelocks. It adds the new WifiLock for low latency
This commit also deprecates the FULL, and SCAN_ONLY wifilocks.

Bug: 34905427
Test: No Test- This commit is just the api definition

Change-Id: Id47294867d8000517601dd48a2fcf5a345779ddb
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2018-12-03 04:39:14 +00:00
Soonil Nagarkar
1e59a5f3e9 Add ignoreLocationSettings to WifiScanner
Give WifiScanner an API to ignore location settings while wifi scanning
for certain requests.

Bug: 119140584
Test: manually
Change-Id: I9bc4cf38c3ea720193dcc87f2c8494afd89a36ec
2018-11-30 13:18:59 -08:00
Jimmy Chen
608ce7a795 p2p: hide factoryReset API
The API is non-public API if it is used by settings only.
Remove unnecessary System API notation.

Bug: 120072277
Test: Manual test
      * Run Network Reset Option in Settings
      * Check saved groups are cleared.

Change-Id: Id5147b8147a2ee68447b7757f314dbd3f84296e6
2018-11-30 20:14:43 +08:00
Jimmy Chen
9ec9c3d399 p2p: fix javadoc tag for class reference
Bug: 64695709
Test: build
Change-Id: I5db49e2bd30d06dfe3bff050b94e318fd3dee974
2018-11-30 17:53:31 +08:00
Jimmy Chen
0d7a9a2789 Merge "p2p: WiFi Direct API for Group Creation" 2018-11-30 06:19:21 +00:00
Jimmy Chen
ab4a8d2eb7 Merge "p2p: add WifiP2pConfig builder for new API" 2018-11-29 22:37:39 +00:00
Roshan Pius
d1a4a56bd4 WifiManager: Set a max limit on num of suggestions
Also, changed the return of add/removeNetworkSuggestions to clearly
indicate the error encountered.

Bug: 119210573
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I06eff1aad584ed9939ba905a1008a7565909d148
2018-11-29 13:50:10 -08:00
Roshan Pius
f8d769ef29 Merge changes from topics "system_api_setup_wizard", "deprecate_apis"
* changes:
  WifiManager: Mark all settings/setupwizard custom APIs @SystemApi
  WifiManager: Deprecate API implementation
2018-11-29 20:41:20 +00:00
TreeHugger Robot
c489b375cc Merge "WifiScanner: Add location permission & app-ops checks" 2018-11-29 20:39:33 +00:00
Roshan Pius
29c2a95ae3 WifiManager: Mark all settings/setupwizard custom APIs @SystemApi
Mark all the custom connect (& other APIs) added to serve settings &
setupwizard as @SystemApi.

Also, enforce tighter permissions on these APIs. These were explicitly
added to serve settings & we should not allow any other apps to use
them.

Bug: 116127346
Test: Compiles

Change-Id: Ic0000f21ccbeda4ade59a3b04d78f49b1b20cd02
2018-11-29 10:18:51 -08:00
Roshan Pius
0221476002 WifiManager: Deprecate API implementation
Changes:
a) Pass the calling package name in the AIDL call to allow target-SDK
checks & error logging on the service side (similar to other binder calls).
b) Pass the return value from service for AIDL calls: disconnect,
reconnect, reassociate.
c) Return false for a previously deprecated saveWifiConfiguration API.

Bug: 115504728
Test: Compiles
Change-Id: I9bc9c8fc5857a430242e5afbecca7fc2c39f1ca1
2018-11-29 10:18:51 -08:00
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
Roshan Pius
7e757ea3b0 WifiScanner: Add location permission & app-ops checks
Pass in the requested package name in every request for
non-privileged requests. We need the exact package name because
some system app shares its uid with a bunch of modules.
Retrieving the package name using the uid (via getNameForUid())
will not work for app-ops checks.

Bug: 117612744
Bug: 113542524
Test: Able to see scan results in wifi picker.
Test: Verified maps working with wifi scans.

Change-Id: Ib9c252e351fbb6cca0b44b2d6ec993d2a2ad655e
2018-11-26 09:32:38 -08: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
Jimmy Chen
c07f7f1d54 p2p: WiFi Direct API for Group Creation
new createGroup API accepts the configuration built by
WifiP2pConfig#Builder to create a group.

Bug: 64695709
Test: manual test
      * create a group with pre-defined configuration.
      * join it as new Group Client.
      * join it as legacy Wi-Fi STAs.
Test: Unit tests - atest frameworks/opt/net/wifi/tests/wifitests
Change-Id: Ib6598016ee0e96d8a53638189890ff228bb0f177
2018-11-19 15:07:17 +08:00
Jimmy Chen
bc0edcaf3d p2p: add WifiP2pConfig builder for new API
Creating/Joining a group with credentials needs additional
fields in WifiP2pConfig. Using builder to construct corresponding
WifiP2pConfig object

Bug: 64695709
Test: Unit tests - atest frameworks/opt/net/wifi/tests/wifitests
Change-Id: Ib01a7a1313fab3a7e3e9a0c6c9a10e419deed9d4
2018-11-19 15:07:15 +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
Roshan Pius
5a600f5d40 WifiScanner: Pass the band scanned in ScanData
Replace the existing |isAllChannelsScanned| variable with the exact band
that was scanned.
|isAllChannelsScanned| flag has been overloaded over the years to convey
both {2g + 5g} & {2g + 5g + dfs} scans. This was needed for wifi wake
and other clients for whom both were equivalent. For sending out
scan broadcasts to external apps, we need to identify scans with
{2g + 5g + dfs} only.

Also, add annotation for the permission required for |registerScanListener|.
This should only be available to wifi stack.

Bug: 119316884
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: Will send for integration tests
Change-Id: Iea50851ef9f1e98d2e06601ba89d112cd2dd4e38
2018-11-14 12:31:56 -08:00
Oscar Shu
28e1628e82 Merge "Handle hiddenSSID as one of soft ap config for backup & restore" 2018-11-14 19:08:41 +00:00