1692 Commits

Author SHA1 Message Date
Etan Cohen
85b1a5b786 [NAN] NAN data-path API: network specifier
Adds network specifier API. These are used in creating a connectivity
request through ConnectivityManager. The network specifier provides
mechanism to pass information to the network factory.

Bug: 26564277
Change-Id: Ib5b88685e033a2957644f2e9cff39a70712ac7b5
(cherry picked from commit 15849dc463278b44b191cd39aa7d31b0de9ee825)
2016-08-29 11:26:42 -07:00
Mitchell Wills
0a9fb8093b Don't save the anonymous identity for EAP-SIM/AKA/AKA-Prime
wpa_supplicant can update this value when authenticating so if the
framework writes it back the new value can be overwritten.

TEST: Patch was validated by original reporter
      Enterprise tests pass (b/29608435)

Change-Id: If359b4ca625371fbdb68177c7cdb6498c3a519a1
Fixes: 28161335

(cherry picked from commit a464a9fce8d160d2bbac3aeea3b23ecc7bb179a0)
2016-08-29 11:26:10 -07:00
Mitchell Wills
db81862be8 Add a WifiScanner API to listener for ongoing scans
Bug: 29412469
Change-Id: Id884851a12f95c89f928b81f5b5baa1f9f80fafe
(cherry picked from commit 0a726ac690cf5418257cd7dcb176c71158687561)
2016-08-26 13:22:51 -07:00
daisuke niwa
cf91215d00 Fix invitation request from persistent GC
When the device received the second invitation request
from GC of the same PersistentGroup, the wifi framework
processes "sa" as mOwner of WifiP2pGroup. At this point,
if an invited group is persistent group, WifiP2pGroup can't
know whether "sa" is GC or GO yet. So the framework shouldn't
process mOwner in the constructor.

Bug: 28715251
Change-Id: Ie7065da0d6c978c3747ecbd6f728de87d9567009
(cherry picked from commit af1eafd7b14f4cafd150d01d1d9d87470a4f3777)
2016-08-26 13:22:51 -07:00
Roshan Pius
311a72164b WifiConfiguration: Make NetworkSelectionStatus public
Expose a public constructor for |NetworkSelectionStatus| class and add a
setter in WifiConfiguration to set the |NetworkSelectionStatus| object.
Needed for config store persistence of this object.

BUG: 29273147
Change-Id: I9d9036928137760c4832567dd2b9d0fabc874940
TEST: Unit tests
(cherry picked from commit 6a89ee2d908add0d418995420b2d5eaebd90882f)
2016-08-26 13:22:49 -07:00
Roshan Pius
f9f88b8b20 WifiManager: Add new API to restore old backup data
Add a new API to restore the old backups containing the raw data from
wpa_supplicant.conf & ipconfig.txt files.
This helps clean up all the existing wifi configuration parsing
logic from SettingsBackupAgent.

BUG: 29075035
Change-Id: I8c7b93ef7c9e2decc8e4f9e5d7038939cf0ef196
(cherry picked from commit 08131593a864c23b8465d7ce05bf6c04564f7ba1)
2016-08-26 13:22:47 -07:00
Roshan Pius
ffe0abf103 WifiManager: Add new API's for backup/restore
Expose new API's to retrieve data to be backed up for Wifi
configurations and to restore configurations from the data.
BackupSettingsAgent will invoke these API's to backup/restore wifi
settings.

BUG: 28967335
Change-Id: I64e2f37a29d538d976bcc53dd2165653073b5862
(cherry picked from commit 7bc0adbcedb758ea8e829a7a6c4df39dc5f4db49)
2016-08-26 13:22:44 -07:00
Etan Cohen
7f41e09b08 [NAN] Add retry count for transmitting L2 NAN messages
Bug: 28690414
Change-Id: I0a253f6d7e0d15f4bb50cae685c5e2496682cd67
(cherry picked from commit 93d3c79b54cbc913ff013102a408c6d330d6e73a)
2016-08-26 13:22:38 -07:00
Rebecca Silberstein
55e92882fd WifiManager: add WIFI_MODE_NO_LOCKS_HELD
Add a WifiLock mode representing that no locks are held (@hide).

