Commit Graph

1414 Commits

Author SHA1 Message Date
Roshan Pius
186159de58 Merge "WifiManager: Remove unused methods" am: efb7bec56a am: 718c90daf1
am: 4898225abc

Change-Id: I7bc7504eaa93b25d6aec1b4b5e337a14085639e7
2016-09-07 22:02:59 +00:00
Treehugger Robot
efb7bec56a Merge "WifiManager: Remove unused methods" 2016-09-07 21:43:20 +00:00
Roshan Pius
8a9dcc81d4 Merge "WifiEnterpriseConfig: Refactor set/get field values" am: c4856bd73c am: 655ae32d57
am: 32f3a3f940

Change-Id: Iba70f027e1de751c95142b9515898b226089569a
2016-09-07 16:05:31 +00:00
Roshan Pius
c4856bd73c Merge "WifiEnterpriseConfig: Refactor set/get field values" 2016-09-07 15:47:40 +00:00
Roshan Pius
d74f710e25 Merge "WifiConfiguration: Fix isEnterprise" am: 9221c96ae0 am: e597198f12
am: 478bb2b44d

Change-Id: I4981990a4dc3aa1dde70625b93798a2fd6ff8263
2016-09-06 23:21:41 +00:00
Roshan Pius
6cfe668c80 WifiManager: Remove unused methods
Remove the unused hidden methods from WifiManager.

BUG: 29449615
TEST: Compiles, boots up.
Change-Id: Ie7e6f438b23a368e44d35390267d5505e12bb75e
2016-09-06 13:38:31 -07:00
Roshan Pius
29ce1dab5a WifiConfiguration: Fix isEnterprise
Add a check for the eap method in Enterpriseconfig associated with the
WifiConfiguration.

BUG: 31275240
Change-Id: I21aabb09bdd21e29a80d4b9c6ea0e2b1f0d7e2df
2016-09-06 10:13:40 -07:00
Roshan Pius
c8cd577c86 WifiEnterpriseConfig: Refactor set/get field values
WifiEnterpriseConfig has a few keys which are generated internally
have unquoted values. However, the public setFieldValue() always quotes
the value when set.  So, this causes a problem when restoring
these field values from config store. Since this is an internal
disctinction that only WifiEnterpriseConfig understands, add a list to
check if a particular field value needs to be quoted or not. Also,
remove any direct "mFields.put" invocations with |setFieldValue|.

While there,
Refactor the existing |setFieldValue| & |getFieldValue| methods.

BUG: 31246524
TEST: Unit tests
TEST: Integrated with config store and verified that a previous TLS EAP
connection failure is no longer seen.

Change-Id: Ib85f3bce378720a6a6c2ae1439837a8e866a088d
2016-09-06 10:05:02 -07:00
Roshan Pius
812bd82c63 Merge "WifiEnterpriseConfig: Fix copy constructor" am: 13886253be am: 8abe7c5544
am: 95cdf96320

Change-Id: I0a09a2f0d1a2e49d928bf42e165a4586c501d4f0
2016-09-02 21:26:30 +00:00
Roshan Pius
9709b8b372 WifiEnterpriseConfig: Fix copy constructor
Add missing elements from WifiEnterpriseConfig copy
constructor.

BUG: 31245222
TEST: Ran ACTS WifiEnterpriseTest suite.
Change-Id: Ia6f95fca4131ad9a1facca8f9c4c856dff868058
2016-09-02 14:08:50 -07:00
Roshan Pius
e500e63cc0 Merge commit '3f3ed24' into stage-aosp-master am: e9b6029153
am: 756cbb248e

Change-Id: I8d6ad1bcd2c41553ced95c9f59e8a35889d24edf
2016-09-02 07:32:34 +00:00
Roshan Pius
d2d667275d NetworkSelectionStatus: Fix copy constructor
Add one more missing element from NetworkSelectionStatus copy constructor.

BUG: 31102798
Change-Id: Iae18f944e7ef722b280b20a51f128f90b2ff45c7
2016-09-01 15:08:44 -07:00
Mitchell Wills
fe11efd868 Merge commit 'accde60f09508f9543a094247ed95ce2ae605912' into nyc-mr1-dev-plus-aosp
Change-Id: I732a9b0bb6e569be342a6df3640f4e539f9ccce0
2016-08-29 20:38:08 -07:00
Mitchell Wills
e0d09999e9 DO NOT MERGE Revert "Add WiFi toggle prompts - framework"
This reverts commit 40f8b92518.

Change-Id: I9a1d861277e5d32405da5815c8b4e5d616febf10
2016-08-29 20:21:42 -07:00
Mitchell Wills
8efb84e3e0 DO NOT MERGE Revert "Add WiFi toggle prompts - framework"
This reverts commit 40f8b92518.

Change-Id: I23e8b6ac97d8853c271429fc13fbfa313717a95a
2016-08-29 20:15:48 -07:00
Mitchell Wills
722de5f9d0 DO NOT MERGE Manually merge commit 'f28778064383821ccf48c9570191f34a24aa513f' into nyc-mr1-dev-plus-aosp
Change-Id: I7cb1f97a5b931c2057a811d7947f47ad7320ef1c
2016-08-29 17:46:44 -07:00
Roshan Pius
521c66e73c NetworkSelectionStatus: Fix copy constructor
Add couple of missing elements in the NetworkSelectionStatus copy constructor.

BUG: 31102798
Change-Id: Ie5f3719b94acf021d4ae2756afd635388640168c
(cherry picked from commit 699680b6b4)
2016-08-29 11:26:57 -07:00
Randy Pan
22de5aaca9 Deprecate QNS network disable reason BAD_LINK
WifiNetworkAgent#unwanted no longer disables the network.

Bug: 28558417
Change-Id: I2e7ed99ae4cb952f124c673376d967eeee2b4ece
(cherry picked from commit 4156d61570)
2016-08-29 11:26:57 -07:00
Etan Cohen
b81c35f54b [NAN] API changes/fixes addressing apilint issues
Bug: 30983968
Change-Id: I2189442755380ad5d04f80bcb5978ca0c28e6420
(cherry picked from commit 9825309424)
2016-08-29 11:26:56 -07:00
Etan Cohen
30a472e6b3 [NAN] Add method to ConfigRequest to determine if non-default
To be used in permission check.

