Currently, mMobileIfaces is accessed from multiple threads, and
should be protected from concurrent accessing. However, since the
variable could be accessed frequently, holding the mStatsLock
would make this be blocked by network stats I/O operations.
Thus, protect the variable by making it volatile.
Test: Wifi on/off stress test
Bug: 192758557
Change-Id: Ie7694a63f5203ee7c83830ca13d97219b7949fd7
Roll back the behavior changes by checking the target SDK to ensure that
there are no compatibility issues with the pre-S application.
If the target SDK of the application <S, NsdManager will actively send a
cmd to start the native daemon, and NsdService will keep the daemon
until the last client with the target SDK <S disconnects.
Test: atest NsdManagerTest NsdServiceTest
Bug: 191844585
Change-Id: Ie93d5d585e126fe220ae865bbc7274f21a925984
Roll back the behavior changes by checking the target SDK to ensure that
there are no compatibility issues with the pre-S application.
If the target SDK of the application <S, NsdManager will actively send a
cmd to start the native daemon, and NsdService will keep the daemon
until the last client with the target SDK <S disconnects.
Test: atest NsdManagerTest NsdServiceTest
Bug: 191844585
Change-Id: Ie93d5d585e126fe220ae865bbc7274f21a925984
As API review feedback, rename Build#VERSION#FIRST_SDK_INT to
Build#VERSION#DEVICE_INITIAL_SDK_INT. As well as update all usage
in frameworks and tests.
Bug: 184735771
Test: m
Merged-In: I72660959cb4e638a8e80fcf2f4e96ea172969f44
(cherry-pick with minor conflicts)
Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44
This change ensures that app data accounting works correctly within the
confines of in-kernel dataplanes, as used by platform VPNs and the VCN.
Notably, the VCN MUST NOT specify the IMSI, as that would lead to double
counting of the interface statistics.
Bug: 175853498
Bug: 190620024
Test: atest NetworkStatsTest FrameworksVcnTests
Original-Change: https://android-review.googlesource.com/1749070
Merged-In: I768907cd3dd2028c7040cddd81fc71a5ce69bbdb
Change-Id: I768907cd3dd2028c7040cddd81fc71a5ce69bbdb
This change ensures that app data accounting works correctly within the
confines of in-kernel dataplanes, as used by platform VPNs and the VCN.
Notably, the VCN MUST NOT specify the IMSI, as that would lead to double
counting of the interface statistics.
Bug: 175853498
Bug: 190620024
Test: atest NetworkStatsTest FrameworksVcnTests
Change-Id: I768907cd3dd2028c7040cddd81fc71a5ce69bbdb
Starting with API level 31, the subscriberId is applicable
for the wifi network. Considering applications may use
null or an empty string as subscriberId (for instance, cts),
frameworks create MATCH_WIFI_WILDCARD NetworkTemplate when querying
wifi network with null or an empty string which is the behavior before
API level 31.
Bug: 188915450
Test: atest -c NetworkStatsManagerTest
Test: atest -c NetworkUsageStatsTest
Merged-In: I084b69903f8ba7a6225b312560752e8508938714
Change-Id: I084b69903f8ba7a6225b312560752e8508938714
Currently, NsdService starts the native mdnsresponder daemon if any
NsdManager connect to it, which results in that when any constant
service holds the NsdManager connection, the device would always be
in the mdns multicast group whatever the connection is not used or not.
This is because mdnsresponder will join the multicast group when it
starts.
To solve this problem, start the native daemon only when needed, and
clean it up after the given idle timeout.
1. Start the native daemon when a new request come.
2. If there is no pending request, clean up the daemon after 3 seconds
of idle time.
Bug: 181810560
Test: atest NsdManagerTest NsdServiceTest
Original-Change: https://android-review.googlesource.com/1717479
Merged-In: I3eb04552f6cf6c0c68c07abffe751bb4d0669215
Change-Id: I3eb04552f6cf6c0c68c07abffe751bb4d0669215
Starting with API level 31, the subscriberId is applicable
for the wifi network. Considering applications may use
null or an empty string as subscriberId (for instance, cts),
frameworks create MATCH_WIFI_WILDCARD NetworkTemplate when querying
wifi network with null or an empty string which is the behavior before
API level 31.
Bug: 188915450
Test: atest -c NetworkStatsManagerTest
Change-Id: I084b69903f8ba7a6225b312560752e8508938714
1. Increase the cleanup delay from 3s to 10s.
2. Fix the comments from aosp/1717479.
Bug: 181810560
Test: atest NsdManagerTest NsdServiceTest
Change-Id: I71ebdd011574bd96de16a4248b0e15636418e87c
Currently, NsdService starts the native mdnsresponder daemon if any
NsdManager connect to it, which results in that when any constant
service holds the NsdManager connection, the device would always be
in the mdns multicast group whatever the connection is not used or not.
This is because mdnsresponder will join the multicast group when it
starts.
To solve this problem, start the native daemon only when needed, and
clean it up after the given idle timeout.
1. Start the native daemon when a new request come.
2. If there is no pending request, clean up the daemon after 3 seconds
of idle time.
Bug: 181810560
Test: atest NsdManagerTest NsdServiceTest
Change-Id: I3eb04552f6cf6c0c68c07abffe751bb4d0669215
The carrier network means any network which linked with sepcific
subscriberId (for instances: merged Wifi or mobile).
Update default policy to use carrier network template to replace mobile
template.
No impact for current AOSP user because no any wifi network is merged
wifi. (Because the merged wifi network requires to support from the wifi module).
Also this change convert all of the old policies which template is
TYEP_MOBILE to TYPE_CARRIER to match the default policy.
Bug: 176396812
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c CtsHostsideNetworkTests
Test: Manual Test with test code (Force wifi to merged wifi).
The data will limit when using merged wifi.
And mobile policy also work normally.
Merged-In: I33c10f7549e713c52ce9afd5b8c4cce2abbda616
Change-Id: I33c10f7549e713c52ce9afd5b8c4cce2abbda616
Avoid recording negative data by doing integer-based
math as much as possible, but switch to double-based
math if we detect that we'd end up causing an overflow.
Test :
- Builds, Boots
- High data throughput scenarios
- NetworkStatsHistoryTest, NetworkStatsCollectionTest,
NetworkStatsTest
Bug: 119527458
Change-Id: I355fc9bd127da83c1dc70ab3b1261346d4fa5de0
Clarify the consequence of adding IpSecTunnelInterface to the
underlying network.
Bug: 169855650
Test: builds
Change-Id: I2e3c4fe735b3374b2ff6d23850970e36c0aafda5
Merged-In: I2e3c4fe735b3374b2ff6d23850970e36c0aafda5
The carrier network means any network which linked with sepcific
subscriberId (for instances: merged Wifi or mobile).
Update default policy to use carrier network template to replace mobile
template.
No impact for current AOSP user because no any wifi network is merged
wifi. (Because the merged wifi network requires to support from the wifi module).
Also this change convert all of the old policies which template is
TYEP_MOBILE to TYPE_CARRIER to match the default policy.
Bug: 176396812
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c CtsHostsideNetworkTests
Test: Manual Test with test code (Force wifi to merged wifi).
The data will limit when using merged wifi.
And mobile policy also work normally.
Change-Id: I33c10f7549e713c52ce9afd5b8c4cce2abbda616