168 Commits

Author SHA1 Message Date
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
Michael Plass
b0b67fc1b9 Merge "Add missing SmallTest annotations in frameworks/base/wifi" 2018-09-04 16:18:58 +00: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
Michael Plass
870d38148f Add missing SmallTest annotations in frameworks/base/wifi
Bug: 73290083
Test: Unit tests
Change-Id: I1fc03f17f542d35d8e0e624e96c1175fea1581b8
2018-08-27 14:06:53 -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
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
Ecco Park
84d601fbda passpoint-r1: fix the wrong filed for PPS-MO.
Currently Passpoint-r1 follows the PPS-MO format to install passpoint
profile.

Howevever, one field(SubscriptionParameter) is not correct.
Normally passpoint-r1 doesn't use this field because this is used for
passpoint-r2 feature.
So, currently there is no issue with wrong field for using passpoint-r1.

But, it needs to be "SubscriptionParameters" according to the hostpot2.0
release 2.0 techinical specification.

Bug: 111449001
Test:  ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Idb6bb4d28913bd3d0905b330e25fbb20b99bbf2e
Signed-off-by: Ecco Park <eccopark@google.com>
2018-07-14 00:11:20 +00:00
Etan Cohen
5c059bd984 Merge "[RTT] Update RTT preamble selection algorithm" into pi-dev am: 51f3c4481c
am: 057718d6e8

Change-Id: I38fd3bd4908e7212535abfd97ae5abd320afe830
2018-05-06 21:16:57 -07:00
Etan Cohen
057718d6e8 Merge "[RTT] Update RTT preamble selection algorithm" into pi-dev
am: 51f3c4481c

Change-Id: I7922b6d07c6327a597f76f1002b3c7652af7d165
2018-05-06 21:07:25 -07:00
Etan Cohen
67f5ffb7e8 [RTT] Update RTT preamble selection algorithm
Select preamble to use for RTT exchange using IEs advertised by the
AP rather than channel width (which is used as a backup method).

Bug: 69965964
Test: unit test & integration tests
Change-Id: I60ef31c4627795bd4da505f31998b49668d1a115
2018-05-05 05:01:31 +00:00
Jimmy Chen
66cbe22201 wifi: implement hashCode to be consistent with equals
Per Effective Java, if a class implements equals(),
it should override hashCode().

Test: (new) unit tests
Bug: 37000525
Change-Id: If4175a7e2bc34935c525d0fb96fbbe1e904030e3
2018-05-04 15:02:49 +08:00
Roshan Pius
f2153e333c Merge "Revert "Revert "WifiManager: Return status from startScan()""" into pi-dev
am: e93daa4659

Change-Id: Ie6c120c62194686de2c043d1bee45e5fc78b4c11
2018-04-27 17:32:12 -07:00
Roshan Pius
e93daa4659 Merge "Revert "Revert "WifiManager: Return status from startScan()""" into pi-dev 2018-04-28 00:09:03 +00:00
Roshan Pius
c705615816 Revert "Revert "WifiManager: Return status from startScan()""
This reverts commit 4c36c2903d85a829efcc0ecaf2a67d0d05fcb967.

Reason for revert: Compilation failure in Arc++ fixed.
Bug: 77297012
Change-Id: Ic707f7256e8d7430c28e58085c6c2208f88042f2
2018-04-27 19:05:15 +00:00
Doris Ling
cb27c77b55 Merge "Revert "WifiManager: Return status from startScan()"" into pi-dev
am: ebcb2e006b

Change-Id: I328b6e331052a8b2b0717663c65599ed3cee04bc
2018-04-26 16:53:28 -07:00
Doris Ling
ebcb2e006b Merge "Revert "WifiManager: Return status from startScan()"" into pi-dev 2018-04-26 23:26:09 +00:00
Doris Ling
4c36c2903d Revert "WifiManager: Return status from startScan()"
This reverts commit b81c3d5f9a86e4e1f90be2ffaa81ea5df8fce684.

