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
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
CTS-Coverage-Bug: 213437796
(cherry-picked from ag/16548638)
Change-Id: I584897ff8ba303c717a9df3756c9f6778c1cfb10
Merged-In: I584897ff8ba303c717a9df3756c9f6778c1cfb10
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
CTS-Coverage-Bug: 213437796
(cherry-picked from ag/16548638)
Change-Id: I584897ff8ba303c717a9df3756c9f6778c1cfb10
Merged-In: I584897ff8ba303c717a9df3756c9f6778c1cfb10
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
CTS-Coverage-Bug: 213437796
Change-Id: I584897ff8ba303c717a9df3756c9f6778c1cfb10
This change also remove getWifiNetworkKey which should not be exposed
as system API.
Test: atest NetworkTemplateTest
Bug: 204830222
Change-Id: I924f62025a8672167f778ff790cd208c74eed878
This change also remove getWifiNetworkKey which should not be exposed
as system API.
Test: atest NetworkTemplateTest
Bug: 204830222
Change-Id: I924f62025a8672167f778ff790cd208c74eed878
Use public resource since IpSec is planed to be moved into
Connectivity mainline module.
Bug: 204153604
Test: build
Change-Id: I0aafef6b9b08307c3aebce597a2dd24925c6b09a
1. Used SSID to be a wifi network identity can't separate wifi
data usage when there are two different network with same SSID.
Use a new usage key from WifiInfo to replace wifi SSID to solve
this issue.
2. To support to query wifi usage per configured Wifi network.
Adding matchWifiNetworkKeys in NetworkTemplate to support querying
multi networkKeys wifi data usage since each configured Wifi
network configuration might be used to connect different Wifi
network. (Replace mNetworkId with mMatchWifiNetworkKeys)
3. Updated callers who were using NetworkTemplate constructor.
4. Fixed SortedSet null order case. The null subscriberId is a
valid input for matchSubscriberIds.
5. Replaced ArrayUtils with CollectionUtils.
Bug: 197520752
Bug: 126299427
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c NetworkPolicyTest
Change-Id: Ie20e7fb56597817901be4ce1d2a7afcbc9ded0c6
1. Used SSID to be a wifi network identity can't separate wifi
data usage when there are two different network with same SSID.
Use a new usage key from WifiInfo to replace wifi SSID to solve
this issue.
2. To support to query wifi usage per configured Wifi network.
Adding matchWifiNetworkKeys in NetworkTemplate to support querying
multi networkKeys wifi data usage since each configured Wifi
network configuration might be used to connect different Wifi
network. (Replace mNetworkId with mMatchWifiNetworkKeys)
3. Updated callers who were using NetworkTemplate constructor.
4. Fixed SortedSet null order case. The null subscriberId is a
valid input for matchSubscriberIds.
5. Replaced ArrayUtils with CollectionUtils.
Bug: 197520752
Bug: 126299427
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c NetworkPolicyTest
Change-Id: Ie20e7fb56597817901be4ce1d2a7afcbc9ded0c6