Bug: 28669096
Change-Id: I774d5ff226e7c639812f9735555c8ea1ed6444af
Test: compiles and runtest frameworks-wifi
(cherry picked from commit df547e04c332e51fff159efe8bf612053a80cf75)
2016-08-26 13:22:33 -07:00
Christopher Wiley
b10249d64d Fix some trivial warnings in WifiP2pDevice.java
Add some missing @Override annotations, and mark some constants
as unused.

Bug: 28799169
Change-Id: I1ddef87ecb089b62e299544ae94a21d10ef42d98
Test: Compiles.
(cherry picked from commit b41e74f41ea78a30b03f3a37a0f4afb0aa1e05b5)
2016-08-26 13:22:29 -07:00
Etan Cohen
447b032334 [NAN] Add support for NAN RTT.
Provide API for NAN RTT through WifiNanManager. While NAN RTT could be executed
directly through RttManager the peer information is hidden by WifiNanManager (no
MAC address is exposed). Using WifiNanManager keeps the information hidden.

Bug: 26564277
Change-Id: I8deeb3f9e360dc05f2ea175d115f287590d50322
(cherry picked from commit fb8021c8371357dbb2b73135c89de57ef27e0131)
2016-08-26 13:22:08 -07:00
Etan Cohen
271c03738c [NAN] Remove OnNanDown notification from API
Duplicates the WIFI_NAN_STATE_CHANGED_ACTION broadcast. Remove
all state information from manager.

Bug: 28622807
Change-Id: I00632b216edb2dd74412861c4b46f01adec5a271
(cherry picked from commit cbf37593325f48168aa1aa49b12d30fe43345cc1)
2016-08-26 13:21:10 -07:00
Roshan Pius
72baa1de4d WifiConfiguration: Add new selection disable reasons
1. Add a new "permanently" disabled network selection status for disabling
networks after a user switch.
2. Add a new "temporarily" disabled network selection status for disabling
networks when WPS is enabled.

BUG: 28219928
Change-Id: I4ab7333ebaa830dadf73f317fd6bb81a02054235
(cherry picked from commit a6fac3eb6b29c7d370b56889cb53f6bebeeee04f)
2016-08-26 13:20:39 -07:00
Etan Cohen
5e680daad8 [NAN] Add type and nullability annotations. Update hide annotation.
Additional annotations on (what are planned to be) public APIs.
Fixed exposed API: @hide to a few new methods.

Bug: 27122760
Change-Id: Iea91de1b1c3c32a93378b5d90c1e88d994a10526
(cherry picked from commit d775a164c37294ee97f902792aa75da41d3ccf82)
2016-08-26 13:20:38 -07:00
Etan Cohen
5f47bf2199 [NAN] Add master switch to enable/disable usage of NAN APIs.
Add master switch to enable/disable usage of NAN. Tie into Wi-Fi
state machine (to enable/disable based on Wi-Fi enable/disable).
Dispatch broadcasts when NAN status changes.

Bug: 27698011
Change-Id: Iea36388443ff8d0dc26a280220022c6bdba6a0c8
(cherry picked from commit d3137af10291ff888125de747d9ee05f73f3fd8e)
2016-08-26 13:20:37 -07:00
Etan Cohen
51181fb85d [NAN] Re-factor connect/config flow
Simplify flow: configure and connect in a single call.
Prevent info leak: no longer provide configuration back to caller.
Update error status codes

Bug: 27617910
Bug: 27553226
Bug: 27579450
Bug: 27674927
Change-Id: Id7aba816a074dbbe0cb188cfe498c97dccbdcb27
(cherry picked from commit 52b3a24a029e3c5d9436a09b4175f6c49e02d92e)
2016-08-26 13:20:17 -07:00
Etan Cohen
231859c2aa [NAN] Refactor session lifecycle to clarify API & eliminate race conditions
(cherry-pick of 2a73c7fb2a4aba4dd75341414f1583e5fb1f4613)

