Commit Graph

2385 Commits

Author SHA1 Message Date
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
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
Oscar Shu
a20fa4ea1d Merge "WifiManager: getScanResults fix javadoc" 2018-09-28 21:36:37 +00:00
David Castro
48af76d641 Merge "docs: Updates the documentation for the wepKeys field." into pi-dev am: 61a4d35100
am: 6c758e81cb

Change-Id: I76be81d65473f1e6d01b793bb29448152dabf78b
2018-09-27 15:25:29 -07:00
David Castro
6c758e81cb Merge "docs: Updates the documentation for the wepKeys field." into pi-dev
am: 61a4d35100

Change-Id: I9f5ad3998d97b740e07b8e4345b22108245ee5ae
2018-09-27 15:15:16 -07:00
David Castro
f0d5c5c30a docs: Updates the documentation for the wepKeys field.
Updated documentation indicates that four WEP key values must be
provided. This replaces the earlier reference to "up to four." Providing
fewer than four values causes a java.lang.IllegalArgumentException.

Documentation also references the option to provide empty strings for up
to three of the values.

Test: make ds-docs

Bug: 36949880

Change-Id: I1da9f0ecfb390623f4d53ca508a554303861ed98
Exempt-From-Owner-Approval: Docs-only change
2018-09-20 17:01:51 -04:00
TreeHugger Robot
0a5d59ffd1 Merge "passpoint-r2: add the status for starting second soap exchange" 2018-09-18 22:49:36 +00:00
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
2018-09-14 13:18:34 +01:00
xshu
5f00c8a91a WifiManager: getScanResults fix javadoc
The javadoc is inconsistent with the acutal implementation.
The intended implementation actually throws an Exception instead of
returning an empty list.

Bug: 62786310
Test: compile, unit tests
Change-Id: Ifcb89dd6bea1a73f8db079a84ed32c46bbcb3bce
2018-09-12 16:59:27 -07:00
TreeHugger Robot
603ed1ddc2 Merge "WifiAwareAgentNetworkSpecifier: Initialize unmarshaled instance" 2018-09-05 19:51:23 +00:00
Ecco Park
41f4d9c54f passpoint-r2: add the status for starting second soap exchange
Bug: 74244324
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP
Change-Id: I5153f8ac8fd2685e843c2f28f5c4892b4c5906db
Signed-off-by: Ecco Park <eccopark@google.com>
2018-09-05 10:59:44 -07:00
Ecco Park
e6072e99b5 Merge "passpoint-r2: add the new failure about timeout for redirectListener" 2018-09-05 17:16:08 +00:00
Roshan Pius
3f770d934e WifiAwareAgentNetworkSpecifier: Initialize unmarshaled instance
Invoke initialize on all instances of
WifiAwareAgentNetworkSpecifier.

Bug: 113882732
Test: Unit tests
Test: Aware data path related CtsVerifier tests pass now.
Change-Id: Ifcf4b4708534b7c630f7846fa3823ba4f6a6aca3
2018-09-05 16:47:01 +00:00
Ecco Park
b6f805729f passpoint-r2: add the new failure about timeout for redirectListener
Bug: 74244324
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP
Change-Id: Ifd1be8450b3a7915f3e6de29942cf8d1d196d0bb
Signed-off-by: Ecco Park <eccopark@google.com>
2018-08-31 17:54:54 -07:00
Oscar Shu
e8cf7b5e09 Merge "Fix some fields in WifiInfo are not written into Parcel" am: 5add10333d
am: e3de537252

Change-Id: Ib17bfb34652b6d68d963dafdbe72e2d48903d139
2018-08-29 18:05:35 -07:00
Oscar Shu
e3de537252 Merge "Fix some fields in WifiInfo are not written into Parcel"
am: 5add10333d

Change-Id: Idce8900c306b8e59f89825f34d0190c3092136b1
2018-08-29 17:50:50 -07:00
keigo, nishira
f53446deca Fix some fields in WifiInfo are not written into Parcel
Some fields in WifiInfo are not written into Parcel so
these fields will not be carried over process boundaries.

cherry-picked from: ag/4820524

Bug: 79889311
Test: compile & verified fields are filled from app
Test: Unit tests

Change-Id: I0d8f453c49212fc6d12d28537454c9a9657c1ef7
2018-08-28 16:24:01 -07:00
Roshan Pius
045d380e68 WifiManager: Add verbose logging enabled flag
Some of the wifimanager logs on the app side are too spammy. Move these
logs under a verbose logging flag. This flag is updated to reflect the
logging level set on wifi service when the WifiManager object is created.

Bug: 111350569
Test: Ensured that the logs under the flag are logged only when verbose
logging is turned on.

Change-Id: Ied1ee14b423e4d0a473e153dcfd3e07e20391be5
2018-08-28 15:04:43 -07:00
keigo, nishira
04b05b4daf Fix some fields in WifiInfo are not written into Parcel
Some fields in WifiInfo are not written into Parcel so
these fields will not be carried over process boundaries.

cherry-picked from: aog/706786

Bug: 79889311
Test: compile & verified fields are filled from app
Test: Unit tests

Change-Id: I0d8f453c49212fc6d12d28537454c9a9657c1ef7
2018-08-20 11:54:00 -07:00
Ahmed ElArabawy
dfb32165f7 Merge "Wifi: Pass the multicast wakelock TAG in release" 2018-08-20 18:06:08 +00:00
Ecco Park
1460c30b75 passpoint-r2: define new status and new Intents for lauching an OSU app
Bug: 74244324
Test: ./frameworks/base/wifi/tests/runtests.sh
Test: live test with Passpoint R2 service provider AP
Change-Id: Iba35ab14b6b5925d2ef0435af9e94f97d0d9fa1d
Signed-off-by: Ecco Park <eccopark@google.com>
2018-08-20 17:37:18 +00:00
Mathew Inwood
6b269a7e26 Merge "Add @UnsupportedAppUsage annotations" am: d717c04b12
am: 629a3828e2

