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
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
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
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
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
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
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. 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 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
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
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
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
This reverts commit 7fe4f60b74.
Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).
Original commit message:
Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()
This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).
A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.
Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
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