=====
Remove the need of accessing handler in NSS unit test
Currently, to wait for handler becomes idle, specific message
is used and the test would wait for condition variable to be
open when the message is processed.
However, this is already done in the HandlerUtils. Thus,
there is no need to post such message manually in the handler.
Test: atest FrameworksNetTests
Bug: 150664039
Change-Id: Iab32b2dbab01634ca159dcb90fc9f929d1fed1a2
=====
Remove setHandler in NetworkStatsService
Currently, internal handler is set by setHandler after
constructing NSS object. This was introduced in ag/866187 to
access the handler in the unit test.
However, the design put NSS in a bad situation where all classes
that need handler or executor could not be final and need to be
dynamically allocated in order to get a valid handler.
Thus, since the usage of handler is removed in previous patch,
this change eliminate setHandler by initializing the handler in
the constructor.
Test: atest FrameworksNetTests
Bug: 150664039
Change-Id: I794a24d00b0ca9fdc78091e7b9ab7307e0f034b7
=====
Bug: 150664039
Change-Id: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
Merged-In: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
(cherry picked from commit 2a6439d7e2a3926e10a0b9a4dc730b1a022d8138)
From current design, the traffic accounted by stats providers
will be updated asynchronously when force polling. When upper
layer make two subsequently queries. They will get stale
stats upon the first query, and may get newest/stale stats
base on the result of race.
Thus, wait for a bit of time to allow asynchronous stats update
complete to reduce the chance of race. In pratice, it would
be finished in ~2ms when testing.
Test: systrace.py network
Test: atest FrameworksNetTests
Bug: 147460444
Change-Id: I22a00fc4049cddf77fd578e25769ae1979f2cc6d
Currently NetworkStatsService holding a lock when invoking
getVtDataUsage, which causes a lot of deadlock problems since
Phone will also have binder calls to system_server.
Thus, this change uses a new set of API to break such situation,
that allows VT to report stats asynchronously.
Test: atest FrameworksNetTests FrameworksTelephonyTests
Bug: 130855321
Fix: 143923500
Change-Id: Ifdb8599c3bade09208b4730710fc99da1afad71d
am skip reason: Change-Id Iaa6f0d65cab556c24b0a9010427de8e6a02836c1 with SHA-1 7092cf164f is in history
Change-Id: I306a831e47c08ac37de93285763500b73a4624ec
am skip reason: Change-Id I34842acd94b972e440c3622f7617df10c18acf65 with SHA-1 c5c664b88d is in history
Change-Id: I7068557f0d30c9066e9bdcb2dd674dab8964a4b9
am skip reason: Change-Id Id96d581acb3fa4e52ca62dd94ec257f56bd3a1ce with SHA-1 1d48d5e90d is in history
Change-Id: I3314b899730f367f154bd8b513094076084a6cef
Ethernet tethering can be started via
startTethering(TETHERING_ETHERNET).
Test: flashed, enabled ethernet tethering, verified internet access on
downstream.
Bug: 130840861
Merged-In: I34842acd94b972e440c3622f7617df10c18acf65
Change-Id: I34842acd94b972e440c3622f7617df10c18acf65
(cherry-pick with conflicts in test-current.txt)
requestTetheredInterface can be used to put an interface in server mode,
which will persist until release() is called on the returned request, or
until the requesting process dies.
Test: Enabled ethernet tethering with change on top
Bug: 130840861
Merged-In: Id96d581acb3fa4e52ca62dd94ec257f56bd3a1ce
Change-Id: Id96d581acb3fa4e52ca62dd94ec257f56bd3a1ce
(clean cherry-pick from internal branch)
Just because the bucket is active (ie. overlaps with 'now') doesn't
mean the request necessarily covers the entire bucket.
For example a bucketDuration=5 with a bucket from curStart=1 to
curEnd=6 with now=4 and requests:
- from start=0 to end=3 --> overlap=[1,3] --> bucketSpan=2
- from start=2 to end=3 --> overlap=[2,3] --> bucketSpan=1
- from start=2 to end=5 --> overlap=[2,4] --> bucketSpan=2
- from start=2 to end=7 --> overlap=[2,4] --> bucketSpan=2
and the previously correctly handled cases:
- from start=0 to end=5 --> overlap=[1,4] --> bucketSpan=3
- from start=0 to end=7 --> overlap=[1,4] --> bucketSpan=3
We fix this by bounding the end of buckets to now, this means
that bucketDuration is no longer a constant, but it simplifies
all the rest of the logic.
Test: builds, atest
Bug: 143338233
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I642b57f7b8486071ad7808fd9b901859923b6d25