* changes:
Adjust a test for policy scoring
Enable policy ranking
Add CTS to verify NetworkAgent#setLingerDuration
Allow network providers to set the linger duration.
Fix nascent timer never get removed
[NS13] Remove the last usage of the legacy int
Add documentation
Use filter from CollectionUtils.
Fix a bug where updates of offers won't find existing offers
[NS12] Address comments on NS09
[NS11] Fix yieldToBadWifi over the policy scoring
Add doc for NetworkScore#getLegacyInt
Expose sendNetworkScore that takes a NetworkScore
The defaults follow the same pattern as framework-wifi-test-defaults to
allow unit tests to build against hidden API in Connectivity.
(clean cherry-pick of history in downstream branch)
Bug: 171540887
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ia8531f672820fcc8968f98494903e486c4e42652
Instead of using api_only: true, use a single java_sdk_library to
generate both framework-connectivity stubs and
framework-connectivity.impl.
Original change (project moved):
I76d7cf1ba31a3f38ae6b9facbf1b668860c8c165
Bug: 183600168
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I07d8c4c92c91939b8e8890fdb5db517b75faee2c
All targets need min_sdk_version 30 to be included in the tethering
APEX. They will actually never be used on SDK 30 and are only loaded on
31, but this is necessary to be included in com.android.tethering.
Original change (project moved):
I190fd1f3c9fabff057d0a2bd7f45b63a4fe447b3
This also includes changes to the lint baseline to make it match actual
filenames.
Bug: 171540887
Test: m
Test: m lint-check
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I24198565bc98d85d0c036be02e3a6c311b5bb2a3
All targets need min_sdk_version 30 to be included in the tethering
APEX. They will actually never be used on SDK 30 and are only loaded on
31, but this is necessary to be included in com.android.tethering.
Original change (project moved):
I190fd1f3c9fabff057d0a2bd7f45b63a4fe447b3
Bug: 171540887
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I3db00acc79b11058a1c235916b9bfe6c759afda5
We are enabling a new lint check where the min sdk != compile sdk.
It has produced a lot of errors and adding the baseline file(s)
allows us to continue work without introducing more problems.
This is a partial cherry-pick of change merged downstream.
Bug: 150847901
Test: m lint-check
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I214d60e858b7c03885d4d1c9a083e67a9340b4fe
At this stage, this is turned off. Unit tests will be
in a followup change.
Test: In a followup
Bug: 167544279
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I4448a3546fbc1a3dddf757982c031c5f39ba2889
Change-Id: I4448a3546fbc1a3dddf757982c031c5f39ba2889
(cherry-picked from ag/14010222 with fixes)
This exposes the two bits settable by the network agents in
Android S on NetworkScore. This is meant to be extensible in
future releases, or possibly for OEM upstreams.
Test: builds
CTS-Coverage-Bug: 184037351
Bug: 167544279
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: Id7ee1bd3e2679f0bd5200d5c299f18a33b87847c
Change-Id: Id7ee1bd3e2679f0bd5200d5c299f18a33b87847c
(cherry-picked from ag/14010221)
This exposes a mechanism for network providers to tell
the network stack that a given network must be kept up
for some specific reason. This is meant to be easier
for them than to have to file a request, in particular
because there is no guaranteed way to make sure the
request will be best matched by any given network.
Test: new test for this
Bug: 167544279
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I238a3ee5ee9262477a23b897e4141769dd1505d1
Change-Id: I238a3ee5ee9262477a23b897e4141769dd1505d1
(cherry-picked from ag/13929760)
The design is very simply expressed :
An offer is needed for a request if and only if that offer
might beat the satisfier for that request.
The implementation of "might beat" is NetworkRanker#mightBeat.
Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Bug: 167544279
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I0fe911eef2483ecbac48c733d56283b81538690a
Change-Id: I0fe911eef2483ecbac48c733d56283b81538690a
(cherry-picked from 7b6a33bd50)
This reverts commit 326f7bb023.
Reason for revert: broke errorprone:
"Error: Call requires API level 31 (current min is 30)"
Bug: 190350403
Change-Id: Ib778ba7a882dabc4d42ab9689e1cc51d09d9be62
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Now, PermissionMonitor reigster observer to listen the change
from all users, but "uids allowed on restricted networks" should
affect to all users instead of per each user. Thus, move the
setting from Settings.Secure to Settings.Global.
Bug: 189705071
Test: atest FrameworksNetTests
Merged-In: Ibea354d8dda1f02652a193820f3f9eb573b9a956
Change-Id: Ibea354d8dda1f02652a193820f3f9eb573b9a956
...instead of a Messenger.
This will be useful later to compare whether a given offer is
offered by the same provider satisfying a request.
Bug: 167544279
Test: ConnectivityServiceTest
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I975a9439021c7fa511c50ac982819b6dd146291e
Change-Id: I975a9439021c7fa511c50ac982819b6dd146291e
(cherry-picked from 148dcce559)
All targets need min_sdk_version 30 to be included in the tethering
APEX. They will actually never be used on SDK 30 and are only loaded on
31, but this is necessary to be included in com.android.tethering.
Original change (project moved):
I190fd1f3c9fabff057d0a2bd7f45b63a4fe447b3
Bug: 171540887
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ied5faa1a370cbc8836f46388fdb9b42d2a263232
Instead of including the whole libc++ library by linking it dynamically,
use the static version so that unused symbols can be stripped.
This allows reducing the APEX size by 1MB (3.7MB -> 2.7MB), as otherwise
libc++ is included twice for 32 and 64 bit variants.
Original change (project moved):
Ia66d795cf23d6f45997278300c103976433f7c5c
Bug: 171540887
Test: Device boots and has connectivity, size reduced
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ie1c5b2ea274238a226ad2d827148439fd5758bb5
NetworkUtils can just use the NDK to achieve the same.
Also make sure network handles can have the local nameservers flag, for
the JNI API, and create/parse them accordingly in Network.
Original change (project moved):
I2e7b78263f7ca0cab9458854858a7423f6bd2854
Bug: 171540887
Test: atest CtsNetTestCases (in particular MultinetworkApiTest,
DnsResolverTest, NetworkTest)
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I7a523aac93094beef6ff40d50678c12fe8840940
The API is the getter couterpart for setprocnetwork.
Use it in NetworkUtils so that the NDK API can be the source of truth
for the process network.
Original change (project moved):
Ie8f68cf1fa57deddb63324c1abf3d6fd5b0ef500
Bug: 171540887
Test: atest CtsNetTestCases
Tests in change I311b58585033c2ca50ce5477ea9cd94b6f127507
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Iaf255f4aa29fd2ae02770baea5548ee8d5d407f2
As API review feedback, setting allowed on restricted networks
should be by uid instead of package name for security reason.
Thus, update the getter/setter to return/accept set of uids.
Bug: 188085693
Test: atest FrameworksNetTests
Merged-In: I979bf98075e6c9c0ed7e891582843fddb62643cb
Change-Id: I979bf98075e6c9c0ed7e891582843fddb62643cb
This CL updates ConnectivityService to check location permissions for
ConnectivityDiagnostics callbacks last in the permission check process.
This minimizes misattribution of location access for networks that an
app is not administering.
This CL also updates ConnectivityDiagnosticsManager documentation to
clearly state that location permissions are required in order to receive
callbacks.
Bug: 187310575
Test: atest ConnectivityDiagnosticsManagerTest
Test: atest ConnectivityServiceTest
Change-Id: I2dbeddac6273e2392ccaeae51a1c7776d6d3da75
As the feedback from API review, the clearAll method in Builder
does not match the actual usage. Thus, remove it and replace
with withoutDefaultCapabilities to provide clearer usage.
Bug: 184735772
Test: make update-api ; m
Change-Id: Ida8d25d57504864f046e3403f593cc606fbfe982
Merged-In: Ida8d25d57504864f046e3403f593cc606fbfe982