Bug: 27696149
Change-Id: I5be5aed93c556cf24b596bd2a7c5672502f84d74
(cherry picked from commit 8266b3f876)
2016-08-29 11:26:56 -07:00
Etan Cohen
b6701faaf0 [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
(cherry picked from commit 6007681b19)
2016-08-29 11:26:55 -07:00
Etan Cohen
b0214c4cd5 [NAN] Udpate NAN API documentation, clean-up visibility
Change-Id: I951340eebab35c10efe98dab86b58fe8efada169
(cherry picked from commit 2e37b06dde)
2016-08-29 11:26:55 -07:00
Etan Cohen
28035d98f0 [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
(cherry picked from commit a3264c4e3d)
2016-08-29 11:26:54 -07:00
Etan Cohen
fd11ec1576 [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
(cherry picked from commit 9d55649613)
2016-08-29 11:26:54 -07:00
Etan Cohen
fc3c0a0582 [NAN] Fix bad merge use rethrowFromSystemServer
Added 'throw' to the 'e.rethrowXXX()'. Not needed but seems
to be the accepted style.

Change-Id: I75e42d68ee6092699a55e26ee05151373139606d
(cherry picked from commit cb34ec8f3a)
2016-08-29 11:26:53 -07:00
Etan Cohen
4503dc6fba [NAN] Provide calling package name to service
Useful for permission checks.

Bug: 30000323
Change-Id: I8c7f06cff346437aa24ca5da9822cbd7b20c59c4
(cherry picked from commit 7531a28e26)
2016-08-29 11:26:52 -07:00
Svetoslav Ganov
40f8b92518 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
(cherry picked from commit d3663c04a7)
2016-08-29 11:26:51 -07:00
Roshan Pius
47fb68bd24 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
(cherry picked from commit 23173a2efa)
2016-08-29 11:26:49 -07:00
Etan Cohen
0e70bdd7a5 [NAN] Add LV utilities (TLV with T size of 0).
NAN uses LV (not TLV). Expose an LV variant of TLV to make API
cleaner.

Bug: 30096512
Change-Id: I74b4c514d50f1df5750b521bd68a5e2d832d92c3
(cherry picked from commit 009b1fcb85)
2016-08-29 11:26:48 -07:00
Etan Cohen
2b1e7eabfc [NAN] Fix TlvElement member names - reflect public access.
Bug: 30096512
Change-Id: Ic2ab61e891bead6f6e8f13d9ac311ead8fecba5b
(cherry picked from commit e40b4d344e)
2016-08-29 11:26:48 -07:00
Etan Cohen
c579d20618 [NAN] TLV utilities iterator - throw correct exception
Make sure that iterator.next() validates that next element exists -
otherwise throw the exception specified by the interface.

Bug: 30096512
Change-Id: I327da433e3f1181e272c81ee503cbe8aab323f7e
(cherry picked from commit 3e5ac12302)
2016-08-29 11:26:47 -07:00
Etan Cohen
ee58a68285 [NAN] Modify arguments from "array, length" to "array"
Arrays carry their own lengths. There's no need to provide mechanism
to 'shave' the array - could be done explicitly by caller if needed.

Bug: 29617160
Change-Id: Ib135aa04145f400163cd1a8908dfca4590b4480d
(cherry picked from commit 0a5b7efcb2)
2016-08-29 11:26:47 -07:00
Etan Cohen
44cb6ef1de [NAN] NAN System Api: RTT
Modify visibility of startRanging [NAN RTT] to SystemApi. Matches the
visibliity of the RttManager API.

Change-Id: Ia92de9885d0b38dfce74484f437bd122dd53cbf6
(cherry picked from commit ab9ef45971)
2016-08-29 11:26:46 -07:00
Etan Cohen
2d3face59a [NAN] Provide inteface MAC address to app.
Expose NAN discovery interface MAC address to app. Required
to enable OOB discovery with other NAN functionality
(e.g. data-path).

Bug: 30000035
Change-Id: Id3c336a61a36522d7011557c805bc3c5307747a1
(cherry picked from commit d097f8a4e5)
2016-08-29 11:26:45 -07:00
Etan Cohen
6060d85878 [NAN] Add (T)LV validation testing
Test for validity of a (T)LV. Used in construction of publish and
subscribe configuration (both Tx and Rx filters).

Bug: 30007730
Change-Id: Ibf2179121d45c582bb054c06ec2a765ed0927040
(cherry picked from commit c13b9f6b7d)
2016-08-29 11:26:45 -07:00
Etan Cohen
01db037f45 [NAN] Add validity checks for service name
Add checks that the service name is valid per spec (see bug for
details). Stores internally as a byte[] for further propagation.

Bug: 30000106
Change-Id: Iab413aba6755c97bfca0332d6eaa21f636e47f3f
(cherry picked from commit adfbfb3a93)
2016-08-29 11:26:43 -07:00
Etan Cohen
a77565d3fc [NAN] Fix assumption about Strings containing single-byte characters.
Code assumed that each character was represented by a single byte.

Change-Id: I92ea63f7273379ed1035f10c207d41e3e352bf38
(cherry picked from commit 9a6161c61c)
2016-08-29 11:26:43 -07:00
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 15849dc463)
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 a464a9fce8)
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 0a726ac690)
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 af1eafd7b1)
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 6a89ee2d90)
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 08131593a8)
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 7bc0adbced)
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 93d3c79b54)
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 df547e04c3)
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 b41e74f41e)
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 fb8021c837)
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 cbf3759332)
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 a6fac3eb6b)
2016-08-26 13:20:39 -07:00