The purpose is provide NetworkStatsCollection.Builder as
public API for adding the stats {@link NetworkStatsHistory}
Bug: 215862801
Test: atest NetworkStatsCollectionTest
Change-Id: I65ad589473cbb7785cbe8297f793ce9f18a55c35
Supplemental apps has limited capabilities and service discovery
is restricted. Hence, calling TrafficStats.init would result in
crash.
This change includes:
1. Print log instead of crashing process when running into
any unexpected cases.
Test: atest SupplementalProcessManagerTests
Bug: 216062904
Change-Id: I7f827ccc485c997745779053b5936a6cb30e8219
Use usage callback to replace the need of intent receiver.
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests
Bug: 204830222
Change-Id: I40967c2b6c86d25c7db93e6d3a4908b72ed76154
Use public resource since IpSec is planed to be moved into
Connectivity mainline module.
Bug: 204153604
Test: build
Change-Id: I0aafef6b9b08307c3aebce597a2dd24925c6b09a
Merged-In: I0aafef6b9b08307c3aebce597a2dd24925c6b09a
This includes:
1. NetworkIdentity
2. NetworkIdentitySet
3. NetworkStatsHistory
NetworkStatsCollection Apis will be exposed in a separate CL.
Test: TH
Bug: 204830222
Change-Id: I47b2d3ac3b86cb4e6879afaae34326ca3c050ffa
ethernet-service is going to be moved into Connectivity mainline module.
Notice that below sources are also only used in the ethernet framework
during compiling the filegroup: framework-connectivity-ethernet-sources.
Move them from f/b to f/b/packages/ConnectivityT as well.
Ethernet framework only related files:
- IInternalNetworkManagementListener.aidl
- InternalNetworkManagementException.java
- InternalNetworkManagementException.aidl
- InternalNetworkUpdateRequest.java
- InternalNetworkUpdateRequest.aidl
Ethernet service only related files:
- DelayedDiskWrite.java(IpConfigStore imports this class)
Bug: 210586283
Test: build pass
atest FrameworksNetTests
atest EthernetServiceTests
Change-Id: I1ec2d1d182c04f3f2acc9b757d5061ca749a4a3c
NetworkStatsHistory will need to be exposed and constructed
from the data migration tool in the follow-up changes.
Add a Builder class to prevent from exposing internal array
structures.
Test: atest NetworkStatsHistoryTest#testBuilder
Bug: 204830222
Change-Id: I5f8ea1c825d601de0aac8623034ef896999fc1a0
Expose TrafficStats#attachSocketTagger and use it instead.
Test: atest TrafficStatsTest
Bug: 204830222
CTS-Coverage-Bug: 214979748
Change-Id: I1748d349b499053ad08bd62202325fa759ad8da5
TrafficStats has static methods created in API level 8 that need
access to NetworkStatsManager but doesn't take a context.
Previously this was achieved by using ServiceManager, but
with TrafficStats moving to the connectivity module, this
is no longer possible.
Instead, make sure TrafficStats has an appropriate context by
the time any client code can call the relevant methods.
• In app code, this achieved by passing the application
context from ActivityThread#handleBindApplication, before any
app code can run.
• In the system server, this is achieved by passing the context
right after creating service.
Test: atest TrafficStatsTest CtsWebkitTestCases
Bug: 204830222
Change-Id: I251bb8a4431ad12ff61929879ef1363cf06b9244
Have BpfInterfaceMapUpdater to update bpf interface map: adding
the interface and index mapping to bpf interface map when interface
added.
Bug: 215095957
Test: atest FrameworkNetTests
Change-Id: I2189a50c4869cfc0c33fc6f0228f40ee9f3ac1d4
INetd#trafficSwapActiveStatsMap is deprecated and the implementaion is
moved into tethering (connectivity) mainline module. A new
ConnectivityManager API swapActiveStatsMap is temprary exposed for
NetworkStatsFactory. Once NetworkStatsFactory move into tethering
module, swapActiveStatsMap API would be removed and NetworkStatsFactory
should could call the implemeneted inside the module directly. This
should happen before T sdk finalization.
Bug: 209935649
Test: atest NetworkStatsFactoryTest
Change-Id: I6685fe513511e7af9fa6521601891c66d1297da0
Expose systemapi NetworkStats.getDetailedUidStats for use by
BatteryStats.
BatteryStatsImpl is using INetworkStatsService APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.
Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
MobileRadioPowerCalculatorTest NetworkStatsServiceTest
CTS-Coverage-Bug: 213437796
Change-Id: I40d713923278f4654d67bb4d12155cea85c10447
This includes:
1. Move PREFIX_* constants to NetworkStatsManager to expose
in later changes.
2. Rename networkId to wifiNetworkKey.
3. Rename subType to ratType.
4. Replace SUBTYPE_COMBINED with NETWORK_TYPE_ALL
5. Fix lint errors when exposing system api.
Test: TH
Bug: 204830222
Change-Id: I2b7c34958bc59c3225c96f12abba008b83101585
This includes:
1. queryDetailsForDevice: get history of network stats that
matches the given template.
2. querySummaryForDevice: similar to the above one, but the
result is aggregated over time.
3. queryDetailsForUidTagState: get history of uid stats that
matches the given template, uid, tag and other conditions.
4. querySummary: similar to the above one, but the
result is aggregated over time.
5. queryTaggedSummary: similar to the above one, but only
return tagged data.
Test: TH
Bug: 204830222
Change-Id: Ic18010822a33e340b954e9c53dc515f3b6224d6d
This CL includes:
1. Prepare for queryDetailsForDevice which allows callers
to query history of networks that matches the given template.
2. Prepare for queryDetailsForUidTagState, which allows
callers to query history uid stats with the given template,
uid and other conditions.
3. Enforce fine location permission if the caller is querying
data usage with a template which contains wifi network keys.
Test: atest NetworkStatsServiceTest NetworkStatsManagerTest
Bug: 204830222
Bug: 200768422
Change-Id: I6783d6bfd6e075e0b3ec8a3c91836377f1d71c7a
Replace android.provider.Settings.Global methods that return the default
value and hardcoding them inside the methods.
Bug: 213329727
Test: atest NetworkStatsServiceTest
Change-Id: I51d686222f983c8deb71d4b32f9e443e87a5e53e
netstats.proto is about to move into mainline module.
And it can no longer see privacy.proto definition.
Thus, this change remove PII data that is not very useful
when debugging and any reference to privacy.proto.
Test: adb bugreport and check output at transponder
Bug: 204830222
Change-Id: I755530f356d2c16b336d62785c4c17c557f792db
- Split out nsd APIs and hidden APIs to Connectivity module.
- Keep the all files in f/b/packages/Connectivity-T and add
framework-connectivity-tiramisu library on p/m/Connectivity.
Then make framework to use this module library.
- Remove NsdService from SystemServer which will register from
ConnectivityServiceInitializer
Bug: 206893064
Test: m online-sdk-dev-docs
Test: atest FrameworksNetTests CtsNetTestCases
CTS-Coverage-Bug: 207804007
Merged-In: I72c7de124b9cc53f2263bd452ecd5f39e88e485b
Change-Id: I72c7de124b9cc53f2263bd452ecd5f39e88e485b
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
Expose system APIs for use by NetworkStatsService.
Bug: 211843446
Test: atest NetworkStatsServiceTest NetworkPolicyManagerTest
NetworkPolicyManagerServiceTest
Change-Id: I56a066b7f4b4c2c8fefdd185c2e50de63b1e2629
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