Bug: 77297012
Change-Id: Ie8727343650b549d4f438643d50a10fe50ab52b1
Reason: this change is breaking the build
2018-04-26 22:31:45 +00:00
Roshan Pius
1eeab66937 Merge "WifiManager: Return status from startScan()" into pi-dev
am: deb2e6ed8c

Change-Id: I289d25d233c53ab854df32ae418231ece8c5900e
2018-04-26 14:42:46 -07:00
TreeHugger Robot
deb2e6ed8c Merge "WifiManager: Return status from startScan()" into pi-dev 2018-04-26 21:14:46 +00:00
Roshan Pius
b81c3d5f9a WifiManager: Return status from startScan()
Bug: 77297012
Test: Ensured that scans from settings are still running.
Test: Unit tests
Change-Id: I0ffea57c48ad2ef5312dd90462b4b707cbf2368c
2018-04-24 15:55:51 +00:00
Rebecca Silberstein
c5e42dc131 Merge "update wifi unit test script" into pi-dev
am: 4a7913c268

Change-Id: I1a55eed1317ab101837b24d3162d1218d19c6ef6
2018-04-24 05:58:08 -07:00
Rebecca Silberstein
3f26ff2f56 update wifi unit test script
Need to add "--no-hidden-api-checks" to unit test script.

Verified by running runtests

Bug: 78465388
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I916a2870bde2cbfe1966d18a0f7a13def2bd1ce7
2018-04-23 15:54:36 -07:00
Nicolas Geoffray
03ba2d9241 Merge "Exempt tests for hidden APIs." into pi-dev
am: 0e675bd901

Change-Id: I012a1ce8483f5fdddf60cfd33ea4303d72455fca
2018-04-10 09:56:52 -07:00
Nicolas Geoffray
b0284fb5de Exempt tests for hidden APIs.
Bug: 64382372
Bug: 74963051
Test: m
Change-Id: I5234dd6230f2bdd6ffccbf12b25a02d929d20161
2018-04-06 14:54:39 +01:00
Rebecca Silberstein
b198f1a43f Merge "WifiManager: allow setWifiApConfiguration to return false" into pi-dev
am: 9c2c8f5df6

Change-Id: I949668cd3d326afd68f94c85e1cf02e3a219a572
2018-04-05 21:54:38 -07:00
Rebecca Silberstein
9c2c8f5df6 Merge "WifiManager: allow setWifiApConfiguration to return false" into pi-dev 2018-04-06 04:42:36 +00:00
Dan Willemsen
c5ba4d36dd Merge "Remove duplicate definitions of utility variables" am: 8d5a39ac62
am: 9473e846e5

Change-Id: Ie52855316907746a6347fcc6b343f5c75d9c9c64
2018-04-04 17:56:57 -07:00
Mukesh Agrawal
0f57f60b7c Merge ""02:00:00:00:00:00" invalid for MAC randomization" into pi-dev 2018-03-29 22:25:13 +00:00
Rebecca Silberstein
cf1b40fb2b WifiManager: allow setWifiApConfiguration to return false
The api for setWifiApConfiguration allows for config saves to return
false, but the implementation always returns true (if there wasn't an
exception thrown).  This CL allows the API to actually return false and
adds unittests.

Bug: 67601382
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: manually update ap config in settings and verify save
Test: wifi integration tests
Change-Id: I038ab68f5fc4bf22df5b61d329077eacda547338
2018-03-29 15:15:41 -07:00
Dan Willemsen
9caee5b85e Remove duplicate definitions of utility variables
These are set by the core build system, and are becoming read-only.

Bug: 76424357
Test: diff build-aosp_arm.ninja
Change-Id: I2df878bb654db48a0f2b9956220a0367c32c7ffe
2018-03-28 14:27:09 -07:00
Etan Cohen
ce7179bfcf [RTT] Add API for number of measurements
Add information about the number of attemped and successful measurements
used to calculate the final results (especially critical for standard
deviation).