Bug: 27257965
Change-Id: I4d7eaa6fa1f089bed2e9185f59a37f59b530975d
(cherry picked from commit 88a60495458903bee3adaf8396b5f6d71a2c0b1e)
2016-08-26 13:18:58 -07:00
Etan Cohen
564355afd6 [NAN] Removed NAN event registration - dispatch all callbacks.
All events dispatched by default - there's no reason to ignore events.
The specific identity changed events for which there are use-cases to
get or ignore is controlled through a new configuration.

(cherry-pick of a5ed693788ea64408ccf18850ee38905218ec4f4)

Bug: 27607613
Change-Id: I289a36157b55270c58311a016ef79f8746e0e0a0
(cherry picked from commit 574b3fb810f462bdcfced379b6223de9a9d15375)
2016-08-26 13:18:58 -07:00
Etan Cohen
26d5be2e5d [NAN] Consolidate publish/subscribe callback sets into single set
Merge onPublishFail & onSubscribeFail into onSessionConfigFail.
Merge onPublishTerminated & onSubscribeTerminated into onSessionTerminated.
A session is either publish or subscribe (never the two) so redundant.

(cherry-pick of 8414f5cf2bd86dcbaea1976590e838e41af554b3)

Bug: 27610709
Change-Id: I0282d17db88754428da25ee5f064b9a4805f9736
(cherry picked from commit 776ba56e53f8aab37b8a5a718fbf3bf84de65001)
2016-08-26 13:18:57 -07:00
Etan Cohen
065c07e991 [NAN] Replace session callback configuration control
Controlling session callback invocation:
- Remove event registration
- Add configurations to the subset (actually just termination) which
  can be configured through the HAL

(cherry-pick of e393f57d0de5a27d1cfd04a8c83a61559430539c)

Bug: 27607613
Change-Id: I608314cc2a9b077b4d5a2d2d0d315d55c6a7724b
(cherry picked from commit f6062eef209ae79a8a353125287aecdaa027fbea)
2016-08-26 13:18:57 -07:00
Etan Cohen
51fb9c67e4 [NAN] Expose match style configuration as public API.
Match style allows apps to configure getting a single notification
or continuous notifications (for all matches).

(cherry-pick of 8ef74534169bd3f3296e2ee42c0fda95c8518383)

Bug: 27568256
Change-Id: I9b7bd2e4e58af5c73188267d11c1288a93cf64ed
(cherry picked from commit 12213fb12d6c9af72a6244644a8253159cc62825)
2016-08-26 13:18:56 -07:00
Etan Cohen
52065684df [NAN] API cleanup - rename FLAGS.
Per API guidelines - non-overlapping constants can be (should be)
named with "FLAG".

(cherry-pick of ad3693d59b990f4994f96f6d3ca98cdbfe26723c,
 Change-Id: If8b2c0f9b2818215a64b5635e76731c8fdfd3b8d)

Bug: 27122760
Change-Id: I973d24f4f318471286087e6ae13b77cb119f01e7
(cherry picked from commit e698fab45cd0544ba63a89a03ff8f32de49e8f1c)
2016-08-26 13:18:56 -07:00
Etan Cohen
00abb43588 [NAN] Renamed listeners to callback per API guidelines
The interfaces had multiple functions and are hence callback
and not a listener.

Note: purely a rename operation.

(cherry-pick of 0d0f0c7faf530a0fa5595dd539c3f56afeb6603a,
 Change-Id: Ib12711f56a64052455843859125d72268c465fc0)

Bug: 27122760
Change-Id: Ie1905a5d907e5b09d449af52814b1aacb6426477
(cherry picked from commit 4e1af1b80735f5d61f089432a63a23937c994546)
2016-08-26 13:18:55 -07:00
Etan Cohen
b29bbcc54c [NAN]: API update - consolidate Puslish|Subscribe Data+Subscribe -> Config
Simplify configuration and consolidate structures whose difference
wasn't very clear.

