When disconnecting from a default network X and falling back on another
connected network Y as the new default, ConnectivityService was
attempting to record this event as a X -> Y "atomic" transition.
In practice the default network connectivity is actually lost and
recovering default network takes some non-zero time.
This patch changes the event recording to always record disconnection as
X -> 0 events. At the same time, if there is a fallback network that is
elected as the new default ConnectivityService will also record a 0 -> Y
event.
This patch also improves pretty-printing of DefaultNetworkEvent.
Extract from $ adb shell dumpsys connectivity_metrics_logger --events
17:51:00.086: DefaultNetworkEvent(0 -> 100:CELLULAR)
17:51:25.232: DefaultNetworkEvent(100:IPv4 -> 101:WIFI) # wifi goes on
17:51:44.064: DefaultNetworkEvent(101:DUAL -> 0) # wifi goes off
17:51:44.187: DefaultNetworkEvent(0 -> 100:CELLULAR)
Bug: 28204408
Change-Id: I63252633235bf6ba833b9ac431a80dda75a93e67
am: b5987d7993
* commit 'b5987d79937b2f1b0ec68c84371aea36f7e2b8a1':
Fixed enforceMeteredApnPolicy when Data Saver is on.
Change-Id: If9e525f86b29960ed4dfdd6ca27bc5d0077454ae
am: 1411952a68
* commit '1411952a68f6fa2d2b3a3ee9599e24026454b19b':
Fixed enforceMeteredApnPolicy when Data Saver is on.
Change-Id: I62eb108dfad2ac1ffd2b541470f01a7923d92731
am: efd3a1749f
* commit 'efd3a1749f2737199643cc29bea6132a9786223b':
Fixed enforceMeteredApnPolicy when Data Saver is on.
Change-Id: I87b596346c058c7ac8efbebb67b43664f1be0fed
When enforceMeteredApnPolicy() is called when Data Saver mode is on and
the caller's UID is not whitelisted, it should add a
NET_CAPABILITY_NOT_METERED to the capabilities.
Change-Id: Ieed4f4a7634ee023ec58c91859263655e0ba62d4
Fixes: 28608499 (and https://code.google.com/p/android/issues/detail?id=208478)
am: d198b4d891
* commit 'd198b4d891b704965bfc569da00c6206ece87177':
Lock down networking when waiting for always-on
Change-Id: I50583a9738ac51378e5f5dcbbaa396f1aa30f97c
am: 43fbfbf94c
* commit '43fbfbf94c5b8ae4353b73c36d85ff02fd36fc67':
Lock down networking when waiting for always-on
Change-Id: I883c68faafde99eb00c37962a517dceb4a4f9d32
am: 198d6cf688
* commit '198d6cf688403cd82921510490c49219b3bdd487':
Lock down networking when waiting for always-on
Change-Id: I4160a61ca437d20df4342a44ed24fc6ad47962c6
am: 1540a79a8b
* commit '1540a79a8b65e1f2652f4882784d6386f9661cae':
Lock down networking when waiting for always-on
Change-Id: I7be0a85597936421750d1da0fde3d55d7d4fabc5
am: 1cd027befe
* commit '1cd027befe8206fe4c33b1efff2bebb0584c138c':
Make some of the UID-based VPN code reusable
Change-Id: I75d9871f8039d14f8d83be4696c3c4d4e864f9c0
am: a7cc7c5b4e
* commit 'a7cc7c5b4edb125961bf5c219ecf57bce7876db5':
Make some of the UID-based VPN code reusable
Change-Id: Ie7c88ba3eebe4af85a69f330cae3df3293113d4e
am: b0f3016b64
* commit 'b0f3016b64552674681dbc742667203d36c4c86d':
Make some of the UID-based VPN code reusable
Change-Id: I3f1b1a08059aa58cb76db6cdd070b103024b9bf3
When an UID is added / removed to the Data Saver blacklist, it's
necessary to notify internal components such as the Settings UI (which
was erroneously listening to UID rules changes instead).
BUG: 28743623
BUG: 28791717
Change-Id: I11c85e141dfe074ad390fd324309d2412bfbbd45
am: 3d079f210c
* commit '3d079f210cce78d6d87220b289a68de97ae263b4':
Fixed connectivity state in some power saving scenarios.
Change-Id: Idd27e581b208a0d80d8fa6a4d7cf75eac82a32fd
am: cc02a95cbd
* commit 'cc02a95cbd694927cd70d7b0d7921d3f10300b38':
Fixed connectivity state in some power saving scenarios.
Change-Id: I9ce60e8520c041e1345960a51394f8477c4ac49e
am: 942ee1159f
* commit '942ee1159f45c13029c28dc7846d6773571f6cda':
Fixed connectivity state in some power saving scenarios.
Change-Id: I7ebe3864657d2147034ffae400312e94deb5ef35