Bug: 76445930
Test: unit tests & integration tests
Change-Id: I906b6e8a4d74799447ab7c2e55965fdd448dc470
2018-03-27 16:18:54 -07:00
Jong Wook Kim
d184ba5435 "02:00:00:00:00:00" invalid for MAC randomization
Since we are using "02:00:00:00:00:00" as the default/invalid MAC
address in the Wifi Framework, we should make it invalid for Connected
MAC Randomization for consistency.

Updated the configuration to use "02:00:00:00:00:00" as the default
invalid MAC and attempt multiple time to generate valid random MAC.

Bug: 74436465
Bug: 74446723
Test: Unittest
Change-Id: Ia5ac806d478191d7e8fad247d5c3a1b97d16498f
2018-03-21 15:52:52 -07:00
Anton Hansson
be72e62c63 frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Exempt-From-Owner-Approval: Global cleanup
Change-Id: I66b515d98d03264dbb893b7c55ba7bdddfb447a1
Merged-In: I26458e41ecb84de91ac9a356a5d4bafb44f463c1
Merged-In: I938efe7a2359302cbf4d5d6f786f963044e1bbbd
Merged-In: I72ce7f1c6242ddf9a5b36075761f3f1f1138cea1
2018-03-07 15:10:39 +00:00
Anton Hansson
d137c872cd frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Exempt-From-Owner-Approval: Global cleanup
Change-Id: I26458e41ecb84de91ac9a356a5d4bafb44f463c1
2018-03-07 11:42:04 +00:00
Etan Cohen
e43df4defb [AWARE] Add target API check to the Responder to ANYONE config
Responder to ANYONE was deprecated for API >= P. But the manager
code did not check for target API - i.e. even older apps would have
been rejected. Added the target API check to the manager code.

Bug: 72175022
Test: unit test + integration tests
Change-Id: I52e0c877e0af0756816b5b13e42f432504461e20
2018-02-28 10:22:10 -08:00
Andreas Gampe
d33464629d Merge "Frameworks: Annotate JUnit4 test with @Test" am: 3a12454f9a am: af8f4b192d
am: b4654687ef

Change-Id: I7904252d10121901349e49c62577a98f06355cba
2018-02-27 02:09:58 +00:00
Andreas Gampe
112bbf1f43 Frameworks: Annotate JUnit4 test with @Test
Mollify Errorprone.

Bug: 72076216
Test: m javac-check RUN_ERROR_PRONE=true
Test: atest CredentialTest
Change-Id: I07635124a306f82e5442a45a1fd61edc63c015a2
2018-02-26 08:07:19 -08:00
Etan Cohen
52982a9e40 [RTT] Replace Handler with Executor in public APIs
Per new API guidelines.

Bug: 73088768
Test: unit tests & integration tests
Change-Id: I5aba667e746f4a031fcf53c168e89cbdcfc0c5ec
2018-02-16 10:13:26 -08:00
Etan Cohen
870301c9e2 [RTT] LCI/LCR to System API - unparsed
Move LCI/LCR to a System API - unparsed:
- Punting parsing for future release
- Not widely available in APs for testing
- Usability/deployment unclear

Bug: 71643239
Bug: 73088768
Test: unit tests & sanity integration tests
Change-Id: Idd3bded55e887abbad6c51b00b31e75c859ba579
2018-02-16 10:13:20 -08:00
Jong Wook Kim
4f10fb95de Default Randomized MAC Address to 0:0:0:0:0:0 in WifiConfig
Set the default value of Randomized MAC address as 0:0:0:0:0:0 instead
of null.

Making this change to simplify storing randomized address to XML for
permanent storage. Without this change, will need to manually check if
the value is null during MacAddress<->XML conversion.