(cherry-pick of e4c50de75273efaec4e9e8db6174e0bfc07d3105,
 Change-Id: I0651cade71eb146d9ea9219baf6d2253588db3de)

Bug: 27122760
Change-Id: I6320bd4c960e4473b4bf3c28e54a7ba492fa2cf9
(cherry picked from commit 581a4f7b31e3ccefce6c022582fd99ba0313b73c)
2016-08-26 13:18:54 -07:00
Etan Cohen
982a045a8b NAN: Support multiple instantiation per UID - introduce a client ID.
Add the concept of a client ID which is used to identify a specific
(one of several) clients in all API calls.

(cherry-pick of aa36f07194b29adee881e684b63f8bbdee6097bc,
 Change-Id: I43f13d51bee8b57c6d0ba1174168288b8d6c21c5)

Bug: 26962024
Change-Id: I0e0ddf37ea9800ae97115d6af384b54b49a40d74
(cherry picked from commit 5155990c09e7212709c8e154f05960f633f21a49)
2016-08-26 13:18:54 -07:00
Roshan Pius
d79eb347dc Merge "NetworkSelectionStatus: Fix copy constructor" 2016-08-26 17:10:25 +00:00
Paul Stewart
0e164b199e Document correct context for obtaining WifiManager
Added comments to both WifiManager WIFI_SERVICE.

Bug: 25015174
Change-Id: Ibd1e21d860ef2b7cc432b3da76671d22c02ef7cb
2016-08-26 09:27:04 -07:00
Roshan Pius
699680b6b4 NetworkSelectionStatus: Fix copy constructor
Add couple of missing elements in the NetworkSelectionStatus copy constructor.

BUG: 31102798
Change-Id: Ie5f3719b94acf021d4ae2756afd635388640168c
2016-08-25 19:47:06 -07:00
Randy Pan
30f47ea872 Deprecate QNS network disable reason BAD_LINK
am: 4156d61570

Change-Id: Ieeda34d8c764789e978905cf6847dd8925f5250b
2016-08-26 02:21:08 +00:00
Randy Pan
4156d61570 Deprecate QNS network disable reason BAD_LINK
WifiNetworkAgent#unwanted no longer disables the network.

Bug: 28558417
Change-Id: I2e7ed99ae4cb952f124c673376d967eeee2b4ece
2016-08-23 21:42:12 -07:00
Etan Cohen
b103b29488 [NAN] API changes/fixes addressing apilint issues
am: 9825309424

Change-Id: I55eb3368c7add766ea0b6463b3e2479b71c38c2e
2016-08-23 02:35:41 +00:00
Etan Cohen
9825309424 [NAN] API changes/fixes addressing apilint issues
Bug: 30983968
Change-Id: I2189442755380ad5d04f80bcb5978ca0c28e6420
2016-08-22 17:30:07 -07:00
Etan Cohen
0db76ad6ec [NAN] Add method to ConfigRequest to determine if non-default
am: 8266b3f876

Change-Id: I37c81386ef115524a2c7264a0821ce4e0ad19b9c
2016-08-19 23:28:43 +00:00
Etan Cohen
0153a74590 [NAN] Simplify publish/subscribe configuration - merge match filters
am: 6007681b19

Change-Id: I2f1e1368806d86417fc9c06271dadfd6e667e374
2016-08-19 23:21:57 +00:00
Etan Cohen
5782aae1be [NAN] Udpate NAN API documentation, clean-up visibility
am: 2e37b06dde

Change-Id: Iba3682d9ce1a3d2d1bd07636ef7c633d8e7ed847
2016-08-19 23:21:52 +00:00
Etan Cohen
8266b3f876 [NAN] Add method to ConfigRequest to determine if non-default
To be used in permission check.

Bug: 27696149
Change-Id: I5be5aed93c556cf24b596bd2a7c5672502f84d74
2016-08-19 12:31:31 -07:00
Etan Cohen
6007681b19 [NAN] Simplify publish/subscribe configuration - merge match filters
Merge Tx/Rx match filters into single Match filter configuration. Only
a single filter can be used at a time (either Tx or Rx).

