Add the requestorUid & requestorPackageName fields to
NetworkCapabilities. This is populated by CS when
a new network request is received.
These 2 requestor fields are also optionally used for network
matching. All of the regular app initiated requests will have the
requestor uid and package name set by connectivity service. Network
agents can optionally set the requestorUid and requestorPackageName
to restrict the network created only to the app that requested the network.
This will help removing the necessity for the various specifiers to embed
the uid & package name info in the specifier for network matching.
Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in
favor of setting the uid/package name on the agent to restrict the
network to a certain app (useful for wifi peer to peer API & wifi aware).
Bug: 144102365
Test: Verified that wifi network request related CTS verifier tests
pass.
Test: Device boots up and connects to wifi networks
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529
Change-Id: I58775e82aa7725aac5aa27ca9d2b5ee8f0be4242
* changes:
[NS B10] Cleanup : remove mRematchedNetworks
[NS B09] Create NetworkRanker
[NS B08] More simplification
[NS B07] More simplification
[NS B06] Simplification
[NS B05] Remove old dead code
[NS B04] Make the network selection request-major.
[NS B03] Add debug log showing the reassignment
[NS B02] Split out a function to apply a NetworkReassignment
[NS B01] Move the computation loop to a separate function
[NS A44 2/2] Apply requests after all networks rematching is computed
[NS A44 1/2] Update linger state before processing listens
This is better computed by the code that applies the change
than by the code that computes the reassignment
Test: FrameworksNetTests
Change-Id: I13e2764fd9b29145499085c3bb56de88a97d6c3c
Only computing the reassignment does not actually change the
default network.
Test: FrameworksNetTests
Change-Id: I21ddf5cc1e3d3817055dbda4246e38ceb0732407
This check is now unnecessary, seeing how the code adding these
changes is now guaranteed to only add at most one change for
each request.
Test: FrameworksNetTests
Change-Id: Ia0443602d9c89ee413e956df9c7b79f8f74813f7
This patch marks the most important turning point of this
refactoring. Cleanups removing unused code will follow.
Replace the old network-major reassignment computation with a
much simpler and faster loop that takes each request and assigns
it the highest-scoring network.
All tests pass, of course.
Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ie143802995155151a38a4eb1d2f26c3f29e556bd
This makes the rematchAllNetworksAndRequests function, which
is the nexus of the rematching code, very straightforward and
easy to read.
Bug: 113554781
Test: FrameworksNetTests
Change-Id: I5cea4ed7e06439494700d88ab202b696402fa360
This patch finally separates completely computing the rematch
from all the side effects. A collateral effect of this is to
compute correctly the background network state in
rematchNetworkAndRequests, which compensates the breakage
from the previous patch.
Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I998c729c385940168fcd6ba3f2e01911f1844ce1
To compute accurately whether a network is in the background, the
linger state needs to be updated. Do that before computing whether
a network is in the background and possibly calling
applyBackgroundChangeForRematch.
However ! As of this patch, rematchNetworksAndRequests computes
a wrong value when adding to the list of affected networks, because
it is looking at intermediate global state. Somehow this used to
compensate exactly for the way reading back the state was wrong.
There might have been a few undetected bugs there, but none is
known.
As such, as of this patch, rematchNetworksAndRequests still
computes a wrong value while the computation when applying that
state now computes the right one, so the tests do not pass.
This patch must be checked in together with A44 2/2 which will
fix the computation in rematchNetworksAndRequests, but is kept
separate for ease of review.
Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: Iaeed0d11bfa09f292f232ae020e944e430bc0184
CaptivePortal#reevaluateNetwork is added as a system API which
requires a proper permission check.
Bug: 148379628
Test: Manually check with captive portal
Test: atest FrameworksNetTests
Test: make test-api-stubs-docs-update-current-api \
system-api-stubs-docs-update-current-api
Change-Id: I3f974339d5bd53a6f6ecb0842c02a8264dc3a5f9
Merged-In: I559d42089aeb09801d14c251c5165fca793c3cb3
Add the requestorUid & requestorPackageName fields to
NetworkCapabilities. This is populated by CS when
a new network request is received.
These 2 requestor fields are also optionally used for network
matching. All of the regular app initiated requests will have the
requestor uid and package name set by connectivity service. Network
agents can optionally set the requestorUid and requestorPackageName
to restrict the network created only to the app that requested the network.
This will help removing the necessity for the various specifiers to embed
the uid & package name info in the specifier for network matching.
Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in
favor of setting the uid/package name on the agent to restrict the
network to a certain app (useful for wifi peer to peer API & wifi aware).
Bug: 144102365
Test: Verified that wifi network request related CTS verifier tests
pass.
Test: Device boots up and connects to wifi networks
Change-Id: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529
DataStallReport is updated to include the NetworkCapabilities and Link
Properties for the Network being reported on. This provides a more
complete picture of the Network conditions when the suspected data stall
was detected.
Bug: 148966398
Test: atest FrameworksNetTests
Change-Id: I913cf18c348b9f688f9d2a3d25a71bc94eb8f000
am skip reason: Change-Id I621cfbe165996c67b201ca2dd2f95a5ab9af10ee with SHA-1 ab2fed7241 is in history
Change-Id: I1016fc76028aeafa9f15841b4e2951957aa11578
This is necessary to avoid subsequent conflicts.
Test: none needed
Change-Id: I6e2cd9188e0e4bd7c71c6c56635f192dce73f325
Merged-In: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
This library is empty, and its functionality has moved
into libbinder/libhwbinder.
Bug: 148692216
Test: N/A
Change-Id: I3ee973cef68281cb57b4912b4b66c798b5d9d715
This will be necessary because updating the linger timer is
what lets the network agent know whether the network is
Test: ConnectivityServiceTest
Change-Id: I9b5a36f6d5eac5a404eff6740cd8f4dcbb0c2786