2141 Commits

Author SHA1 Message Date
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
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
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
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
Etan Cohen
5a49329ace [AWARE] Make PeerHandle comparable/hashable
Add public equals()/hash() methods to PeerHandle. Allows the handle to
be used across multiple calls/sessions.

(cherry-pick of commit 4454bda052aea4087880674bb0e0f81ce2647009)

Bug: 68931709
Test: builds, unit test, integration test
Change-Id: Id06659a640931585893f21b9ee04982d921fe511
Merged-In: I87df50edb948a7afc90e496165013235ddca1e48
2017-12-07 13:45:54 -08:00
Jeff Sharkey
2337aec921 Deeper sanity checking of emitted types.
When emitting a method or field, verify that we're able to reference
all mentioned types.  This ensures that we don't accidentally
reference undefined classes/interfaces.

Test: manual inspection of API files
Bug: 69791141
Change-Id: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
Merged-In: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
2017-12-07 00:22:25 -07:00
Jeremy Joslin
1f6029bd6f Add isOpenNetwork() to WifiConfiguration.
Bug: 65639900
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I6ebd09b348473f9aa0394de289fd77f279e878a8
2017-10-04 10:01:59 -07:00
TreeHugger Robot
c9ae7df52a Merge "Use a LruCache in WifiNetworkScoreCache." into oc-mr1-dev 2017-08-25 20:29:32 +00:00
TreeHugger Robot
185a91c7ef Merge "[AWARE] Add a group network specifier allowing matches to multiple requests" into oc-mr1-dev 2017-08-22 02:18:44 +00:00
Stephen Chen
607c4accb5 Use a LruCache in WifiNetworkScoreCache.
Bug: 19948759
Test: runtest --path
frameworks/base/wifi/tests/src/android/net/wifi/WifiNetworkScoreCacheTest.java

Change-Id: I60bab6c2540df9819180d81d4e8e885066d92f51
2017-08-21 14:59:23 -07:00
Wei Wang
955e909aa0 Add LOCATION_HARDWARE permission to Rtt API.
Test: Manual
Bug: 62264080
Bug: 62344058

Change-Id: I00744a046c0fdcccd2f10924a70d816372e49fa4
2017-08-17 14:46:20 -07:00
Etan Cohen
523a425083 [AWARE] Add a group network specifier allowing matches to multiple requests
Add a group Aware network specifier which can match any of the
requests it contains. It is intended to represent a single connection
which may match multiple network requests.

Bug: 64125969
Test: unit tests
Test: acts/sl4a + new DataPathTest:test_multiple_identical_networks
Change-Id: I5971dc21c0a6d95fbd287ba0df0c7fba4ba580da
2017-08-17 10:49:40 -07:00
Jeff Sharkey
8478911f5e Remove a bunch of deprecated @SystemApi.
Verified that nobody should be using these APIs, and they've been
deprecated long enough that we can remove them.

Bug: 62341924, 62263907, 62264550
Test: make -j32 update-api && make
Change-Id: I9a2333ca13e4984b71374aa7ffed081e5106c67e
2017-08-11 14:45:47 -06:00
Rebecca Silberstein
283dc3b9a3 Merge "WifiManager: update docs on setWifiEnabled" into oc-dr1-dev
am: 54233f96d7

Change-Id: I47400de6e07c228e48c1467060a2179af9e4b4d9
2017-08-09 22:33:00 +00:00
Rebecca Silberstein
1cd6db44f2 WifiManager: update docs on setWifiEnabled
Update documentation to the setWifiEnabled call reflect what a return of
false would be for.  Note: False will be returned if the caller
requested to enable/disable wifi while in softap mode or airplane mode
is active.

Bug: 64374508
Test: checked generated docs
Change-Id: I1b1de84afee3844d326e7780a935a30d7f64d220
2017-08-04 16:09:22 -07:00
TreeHugger Robot
54c6667b37 Merge "getConnectionInfo should take calling package name as argument" into oc-mr1-dev 2017-08-04 09:49:44 +00:00
Ningyuan Wang
ab4ad4e1c7 Merge changes from topic 'do_not_roam_on_traffic' into oc-dr1-dev
am: 54e6518fc8

Change-Id: Ic02b8506afbd900d1fec0946148cd8f1a76ee5ce
2017-08-02 23:10:14 +00:00
TreeHugger Robot
54e6518fc8 Merge changes from topic 'do_not_roam_on_traffic' into oc-dr1-dev
* changes:
  Add traffic thresholds to prevent wifi network changes
  WifiInfo: Add getters for success tx/rx rate
2017-08-02 22:09:15 +00:00
Tony Mak
c55e27a5cd getConnectionInfo should take calling package name as argument
Bug: 64245163

Test: QR provisioning is now possible.

Change-Id: I9ee89b78224aaafd39a44234b704e4ed8cde56f4
2017-08-02 16:12:22 +00:00
TreeHugger Robot
46b2968ff9 Merge "Document WifiManager.getConnectionInfo permission" into oc-mr1-dev 2017-08-01 02:02:47 +00:00
TreeHugger Robot
3a38b51ae8 Merge "wifi: ScanResult: add carrier network indicator" into oc-mr1-dev 2017-07-28 16:12:14 +00:00
Michael Plass
e42dd31b3f Document WifiManager.getConnectionInfo permission
BSSID/SSID can be used to deduce location, so require the same
location permissions for access to these WifiInfo fields
requested using WifiManager.getConnectionInfo() as for
WifiManager.getScanResults().

Bug: 36770596
Test: make offline-sdk-docs
Change-Id: I1dd6d1871f13d669a9504c23ba3b11d769c142f9
2017-07-27 16:12:02 -07:00
Etan Cohen
002a2442c1 [RTT] Add a binder to the AIDL to enable cleanup
Pass a binder from the manager to the service to enable cleanup
on app death (using binder death listener).

Bug: 37443149
Test: verified using ResponderToolActivity test apk.
Change-Id: Ifb7797db812d4cb0b219e7cbd779bad323f2a4b4
2017-07-26 16:23:07 -07:00
Peter Qiu
d3ad154003 wifi: ScanResult: add carrier network indicator
This will indicate if the given AP is associated with a carrier network
or not, and also include the EAP type to use to connect to such AP if
it is associated with a carrier network.

Bug: 30988281
Test: manual
Change-Id: Ib5b6496026fb4cb9004353ea90870d5ee4e96136
2017-07-26 14:01:13 -07:00
Etan Cohen
a1dff77196 [P2P] Public API to clean-up resources of P2P
1. Add public API to close a Channel and allow configuration to be
   cleaned-up. Actual clean-up will only happen when the last p2p
   client executes close or terminates (binder death is triggered
   for the service).
2. Add Close Guard to verify that API is called - issue warning
   otherwise. Note that to actually get the warning an app needs
   to use the StrictMode policy:

   StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
       .detectLeakedClosableObjects().build());

Bug: 37443149
Test: (new) unit tests, CtsVerifier, Settings/WFD app
Change-Id: I9590101ef7f7ba0a90812634ac1b931d1482fe72
2017-07-20 14:00:41 +00:00
Michael Plass
ab98c9dbb8 Merge "WifiInfo - document packet counters and rates" into oc-dr1-dev am: 8d51d3e512
am: 231610fc1a

Change-Id: I4e0f4c17c9d09ec2c4f181705052912d370be0eb
2017-07-20 04:02:27 +00:00
Ningyuan Wang
d69d86e3f0 WifiInfo: Add getters for success tx/rx rate
This adds getters to get success tx/rx rate, returning in the
unit of 'packets per second'.
This also adjusts the constant OUTPUT_SCALE_FACTOR so it can
be more informative.

Bug: 62428282
Test: compile, unit tests
Change-Id: I989defd8fdc14dfc78692385fda86fb20b369b7b
2017-07-19 16:59:20 -07:00
Glen Kuhne
446afac159 Add FailureReason to WifiConfiguration
Added a new field that caches extra details about connection failures so
that they may be surfaced in the UI.