Bug: 72753415
Test: Unittest.
Change-Id: I6edf486360e267acec9f8a343386444be2ea99fa
2018-02-07 19:31:19 +00:00
Andreas Gampe
15f39aac4f Merge "Frameworks: Mark tests" am: c86b195cd5 am: 2b12970061
am: 70c15d1d8d

Change-Id: I55b62b64236937c66a21ec667216f7f1d505a5b5
2018-02-06 09:29:10 +00:00
Etan Cohen
c3329ecdd4 [P2P] Fix flaky unit test
Unit test format for resource leak detection invalid. Probably cause
of flaky unit test.

Bug: 72941646
Test: unit tests pass locally
Change-Id: Ibd7497b92f118338260c0af48706985172423d0a
2018-02-05 09:03:49 -08:00
Etan Cohen
64dd7468f3 Merge "[AWARE] Remove ability to accept connections from ANYONE" 2018-01-31 16:05:05 +00:00
Andreas Gampe
35dbf35b26 Frameworks: Mark tests
Add @Ignore and @Test to make Errorprone happy.

Bug: 72076216
Test: m javac-check RUN_ERROR_PRONE=true
Test: atest ConnectivityServiceTest
Test: atest WifiManagerTest
Change-Id: Id2423c545eccaa768203faf86e14d0a558d927cd
2018-01-31 01:04:00 +00:00
Rebecca Silberstein
6a278404e3 WifiManager: return errors for WPS API calls
WPS support in Client mode is deprecated.  Trigger onFailed callbacks
for WPS operations. Added unit tests to check for error callbacks.

Bug: 72168432
Test: frameworks/base/wifi/tests/runtests.sh
Change-Id: I442afd75b6b3ed3d43488cc2185274e9584352d1
2018-01-28 08:25:02 +00:00
Etan Cohen
caf9b531f7 Update SmallTest library
android.test.suitebuilder.annotation.SmallTest is deprecated and
replaced by android.support.test.filters.SmallTest.

Update all test files. No other change.

Bug: 72324160
Test: all unit tests pass
Change-Id: I02ec8419a3eac698077d46b0b95f1f695b0f1b9b
2018-01-26 14:44:42 -08:00
Etan Cohen
9b78f8254d [AWARE] Remove ability to accept connections from ANYONE
Wi-Fi Aware data-path (NDP) setup requires an Initiator and a Responder.
Both Initiator and a Responder are set up with the MAC address of the
peer to which to connect to as well as a security configuration (Open,
PMK, Passphrase).

The original API (27) allowed a Responder to be configured to accept
a connection from anyone (e.g. using a null MAC address). This creates
ambiguous semantics when an NDP already exists. The second Responder
request could refer to the previously setup NDP or to a new one to be
created. We cannot tell the difference up-front.

Remove the "Accept request from ANYONE" API for newer APIs.

Bug: 72175022
Test: unit tests and integration tests
Change-Id: I194cc15402c33c2f1c62834d64646f2489274c35
2018-01-24 10:26:50 -08:00
Jong Wook Kim
d4ab45c846 MAC Randomization: Store Randomized MAC Address in WifiConfiguration
Store randomized MAC address for each network in mMacAddress field, so
that we don't have to create a new MAC address when connecting to a
saved network.

Bug: 63905794
Bug: 71548300
Test: Unittest
Change-Id: I05a50d3c3bc94e5ac4a0ec7cbd1f192a6d4c0b11
2018-01-24 10:09:48 -08:00
Etan Cohen
7c700afcd9 [RTT] Add LCI and LCR structures
Baseline LCI & LCR classes and structure (and planned API).

Bug: 71643239
Test: unit tests
Change-Id: I1ebe4f46d219901761758de58d73815ccfe6e815
2018-01-22 11:23:46 -08:00
Mehdi Alizadeh
55f3aae053 Adds unregisterSoftApCallback API
Bug: 68712383
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I9d6a52eed722b0b0a159b73d517a9dc4d3f8107c
2018-01-18 11:15:23 -08:00