Bug: 30948496
Change-Id: I32a9a0306dfd08295bc63145bccfe3739862f17d
2016-08-19 12:31:31 -07:00
Etan Cohen
2e37b06dde [NAN] Udpate NAN API documentation, clean-up visibility
Change-Id: I951340eebab35c10efe98dab86b58fe8efada169
2016-08-19 12:31:31 -07:00
Etan Cohen
ccb0b65be6 resolve merge conflicts of 6ffbcb3 to master
Change-Id: I23af5223f0e9810aa90fda4594ff6ccfc69b4053
2016-08-19 11:22:06 -07:00
Etan Cohen
879bc353c0 Merge "[NAN] Update finalize to check and warn user if resources not freed" into mm-wireless-dev
am: 907ce63ed1

Change-Id: Id45d1727dcfdf234e6345f546144c26408ae5fe6
2016-08-19 17:54:35 +00:00
Etan Cohen
6ffbcb3f73 Merge "[NAN] Provide calling package name to service" into mm-wireless-dev 2016-08-19 17:23:15 +00:00
Etan Cohen
907ce63ed1 Merge "[NAN] Update finalize to check and warn user if resources not freed" into mm-wireless-dev 2016-08-19 17:22:26 +00:00
Etan Cohen
83c9496cba [NAN] Do not expose WifiManager.isNanSupported as new API
am: a3264c4e3d

Change-Id: Ifd6a9bb6a129e441b033f3e392c88162ed029493
2016-08-19 16:58:00 +00:00
Etan Cohen
a3264c4e3d [NAN] Do not expose WifiManager.isNanSupported as new API
The WifiManager.isXxxSupported() only functions if HAL is enabled
and seems to be a duplicate of:

PackageManager.hasSystemFeature(PackageManager.FEATURE_WIFI_NAN)

Bug: 28251988
Change-Id: I8f410def6f0bd3d3fc0926072ab66acce52a0e14
2016-08-18 21:16:25 +00:00
Etan Cohen
9d55649613 [NAN] Update finalize to check and warn user if resources not freed
Use CloseGuard to check that disconnect() is called to free the resources
allocated by connect(). finalize() will still call disconnect() but now
also print out errors (if StrictMode enabled for feature).

Bug: 28068773
Change-Id: I5f5847c0261ef9f79a21fdb935509a85761591cc
2016-08-18 10:38:05 -07:00
Etan Cohen
cb34ec8f3a [NAN] Fix bad merge use rethrowFromSystemServer
Added 'throw' to the 'e.rethrowXXX()'. Not needed but seems
to be the accepted style.

Change-Id: I75e42d68ee6092699a55e26ee05151373139606d
2016-08-17 11:20:39 -07:00
Etan Cohen
7531a28e26 [NAN] Provide calling package name to service
Useful for permission checks.

Bug: 30000323
Change-Id: I8c7f06cff346437aa24ca5da9822cbd7b20c59c4
2016-08-11 09:31:21 -07:00
Svetoslav Ganov
d3663c04a7 Add WiFi toggle prompts - framework
If permission review is enabled toggling WiFi on or off
results in a user prompt to collect a consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

bug:28715749

Change-Id: I020601e208c0736005bcabc7b7b77b96eee45b03
2016-08-09 17:01:43 -07:00
Roshan Pius
23173a2efa WifiConfiguration: Expose NetworkSelectionStatus strings
Make the status/disable reason string arrays public to be used in
XmlUtil for restoring of data.

BUG: 30448209
Change-Id: If8201df9397edcc4251e5b6aa4d613212fb576ad
TEST: Unit tests
2016-07-28 10:19:51 -07:00
Randy Pan
7d82f98b8f Deprecate QNS network disable reason BAD_LINK
WifiNetworkAgent#unwanted no longer disables the network.

Bug: 28558417
Change-Id: I2e7ed99ae4cb952f124c673376d967eeee2b4ece
2016-07-28 10:14:31 -07:00