Bug: 62915994
Test: Manual...
Change-Id: I6e7860df4ea755e72fbdd4b6bf514338f2f1de80
2017-07-18 14:03:32 -07:00
Michael Plass
5be7bc7516 WifiInfo - document packet counters and rates
Bug: 63039962
Test: wifi unit tests
Change-Id: Ibc17265e88ed174fce9bbffa32261080d076cea3
2017-07-18 13:44:43 -07:00
Rebecca Silberstein
e6edaa9ea1 WifiManager: deprecate and remove setWifiApEnabled
Officially deprecate and remove the setWifiApEnabled call.

Bug: 38436773
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh
Test: cts-tradefed run cts-dev --mo CtsNetTestCases -t android.net.wifi.cts.WifiManagerTest
Change-Id: Ifefe0b186d074b49ab1cc94e1c166117f3d7bdf7
2017-07-17 18:46:27 +00:00
Jeff Sharkey
43d2a1700b Move "metered" persistence to WifiConfiguration.
For a long time we've had a nasty tangled dependency between Wi-Fi
and NPMS, since they both persisted different details for configured
networks.  As part of preparing for new carrier data plan APIs, move
the tracking of meteredness over to WifiConfiguration.

This also cleans up how meteredness is communicated through
NetworkAgents to rely completely on NET_CAPABILITY_NOT_METERED by
removing the metered flag on NetworkInfo, which has caused confusion
and staleness.

Migrates any existing user-configured metered networks over to
WifiConfiguration once the device finishes booting.

Remove support for NetworkQuotaInfo, since this information can no
longer be made available to apps.  Frustratingly, some apps are
using it, so keep the object around returning stub values, and shame
them in the logs.

Bug: 63391323
Test: builds, boots, Wi-Fi policy is upgraded
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: I64f865ddeb65cfcd330f8d2a847368abdf960a07
2017-07-14 11:46:31 -06:00
Roshan Pius
bc15a1e3ee Merge "wifi: Params for SAR limits" into oc-dr1-dev 2017-07-12 18:33:20 +00:00
TreeHugger Robot
4a82979153 Merge "Document WifiScanner callback behaviors" into oc-dr1-dev 2017-07-12 17:14:05 +00:00
Ningyuan Wang
d871e180f1 Document WifiScanner callback behaviors
This adds the missing documents for WifiScanner.ActionListener.
This also fixes the existing inaccurate documents.

Bug: 29524465
Test: compile

Change-Id: I40d40a6293cdb0af6b8cad45062722ee2a4b746d
2017-07-11 21:37:46 +00:00
Roshan Pius
aa85acc8e0 wifi: Params for SAR limits
Add 2 new config.xml values for setting TX power limits for SAR
requirements. The first boolean enables/disables the whole feature, the
second value sets the max power that OEM's can set if they want the tx power
to be limited.
Also, added the new HAL feature set enum value in WifiManager.

Bug: 62437848
Test: Compiles
Change-Id: Iab3ffad8df2fccd0ea2beac95fbf8458e268f21b
2017-07-07 11:00:18 -07:00
Etan Cohen
c0fabefba4 [AWARE] Fix close guard method name
Close guard prints out a message when it is triggered. The message
should be the method which should have been called. The method has
been renamed from 'destroy' to 'close' - but the log message wasn't
updated.

Bug: 37514387
Test: N/A (string change)
Change-Id: I8ee0b9539692095c771829fffe9fa4bf60aaa504
2017-07-06 06:47:27 -07:00
Etan Cohen
0dd8a3cd59 Merge "[P2P] Eliminate separate storage of binders - a memory leak" into oc-dr1-dev 2017-06-24 00:36:56 +00:00
TreeHugger Robot
702d4d56fe Merge changes from topic 'wrong_password' into oc-dr1-dev
* changes:
  SettingsLib: set network status for wrong password error
  wifi: add "wrong password" network disabled reason
2017-06-23 18:19:05 +00:00
Roshan Pius
24e9b7d4cf Merge "WifiEnterpriseConfig: New copy method to ignore masked password" into oc-dev
am: db11f55cb7