Change-Id: I99215dd5430968df2e2dd514d21b396b00c1403e
2018-08-16 03:29:58 -07:00
Mathew Inwood
629a3828e2 Merge "Add @UnsupportedAppUsage annotations"
am: d717c04b12

Change-Id: I8f8c9106b494caa6dc5ad405111f2a285a01e49f
2018-08-15 10:12:01 -07:00
Mathew Inwood
fa3a7466e1 Add @UnsupportedAppUsage annotations
For packages:
  android.net.wimax
  android.net.wifi.p2p.nsd
  android.net.wifi.p2p
  android.net.wifi.hotspot2.pps
  android.net.wifi.hotspot2.omadm
  android.net.wifi.hotspot2
  android.net.wifi.aware
  android.net.wifi
  android.net.util
  android.net.sip
  android.net.rtp
  android.net.nsd
  android.net.metrics
  android.net.lowpan
  android.net.http
  android.net.captiveportal
  android.net

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ie25423113ee1a8071cd5039382c00de6ce0af7fd
Merged-In: I520be7a4c79e68310c12e4f55bf66acaa94145a1
2018-08-14 14:44:29 +01:00
Mathew Inwood
53f089f843 Add @UnsupportedAppUsage annotations
For packages:
  android.net.wimax
  android.net.wifi.p2p.nsd
  android.net.wifi.p2p
  android.net.wifi.hotspot2.pps
  android.net.wifi.hotspot2.omadm
  android.net.wifi.hotspot2
  android.net.wifi.aware
  android.net.wifi
  android.net.util
  android.net.sip
  android.net.rtp
  android.net.nsd
  android.net.metrics
  android.net.lowpan
  android.net.http
  android.net.captiveportal
  android.net

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I520be7a4c79e68310c12e4f55bf66acaa94145a1
2018-08-14 14:39:24 +01:00
Ahmed ElArabawy
3793c020b4 Wifi: Pass the multicast wakelock TAG in release
In current implementation, when the same UID allocates, and acquires
multiple wiFi multicast wakelocks, the tag associated with the lock is
passed in the acquire method, and stored in the multicasters list.
However, when the UID tries to release the lock, the tag is not included
in the method call, and all the wakelocks found in the list of
multicasters for this UID are released.
This behavior does not reflect the expected behavior of the App using the
API

This commit contributes to the fix of this situation by passing the
wakelock tag in the release method, to enable the release of the proper
wakelock.

Bug: 70691435
Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I4e4efd2ce75e77cde54ba92217364b83f2c7c401
2018-08-09 13:59:39 -07:00
TreeHugger Robot
d4c19aa24b Merge "passpoint-r2: redefine status and error enums" 2018-08-01 18:44:00 +00:00
Michael Plass
c32985fa8d Permission required for RSSI_CHANGED broadcast
Document requirement for ACCESS_WIFI_STATE permission to receive
android.net.wifi.RSSI_CHANGED broadcasts.

Bug: 111698366
Test: Unit tests
Change-Id: I7c02c0e226fef2b2ab2f374bb68b2de1b64effe3
2018-07-30 11:08:56 -07:00
Roshan Pius
2866912853 Merge "WifiManager: Add callback for traffic poller" 2018-07-27 18:24:48 +00:00
Ecco Park
87b0298b74 passpoint-r2: redefine status and error enums
Bug: 74244324
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I0df739206fdf2e7a7dbfd56771768b875bc96f19
Signed-off-by: Ecco Park <eccopark@google.com>
2018-07-26 17:49:50 -07:00
TreeHugger Robot
ce419f1342 Merge "WifiScanner: Add permission for start/stop pno scan APIs" 2018-07-26 16:14:26 +00:00
Andrew Solovay
b44f927f05 Merge "docs: Updating setDomainSuffixMatch() for Android P" into pi-dev am: 447b8b6394
am: b6c29ac737

Change-Id: I0b93883c585240b81447530735fbe573695b4cf8
2018-07-25 13:37:00 -07:00
Andrew Solovay
5c704e6deb docs: Updating setDomainSuffixMatch() for Android P
Small update to reflect P-related change (that common-name verification
is no longer supported), per
https://android-dot-devsite.googleplex.com/about/versions/p/android-9.0-changes#certificate-common-name

Also added some missing paragraph breaks while I was doing it.

Doc is staged to:

http://go/dac-stage/reference/android/net/wifi/WifiEnterpriseConfig#setDomainSuffixMatch(java.lang.String)

Exempt-From-Owner-Approval: Docs-only change
Bug: 110483059
Test: make ds-docs
Change-Id: I50b6eb70bf16c17dd0ae4e54711c5bb599c47c1a
2018-07-25 18:57:05 +00:00
Roshan Pius
80fb13753b WifiManager: Add callback for traffic poller
The current mechanism for traffic poller directly exposes the wifi
service's internal message handler to privileged apps. Move away from
this mechanism and expose an API to let apps register for callbacks from
traffic poller. This API uses binder IPC for registration and
invocation of callbacks. Clients are automatically removed on binder
death.
This will also let us mark WifiManager#getWifiMessenger() method
private to prevent any apps from getting access to this internal messenger.

Note: This is based on the existing SoftapCallback registration
mechanism.

Also, fixed a bunch of checkstyle errors that were not caught
previously.

Bug: 27074039
Test: Unit tests
Test: Verified the data indicators on Sysui
Change-Id: I505bd2398552be99ccca7b7d3c31a488aa72af70
2018-07-25 14:31:29 +00:00