Make NetworkStats be iterable and expose iterator as system API
which is better than expose size() and getValues().
This API could be used by the caller who needs to get entry
from NetworkStats.
Bug: 210073043
CTS-Coverage-Bug: 215061403
Test: build, TH
Change-Id: I6cb4c8f63d7067133f2722b2be7e16b4098a697d
Ethernet service related files are going to be moved into Connectivity
module. Replace the Preconditions class in the EthernetNetworkSpecifier,
either add modules-utils-preconditions static lib dependency to fix it,
however, notice that will result in the duplicate class import when
moving ethernet stuff to p/m/Connectivity.
Bug: 210586283
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I6163699be4126ef1b95dfb87ec9a6aba2c01195a
Ethernet service related files are going to be moved into Connectivity
module. Replace the Preconditions class in the EthernetNetworkSpecifier,
either add modules-utils-preconditions static lib dependency to fix it,
however, notice that will result in the duplicate class import when
moving ethernet stuff to p/m/Connectivity.
Bug: 210586283
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I6163699be4126ef1b95dfb87ec9a6aba2c01195a
Since TrafficStats is moving into the mainline module,
ServiceManager#getService can no longer be accessed.
This change use reflection to access getService, since
there is no offical way to get the service binder,
and TrafficStats is a static utility that doesn't have
the context to invoke Context#getSystemService.
This change also fixes minor lint errors.
Test: atest CtsNetTestCases:TrafficStatsTest
Bug: 204830222
Change-Id: I5caec42a71431b39f747fc791b8511d92e5cf7cc
Since TrafficStats is moving into the mainline module,
ServiceManager#getService can no longer be accessed.
This change use reflection to access getService, since
there is no offical way to get the service binder,
and TrafficStats is a static utility that doesn't have
the context to invoke Context#getSystemService.
This change also fixes minor lint errors.
Test: atest CtsNetTestCases:TrafficStatsTest
Bug: 204830222
Change-Id: I5caec42a71431b39f747fc791b8511d92e5cf7cc
NetworkStats is going to be moved into mainline module and
there're some external callers have dependencies on it.
To replace those hidden APIs with formal APIs, NetworkStats
needs to expose some getter methods to eliminate the dependencies
on hidden API.
Bug: 210073043
Bug: 204830222
CTS-Coverage-Bug: 214881138
Test: FrameworksNetTests
Change-Id: I85bb6b27bd17bad16c9693d95b569d0ec5fbb785
NetworkStats is going to be moved into mainline module and
there're some external callers have dependencies on it.
To replace those hidden APIs with formal APIs, NetworkStats
needs to expose some getter methods to eliminate the dependencies
on hidden API.
Bug: 210073043
Bug: 204830222
CTS-Coverage-Bug: 214881138
Test: FrameworksNetTests
Change-Id: I85bb6b27bd17bad16c9693d95b569d0ec5fbb785
This is done by:
1. Add NetworkStatsManagerInternal APIs directly from
NetworkStatsManager, these APIs are needed by NPMS.
2. Replace all usages with these APIs.
3. Delete NetworkStatsManagerInternal implementation.
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 204830222
CTS-Coverage-Bug: 213124616
Change-Id: If51b6676915e3a0a8a9f95221d735306911442fc
This is done by:
1. Add NetworkStatsManagerInternal APIs directly from
NetworkStatsManager, these APIs are needed by NPMS.
2. Replace all usages with these APIs.
3. Delete NetworkStatsManagerInternal implementation.
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 204830222
CTS-Coverage-Bug: 213124616
Change-Id: If51b6676915e3a0a8a9f95221d735306911442fc
1. getNetworkTotalBytes was used for querying overall statistics
that regards of the NetworkPolicy to calculate the remaining
data warning/limit quota that needs to be send to the lower layer.
2. getNetworkUidBytes was used for querying overall statistics of
apps to find out the rapid traffic that caused by an abnormal
app behavior.
This change replaces getNetwork[Total|Uid]Bytes with APIs that are
about to expose, and introduces a dependencies object for better
unit test injection.
Test: atest NetworkPolicyManagerServiceTest
Bug: 204830222
Change-Id: I802d2316fb22886e951456df0941c09176c981f8
1. getNetworkTotalBytes was used for querying overall statistics
that regards of the NetworkPolicy to calculate the remaining
data warning/limit quota that needs to be send to the lower layer.
2. getNetworkUidBytes was used for querying overall statistics of
apps to find out the rapid traffic that caused by an abnormal
app behavior.
This change replaces getNetwork[Total|Uid]Bytes with APIs that are
about to expose, and introduces a dependencies object for better
unit test injection.
Test: atest NetworkPolicyManagerServiceTest
Bug: 204830222
Change-Id: I802d2316fb22886e951456df0941c09176c981f8
This reverts commit 1b4f0a409d.
Reason for revert: FastDataInput/Output is hidden and cannot be used in mainline module.
Test: TH
Bug: 204830222
Change-Id: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
This reverts commit daa23607be.
Reason for revert: FastDataInput/Output is hidden and cannot be used in mainline module.
Test: TH
Bug: 204830222
Change-Id: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
IpSec is going to be moved into Connectivity module and it needs to
use PolicyDirection annotation. Add PolicyDirection IntDef annotation
so that it can be used in the module.
Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ib411d8c436d67574bfaf7f3aba43e5f31e7487e2
IpSec is going to be moved into Connectivity module and it needs to
use PolicyDirection annotation. Add PolicyDirection IntDef annotation
so that it can be used in the module.
Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ib411d8c436d67574bfaf7f3aba43e5f31e7487e2
Query tagged UID summary is currently needed by
StatsPullAtomService to collect tagged traffic statistics.
Add an Api via NetworkStatsManager to support this
functionality.
Test: atest NetworkStatsManagerTest
Bug: 204830222
Change-Id: Iaa54482a8109b56e66e829c5bec5a8a8f466641a
Query tagged UID summary is currently needed by
StatsPullAtomService to collect tagged traffic statistics.
Add an Api via NetworkStatsManager to support this
functionality.
Test: atest NetworkStatsManagerTest
Bug: 204830222
Change-Id: Iaa54482a8109b56e66e829c5bec5a8a8f466641a
In current equals method, if iface is null then it will cause
null object reference when checking iface.
Thus, use TextUtils.equals to check iface so that it can compare
null iface.
Bug: 210073043
Test: FrameworksNetTests, NetworkStaticLibTests
Change-Id: I2bd8127cb030ea54438382ee89961590fffbc31a
In current equals method, if iface is null then it will cause
null object reference when checking iface.
Thus, use TextUtils.equals to check iface so that it can compare
null iface.
Bug: 210073043
Test: FrameworksNetTests, NetworkStaticLibTests
Change-Id: I2bd8127cb030ea54438382ee89961590fffbc31a