Change-Id: Id9cb3a6211cf516875c6ad4ac10058bb352ebd46
2017-06-23 12:28:27 +00:00
Roshan Pius
1e11d00627 WifiEnterpriseConfig: New copy method to ignore masked password
To ignore the masked password sent by apps, add a new copy-constructor
equivalent method which will ignore the masked password.

Bug: 62893342
Test: Unit tests.
Test: Manual tests with the linked CL.
Test: Regression tests.

Change-Id: Ib208dcd94a888e07a9b3dc0442620233ea7791e5
2017-06-22 16:22:05 -07:00
Etan Cohen
9304be6f80 [P2P] Eliminate separate storage of binders - a memory leak
A global storage of binders is replaced by attaching a binder
to its corresponding channel.

Bug: 62905652
Test: NonConcurrencyTest:test_*p2p* acts/sl4a tests passing
Test: p2p/aware behavior verified using Settings app
Change-Id: I08e8d8f5d56cfd81d078e74f3cf2ccc5d06f61e3
2017-06-22 18:26:07 +00:00
TreeHugger Robot
8c4d17b4d8 Merge "Fix confusing javadoc for WifiManager.EXTRA_RESULTS_UPDATED" into oc-dr1-dev 2017-06-20 21:46:05 +00:00
Peter Qiu
873edc6e76 wifi: add "wrong password" network disabled reason
Bug: 62444625
Test: manual test
Test: integration test
Change-Id: I8b56f926fce41eea33522d8daa82b6a5fe1b31c0
2017-06-20 13:35:33 -07:00
TreeHugger Robot
088f2754c0 Merge "wifi: add API for retrieving Hotspot 2.0 OSU providers" into oc-dr1-dev 2017-06-14 16:14:44 +00:00
Ningyuan Wang
47e9400f1e Fix confusing javadoc for WifiManager.EXTRA_RESULTS_UPDATED
This rephrases the javadoc for WifiManager.EXTRA_RESULTS_UPDATE
and WifiManager.SCAN_RESULTS_AVAILABLE_ACTION, explaining the
meaning of WifiManager.EXTRA_RESULTS_UPDATED in a better way.
This also removes "supplicant" keyword in this javadoc because
we no longer use supplicant for scan.

Bug: 62273016
Test: compile
Change-Id: Ib8ce2d6e8aaf70819c9e2622fb5acfcc14a0d593
2017-06-13 13:51:23 -07:00
Peter Qiu
e78c25e970 wifi: add API for retrieving Hotspot 2.0 OSU providers
For an R2 Passpoint AP, there might be zero or more OSU providers
associated it.  Add an API to retrieve the associated OSU providers.

Bug: 62235301
Test: manual test by exercising this API in WifiTracker and verify
      the content of the OSU provider

Change-Id: I2e730f0b16d80e0b97b4ce7cbd086b606e71eb0c
Merged-In: I2e730f0b16d80e0b97b4ce7cbd086b606e71eb0c
2017-06-13 16:00:26 +00:00
Etan Cohen
830f4db231 [ErrorProne] Fix Error Prone warnings in aware/p2p code
Bug: 33104624
Test: builds
Change-Id: Ibf17a02c81aebfa28903fe440a75e3c2e9244a19
2017-06-12 11:18:10 -07:00
Etan Cohen
486a411224 [AWARE] Add validity check on PMK/Passphrase lengths
Bug: 62376042
Test: unit tests + inegrated (sl4a) tests
Change-Id: Ib6383a0ba9ef61114eb72b9a04cc683792b8e89d
2017-06-07 12:08:09 -07:00
Etan Cohen
af3022347f [P2P] Add binder to service calls
Bug: 33040182
Test: unit tests, run-time behavior
Change-Id: Ic383efc858bb4454d99c98ab24365c63ad3e7f54
2017-06-06 17:23:44 +00:00
Jeff Sharkey
28f6dc9512 Merge "Give Doclava our manifest; more permission docs." into oc-dev am: 65d4cbba37
am: 67cb5f5210

Change-Id: Ic4c30cdb8bbfda5b3703eb3c7c36c1bf8ab3a216
2017-06-06 16:17:39 +00:00