When a keepalive is paused, it should sit on its hardware
slot for this network to make sure that it is possible to
resume later, even if it means other keepalives can't be
started at the same time.
Test: update AutomaticOnOffKeepaliveTrackerTest for this
Fixes: 268149573
Fixes: 283886067
(cherry picked from https://android-review.googlesource.com/q/commit:ebb0747af330b12cacb9675e43880e884f514b1d)
Merged-In: Ida325bdea198d751483a83ee5d9ec26e39812137
Change-Id: Ida325bdea198d751483a83ee5d9ec26e39812137
In order for PacProxyManager to function properly it needs a device that has support for Javascript interpreter, so devices without the WebView feature cannot support PAC proxies.
Change-Id: I819171e2fe4197a546864d39599e22efee5841dc
The namespace used in production code is NAMESPACE_TETHERING, not
NAMESPACE_CONNECTIVITY.
Test: atest com.android.cts.net.HostsideVpnTests
Change-Id: I0f31176c521e2a877a964c2bbe6f387c4e71352a
The testFactoryReset has around 1% flaky. Temporarily disable
it till flaky is fixed, which is blocked by b/254183718.
Bug: 277856014
Test: atest ConnectivityManagerTest
Change-Id: I2a2156957e9aa05fc9c12133cad4d7dd63f4e425
Add options to control whether only send IPv6 packet on IPv6 only
network. In some use case, IPv6 query should not be sent on a dual
network.
Added a small improvement to send an ANY query if both SRV & PTR
records are needed.
Bug: 284480254
Test: atest CtsNetTest FrameworksNetTests
Change-Id: I8f55db6f5e8ae606ac167fb363bc9b2fb9b5fc14
This is a part of preliminary work for adding tests in the
follow up commit.
Bug: 196453719
Test: atest FrameworksNetTests
Change-Id: Ibf1bd267c4c144f533380eeafc6a6144f64da483
When a keepalive is paused, it should sit on its hardware
slot for this network to make sure that it is possible to
resume later, even if it means other keepalives can't be
started at the same time.
Test: update AutomaticOnOffKeepaliveTrackerTest for this
Fixes: 268149573
Fixes: 283886067
Change-Id: Ida325bdea198d751483a83ee5d9ec26e39812137
Register a receiver of ACTION_DEFAULT_SUBSCRIPTION_CHANGED to update
the cached default subId.
Bug: 273451360
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:7b36f2322bf0e7b8f7c916a98914289f9878b676)
Merged-In: I3a38af7615fde2811449585d4e659ffaf29c5670
Change-Id: I3a38af7615fde2811449585d4e659ffaf29c5670
Use AlarmManger ELAPSED_REALTIME_WAKEUP to trigger writing the metrics
to statsd on an interval of 24 hours.
Bug: 273451360
Test: statsd_testdrive
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:19ea1502712ec988b52e5681816368106a6fd8cb)
Merged-In: I5e21de058336819189532beffe2b3239a3c69599
Change-Id: I5e21de058336819189532beffe2b3239a3c69599
upTimeMillis does not include time spent in deep sleep. Use
elapsedRealtime instead.
The time spent in deep sleep is important to include since the
keepalives may still be ongoing during deep sleep and so that time
should be included in duration calculations.
Bug: 273451360
Fixes: 281639289
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:d5ca3f1f6968a688b2128360da79595d1a1b9784)
Merged-In: I54350d49bdfec58cc00dea6d82cba01f5d387bb0
Change-Id: I54350d49bdfec58cc00dea6d82cba01f5d387bb0
Store the number of requests and app uids on start keepalives. The
values are also stored in KeepaliveStats and can be recalculated from
KeepaliveStats when reset. Fill the DailyKeepaliveInfoReported proto
with these values.
Bug: 273451360
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:91adc204d846970e5817c244eeb1e0d62aed87cc)
Merged-In: Ifb9a0048896d31c8ea897cf14768e94dcfd3b010
Change-Id: Ifb9a0048896d31c8ea897cf14768e94dcfd3b010
Register a listener to get notified of SubscriptionInfo changes and
store all carrierIds of active subscriptions in a cache. The executor
for the listener callback runs on a different thread to the connectivity
thread but posts the SubscriptionInfo list to the connectivity thread
for caching.
Bug: 273451360
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:c48d856976c9fcb8150f4de524d69cc5d68ce46d)
Merged-In: I889d4da725ccda713367309c257622a0bf9939f3
Change-Id: I889d4da725ccda713367309c257622a0bf9939f3
Create a nested class KeepaliveStats to store and track the carrier info
and lifetime metrics for each keepalive where a keepalive is identified
by its network and slot number. Then aggregate the metrics using
(carrierId, transportTypes, intervalMs) as the key before writing the
metrics into the KeepaliveLifetimePerCarrier proto. Also aggregates the
metrics whenever a keepalive is stopped to free up the (network, slot).
Bug: 273451360
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:ad03b887e63e2ad0678fe7fc4394d23a690a14d5)
Merged-In: I113ec68053710a7f41f64a9d6fa4dd83bd924225
Change-Id: I113ec68053710a7f41f64a9d6fa4dd83bd924225
Store the handler that should be running all the public methods and
use it by comparing its thread with the current thread.
Also refactor the tests to use and run on a test handler thread.
Bug: 273451360
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:1b71e3867345d6e1a3bc7c38a582ba9e9f9aee3d)
Merged-In: I053f1043a3b518728c4b30b94eec1d33fbfe39c0
Change-Id: I053f1043a3b518728c4b30b94eec1d33fbfe39c0
Currently, various codepaths in ConnectivityService disconnect
networks using NetworkAgentInfo#disconnect. This posts a message
to the NetworkAgent to disconnect and also posts a message to
ConnectivityService to call disconnectAndDestroyNetwork, which
performs all cleanup in ConnectivityService. These two messages
race and the order is non-deterministic.
Instead, always disconnect using disconnectAndDestroyNetwork,
and have disconnectAndDestroyNetwork post the message to the
agent to disconnect.
This fixes a bug where if wifi uses unregisterAfterReplacement
twice in quick succession, when the third agent connects it
doesn't work because the interface is still being used by the
second network.
Also remove the import of IllegalArgumentException to keep the
linter happy (java.lang.* never needs to be imported).
Bug: 286649301
Test: covered by existing tests
(cherry picked from https://android-review.googlesource.com/q/commit:4bc9fa6b8cefca88f1065e95df06532979c202ee)
Merged-In: Ie01f5589d6839ac6db25f0ba98fc929fbb5b0a96
Change-Id: Ie01f5589d6839ac6db25f0ba98fc929fbb5b0a96
The testConstructor_afterR is a new added test which should be
run with latest connectivity module, but some test combinations
do not contain latest connectivity module which will fail the
test. Add ConnectivityModuleTest annotation to skip combinations
without latest connectivity module.
Bug: 287226038
Bug: 196453719
Test: atest ConnectivityCoverageTests
Change-Id: I16dfa8f86f77bb3561a24684e7823f8d45b7613d