summaryrefslogtreecommitdiff
path: root/tests/unit/java/android/net/NetworkTemplateTest.kt
Commit message (Collapse)AuthorAgeFilesLines
* Add NetworkTemplateTest to common test for cts coverageAaron Huang2022-02-091-143/+0
| | | | | | | | | Test for NetworkTemplate.Builder Ignore-AOSP-First: Required API is not in downstream yet Bug: 215435701 Test: CtsNetTestCases Change-Id: I3a55bc74388fa34a142abec308b67b185641c460
* Change NETWORK_TYPE_5G_NSA reference packageAaron Huang2022-01-261-1/+1
| | | | | | | | NETWORK_TYPE_5G_NSA is moved to NetworkStatsManager Bug: 210073043 Test: builds, FrameworksNetTests Change-Id: I9226119ee4f67688a1b4ffdab7e5a86ec0b8e974
* wifi data usage: Update calling API nameLes Lee2022-01-231-1/+1
| | | | | | | | | | Bug: 213387087 Test: atest -c NetworkTemplateTest Test: atest -c NetworkStatsServiceTest Test: atest -c FrameworksWifiApiTests Test: atest -c NetworkPolicyManagerServiceTest Change-Id: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be Merged-In: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be
* Merge "Update the SDK for the tests with intended target in T+"Chiachang Wang2022-01-211-2/+3
|\
| * Update the SDK for the tests with intended target in T+Chiachang Wang2022-01-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct the SDK for those tests are expected running in T+ device. Check @IgnoreUpTo(S) may be incorrect after receiving patches before T release. Refer to temporary constant definition in DevSdkIgnoreRule until the SDK constant being pushed into AOSP and synced with branch used for mainline. BUg: 215294242 Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk Change-Id: Ide6a241f7944dd1e75bc33b21aa29471a5df94c6
* | [MS57.2] Prepare APIs for data migration utilityJunyu Lai2022-01-201-3/+2
|/ | | | | | Test: atest NetworkStatsHistoryTest#testBuilder Bug: 204830222 Change-Id: I938c3ed50eea0f2349ea92c3824c637eaa77d328
* wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network keyLes Lee2022-01-031-120/+168
| | | | | | | | | | | | | | | | | | | | | | | | 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 in 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. a. Replaced wording SSID with key of the wifi network b. Add mock to handle get wifi network key from WifiInfo c. Add null/empty set unit test to verify matchWifiNetworkKeys Bug: 197520752 Bug: 126299427 Test: atest -c NetworkTemplateTest Test: atest -c NetworkStatsServiceTest Test: atest -c NetworkPolicyManagerServiceTest Change-Id: Id7d66f6548dd1b4e657db8d7427213293618b406
* [MS15.2] Move SUBSCRIBER_ID_MATCH_RULE_* constants to static libJunyu Lai2021-12-221-2/+2
| | | | | | | | | | | | Subscriber Id Match Rules won't be exposed as system Api. Any caller who references NetworkTemplate#SUBSCRIBER_ID_MATCH_RULE_* should use the one in NetworkStatsUtils instead. And remove the need of the constants as soon as possible. Test: atest NetworkPolicyManagerServiceTest \ FrameworksNetTests Bug: 204830222 Change-Id: I363a4440f85f1ca818eaf1125e45b141dd6f0e55
* [MS12.2] Add unit test for NetworkTemplate builderJunyu Lai2021-12-211-2/+109
| | | | | | Test: atest NetworkTemplateTest Bug: 204830222 Change-Id: Ie83cd4322418449980bece7e13d68f2cacbaf1ef
* Add test case to test normalizeLes Lee2021-11-051-0/+43
| | | | | | Bug: 194939211 Test: atest -c NetworkTemplateTest Change-Id: I2f5790b9217357ddcf3f466cec1b2b1afbb47210
* Update callers to use buildTemplateMobileWithRatType with meteredAaron Huang2021-10-251-37/+112
| | | | | | | | | | | The method buildTemplateMobileWithRatType is updated to take metered as a parameter so the callers should be updated to the new version. Bug: 183776809 Test: atest FrameworksNetTest Change-Id: I859514b93705f9ee4f9ae4b0bcddcb61005a78ff Merged-In: I859514b93705f9ee4f9ae4b0bcddcb61005a78ff
* Test a template matches mobile and mobile wildcardAaron Huang2021-09-141-0/+53
| | | | | | | | Add two test cases for matchesMobile and matchesMobileWildcard Bug: 183776809 Test: FrameworksNetTests:NetworkTemplateTest Change-Id: I14d31071655204fe6ad36c71f7f521640e01c96e
* Re-skip connectivity unit tests before SRemi NGUYEN VAN2021-06-301-6/+9
| | | | | | | | | | | | | | | | | | The tests are packaged together with other tests in a common coverage suite, so need to be individually annotated so that they are skipped before S. They do not need to pass on platforms older than S, because such platforms will not updated with the code that is tested. This applies a previous change, this time using DevSdkIgnoreRunner, as SdkSuppress does not work as expected in branches that have a codename 2 versions above the SDK version, as is the case in AOSP. Bug: 187935317 Test: atest ConnectivityCoverageTests on R atest FrameworksNetTests on S Change-Id: I5808d34459a4c19238baf8873afa7cf942828460
* Revert "Skip connectivity unit tests before S"Remi NGUYEN VAN2021-06-291-3/+0
| | | | | | | | | This reverts commit 05dd1ba54005b15d92daf6f26329acf91fb3debb. Reason for revert: Skips more tests than it should in AOSP Bug: 192302892 Change-Id: I7c5638d8c1cc626354d240a06af758e1cdd92e94
* Skip connectivity unit tests before SRemi NGUYEN VAN2021-06-251-0/+3
| | | | | | | | | | | | | The tests are packaged together with other tests in a common coverage suite, so need to be individually annotated so that they are skipped before S. They do not need to pass on platforms older than S, because such platforms will not updated with the code that is tested. Bug: 187935317 Test: atest ConnectivityCoverageTests on R Change-Id: I10da45ae023e7f1e8cd11ec857b84346892a3fa8
* Add metered filter for API: buildTemplateCarrierlesl2021-05-141-22/+36
| | | | | | | | | | | | | | | | | | | | | | This CL modifies NetworkTemplate#buildTemplateCarrier to force on metered carrier network and rename to buildTemplateCarrierMetered. This method was introduced recently and has no callers. This method will be used in Settings and NetworkPolicyManagerService to display and manage data usage on carrier metered networks. Settings/NetworkPolicyManagerService will use it instead of the existing method buildTemplateMobileAll method, which only matches metered networks. That code will change from matching metered mobile networks to matching metered carrier networks. Note: The carrier metered network includes metered mobile network and metered "merged carrier wifi network" that is a specific cerrier wifi network which provides the same user experience as mobile. Bug: 176396812 Test: atest -c NetworkTemplateTest Change-Id: I7196d62bb60844458a6c4b1d94e2baccb71e15cd
* Move net unit tests to packages/ConnectivityRemi NGUYEN VAN2021-05-131-0/+351
Move the tests together with packages/Connectivity code, so both can be moved to packages/modules/Connectivity together. Also reorganize unit tests in a unit/ directory, as other tests (integration/, common/ etc.) have been added in tests/net since they were created. This makes the directory structure consistent. Test: atest FrameworksNetTests Bug: 187814163 Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc