summaryrefslogtreecommitdiff
path: root/tests/net/java
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge "Refactoring and mocking to make sure unit test doesn't call the real ↵Nazanin Bakhshi2021-04-201-7/+23
|\| | | | | | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | service" am: 68bf2c52e5 am: 96b0148cc4 am: bc401f523d Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1668228 Change-Id: I92c9fc5f4dcfc0a7f80db78b885945a1021eab20
| * | | | Refactoring and mocking to make sure unit test doesn't call the real serviceNazanin2021-04-191-7/+23
| |/ / / | | | | | | | | | | | | | | | | | | | | Bug: 180938364 Test: utest Change-Id: Ic6a5a84c1d985fa02f8cf52c8c2ff144669b30c1
| * | / [VCN20] Change requestBackgroundNetwork argument orderjunyulai2021-04-162-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | Test: atest FrameworksNetTests FrameworksVcnTests Fix: 185215095 Merged-In: Id281678fe85ce0894b0e92e11c0283d4d1b4ecdb Change-Id: Id281678fe85ce0894b0e92e11c0283d4d1b4ecdb (cherry-picked from ag/14198667)
* | | Merge "Rename getAllNetworkStateSnapshot which should be pluralized" into sc-devAaron Huang2021-04-191-7/+7
|\ \ \
| * | | Rename getAllNetworkStateSnapshot which should be pluralizedAaron Huang2021-04-171-7/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Address API review feedback, ConnectivityManager#getAllNetworkStateSnapshot should be pluralized so rename the method to getAllNetworkStateSnapshots Bug: 183972554 Test: make, FrameworksNetTests FrameworksServicesTests Change-Id: Ic18d17d05984fa2466c962c7843c0ef7183ce77c
* | | Merge "[VCN19] Rename get/setSubIds to get/setSubscriptionIds" into sc-devJunyu Lai2021-04-161-5/+5
|\ \ \
| * | | [VCN19] Rename get/setSubIds to get/setSubscriptionIdsjunyulai2021-04-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: atest FrameworksNetTests FrameworksVcnTests Fix: 185215036 Ignore-AOSP-First: avoid merge conflict Change-Id: I9d90df5fc13b36d2cdc4920b456dcc87fcd2b3a7
* | | | [NS13] Remove the last usage of the legacy intChalard Jean2021-04-161-21/+8
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that this requires removing part of a test, because that part is testing that the a 50 bonus of the legacy int is stronger than the validation penalty, which is not a mechanic we want to have. When WiFi is unvalidated and cell is unvalidated, cell should be kept in case it validates, like is described in comments in isNetworkPotentialSatisfier ; however this test is checking that it *IS* reaped off if the wifi score is strong enough. This should be incorrect, and should not be tested, so this patch removes the check. Test: ConnectivityServiceTest Bug: 184834350 Change-Id: I8966abee59fea2d9f10f082aba87df6588b72762
* | | Merge "[VCN20] Change requestBackgroundNetwork argument order" into sc-devJunyu Lai2021-04-152-2/+2
|\ \ \
| * | | [VCN20] Change requestBackgroundNetwork argument orderjunyulai2021-04-152-2/+2
| |/ / | | | | | | | | | | | | | | | | | | Test: atest FrameworksNetTests FrameworksVcnTests Fix: 185215095 Ignore-AOSP-First: avoid build break caused by multipatch automerge Change-Id: Id281678fe85ce0894b0e92e11c0283d4d1b4ecdb
* / / Allow network providers to set the linger duration.Chalard Jean2021-04-142-2/+5
|/ / | | | | | | | | | | | | | | Test: atest CtsNetTestCases:NetworkAgentTest#testSetLingerDuration Ignore-AOSP-First: prevent merge conflict CTS-Coverage-Bug: 184796264 Bug: 184227264 Change-Id: I7f420faa40863385114705d6971cf00887d03318
* | Merge "Make getUid a method on UserHandle itself instead of static" am: ↵Chiachang Wang2021-04-131-9/+9
|\| | | | | | | | | | | | | | | bd1cc4f2a2 am: 6b7167e807 am: 155b09614e Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669185 Change-Id: Ic0b7887630c00404ff354c193b82a96930940556
| * Merge "Make getUid a method on UserHandle itself instead of static"Chiachang Wang2021-04-131-9/+9
| |\
| | * Make getUid a method on UserHandle itself instead of staticChiachang Wang2021-04-091-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit addresses the API review feedback that getUid() will be better to make it be a method on UserHandle itself rather than a static method. Update as it is and update the corresponding usages. Fix: 184735865 Test: make update-api Test: atest FrameworksNetTests Test: atest CtsNetTestCasesLatestSdk Change-Id: I33844309224d84764704255d251fadc8940202ca
* | | Merge "Fix nascent timer never get removed" into sc-devJunyu Lai2021-04-131-4/+9
|\ \ \
| * | | Fix nascent timer never get removedjunyulai2021-04-081-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By design, the nascent timer will be removed after a network satisfied first request. However, this never happens. Because the mInactive is false when that happens, so isNascent is never true. Furthermore, when removing a nascent timer, the inactivity state can never be updated since no condition in the updateInactivityState will be met to update the state correctly. Thus, update inactive state accordingly when adding/removing the nascent timer. Test: TH Bug: 184227264 Ignore-AOSP-First: prevent merge conflict Change-Id: I4c1521b6e0ef68ac489771a2ab6b09ef3e381577
* | | | Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" into sc-devPaul Hu2021-04-131-3/+3
|\ \ \ \
| * | | | Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INTpaulhu2021-04-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44
* | | | | Merge changes Ic4500dc8,I32477db5 into sc-devChalard Jean2021-04-121-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: [NS12] Address comments on NS09 [NS11] Fix yieldToBadWifi over the policy scoring
| * | | | | [NS11] Fix yieldToBadWifi over the policy scoringChalard Jean2021-04-121-1/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't reactivate the test because it's not yet fixed over int scoring. Bug: 184834350 Test: Remove @Ignore and run testAvoidBadWifi Change-Id: I32477db52eb50faabc499fa68e24ba07577782aa
* | | | | Merge "Adding log history for setOemNetworkPreference()" am: 7fe91d40f1 am: ↵James Mattis2021-04-091-0/+31
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | b86ffd63db am: c315be9128 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1666340 Change-Id: I123342002b462567174960aa30d1bc4727a8cec7
| * | | | Adding log history for setOemNetworkPreference()James Mattis2021-04-081-0/+31
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding historical logging for the setOemNetworkPreference() calls. This will last across reboots. Bug: 177257940 Bug: 176494815 Test: atest FrameworksNetTests Change-Id: I4fc35fd58ff741830aa292adc1c559b4279ad8f9
* | | | Merge "Add option to make sign-in notification ongoing" into sc-devRemi NGUYEN VAN2021-04-091-5/+41
|\ \ \ \ | |_|/ / |/| | |
| * | | Add option to make sign-in notification ongoingRemi NGUYEN VAN2021-04-081-5/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an overlay boolean that allows setting the SIGN_IN notification as an ongoing notification. This can be useful to make sure users can always easily find the notification to sign in to a captive portal, as studies have found that some users have a tendency to dismiss notifications before reading them. At the same time the notification shade is generally too crowded, which is what causes such behaviors in the first place, so this option is not enabled by default and should generally not be enabled without proper user studies or metrics. Bug: 173171709 Test: atest NetworkNotificationManagerTest Change-Id: Ic187d2a2b7e49ad152ea2aa35bb784864b97473c
* | | | Merge "Assign the bit calculation as long to prevent overflow" am: ↵Chiachang Wang2021-04-071-4/+9
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | 00ccf9e4d7 am: e67182e502 am: d0a92ee2f5 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664307 Change-Id: Ia3a1974227ebfd0069b288203df3551a561556eb
| * | | Merge "Assign the bit calculation as long to prevent overflow"Chiachang Wang2021-04-071-4/+9
| |\ \ \
| | * | | Assign the bit calculation as long to prevent overflowChiachang Wang2021-04-071-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value should be assigned as a long to do the bit calculation as the mNetworkCapabilities is intended to be a long. Otherwise, the value will be temporary assigned into an integer then assigned to the target long. When the bit shift calculation is out of the integer scope, the calculation will overflow and result in unexpected bebavior. Without assigning to a long, ConnectivityServiceTest will get Out-Of-Memory in StringBuilder while generating toString() in NetworkCapabilities after updating tests to verify NET_CAPABILITY_VSIM and NET_CAPABILITY_BIP. Bug: 130869457 Test: atest FrameworksNetTests Change-Id: I4d34c1215c7efb6dc352c314107792e3fa512ad7
* | | | | Merge "ConnectivityManager: Address review comments from aosp/1595396" am: ↵Treehugger Robot2021-04-071-52/+33
|\| | | | | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | e3aff37ecf am: 1d73c8107f am: 7acd4c1c84 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633279 Change-Id: I05777492db3ab9d7b4c6c69131f9404780e4e832
| * | | Merge "ConnectivityManager: Address review comments from aosp/1595396"Treehugger Robot2021-04-071-52/+33
| |\ \ \ | | |/ / | |/| |
| | * | ConnectivityManager: Address review comments from aosp/1595396Roshan Pius2021-04-061-52/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 156867433 Test: atest android.net Test: atest com.android.server Change-Id: I7f5d043732ae22edd14bf581b7dc676c9236b545
| * | | Merge "Add session ID to VpnTransportInfo"Frank Li2021-04-062-16/+31
| |\ \ \
| | * | | Add session ID to VpnTransportInfolifr2021-04-012-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This will be visible only to apps with the NETWORK_SETTINGS permissions (signature), and will be redacted for all other callers. - This string is expected to be the same as set by VpnService#setSession, and in general, VpnConfig.session. But it will be a general API that Vpn.java can call when setting the VpnTransportInfo. - This string cannot be updated once the VPN NetworkAgent is connected. Bug: 171872481 Test: atest ConnectivityServiceTest atest VpnTransportInfoTest atest android.net.cts.NetworkAgentTest Change-Id: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d Merged-In: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d (cherry-picked from ag/14011912)
* | | | | Merge "Adding per-app support for app add/remove" am: d4ea14be1d am: ↵James Mattis2021-04-061-10/+108
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ae60f9f720 am: 39e505fc31 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633904 Change-Id: I72d9981b2a6febc218c30926e58072f43e8bf0a5
| * | | | Adding per-app support for app add/removeJames Mattis2021-04-051-10/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding support for per-app network functionality to react to application installs, removals and updates. Also, opportunistic cleanup of a couple annotations. Bug: 177092163 Bug: 176494815 Test: atest FrameworksNetTests atest NetworkStackTests atest FrameworksNetIntegrationTests atest NetworkStackIntegrationTests atest CtsNetTestCasesLatestSdk Change-Id: I45acbd0d2ef50d575f14a944ce82b185ed69f219
* | | | | Merge "Fix a bug where the wrong profile is queried" am: f83190c218 am: ↵Chalard Jean2021-04-051-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 92d3c13ed8 am: a776c7ca39 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1662362 Change-Id: I5498b7eb2b1b3e4e195ac47d8d3b471496b779b6
| * | | | Merge "Fix a bug where the wrong profile is queried"Chalard Jean2021-04-051-0/+1
| |\ \ \ \
| | * | | | Fix a bug where the wrong profile is queriedChalard Jean2021-04-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UserManager#isManagedProfile() is not aware of the user handle of the context the UM instance is created on. Instead, call isManagedProfile(int). Bug: 183625645 Test: ConnectivityServiceTest Change-Id: I1fef22d67d75df25a8c2d0694f857c3e1c1a1306
* | | | | | Merge "Downgrade list of subIds in NetworkCapabilities to @SystemApi" am: ↵Benedict Wong2021-04-031-0/+65
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c7c4b1323b am: 385ce8ed8a am: 233c7f5840 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652974 Change-Id: I7a85feb9753ae91ff3d67dc82c8bc880a6626074
| * | | | | Downgrade list of subIds in NetworkCapabilities to @SystemApiBenedict Wong2021-04-021-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change downgrades API visibility for the list-of-subIds in the NetworkCapabilities to SystemApi Bug: 175662146 Test: atest NetworkCapabilitiesTest#testSubIds Test: atest FrameworksNetTests Change-Id: I372fa9eaa7585aefd1710948ca007456feedd578
* | | | | | Merge "Fix testLegacyLockdownVpn flaky" am: 7151f51c5a am: e965720924 am: ↵Chalard Jean2021-04-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b139c0e716 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1659998 Change-Id: Ib3ec17315225e4f0ed173d4d17165b8f21e07acb
| * | | | | Fix testLegacyLockdownVpn flakyChalard Jean2021-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When WiFi disconnects, the VPN disconnects immediately. The broadcast can therefore be sent before the broadcast receiver is registered, which causes the receiver to not see the broadcast. The puzzling part is that CONNECTIVITY_ACTION is a sticky broadcast, so one would expect the broadcast to still be received, even if the registration is done after the broadcast is sent. The reason this doesn't happen is that the context used by the test is a BroadcastInterceptingContext, which does not treat sticky broadcasts as sticky. Bug: 184115648 Test: atest --iterations 1000 'ConnectivityServiceTest#testLegacyLockdownVpn' Change-Id: Ib44c92839d25951cc7d2db0f923e1b104690e1e0
* | | | | | [NS10] Fix a bug where registerIgnoringScore is brokenChalard Jean2021-03-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 184028345 Test: ConnectivityServiceTest Change-Id: Ib5cd2c27a2bd0f53b500e8edbe48126fbf58f34d
* | | | | | [NS09] Implement the new ranking codeChalard Jean2021-03-312-36/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At this stage, this is turned off. Unit tests will be in a followup change. Test: In a followup Bug: 167544279 Change-Id: I4448a3546fbc1a3dddf757982c031c5f39ba2889
* | | | | | Merge changes Id7ee1bd3,I5ea44a94 into sc-devChalard Jean2021-03-311-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: [NS08] Expose public NetworkScore API [NS07] Add the rest of the scoring policy
| * | | | | | [NS07] Add the rest of the scoring policyChalard Jean2021-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 167544279 Test: FrameworksNetTests Change-Id: I5ea44a94ac6f16486274e9091f15a84734db2341
* | | | | | | Merge changes I24580ea4,Id48b8eab am: 07a238ab02 am: e4f241500c am: 463d2f3f27Lorenzo Colitti2021-03-301-33/+73
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1657763 Change-Id: I9d304c35374670eb0e4dcfb9caf6b065878d97e6
| * | | | | | Merge changes I24580ea4,Id48b8eabLorenzo Colitti2021-03-301-33/+73
| |\ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Allow the system to register 250 NetworkCallbacks. Add more test coverage for limiting the number of callbacks.
| | * | | | | Allow the system to register 250 NetworkCallbacks.Lorenzo Colitti2021-03-301-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give anyone with PERMISSION_MAINLINE_NETWORK_STACK (i.e., either the system or the networkstack process) a separate limit of 250 callbacks per UID. Bug: 183921387 Test: new unit tests Change-Id: I24580ea48e3ad502ef584efc5fde0b5d22e392b4
| | * | | | | Add more test coverage for limiting the number of callbacks.Lorenzo Colitti2021-03-301-33/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 183921387 Test: test-only change Change-Id: Id48b8eab507fb616cb0adfeba52e00858d44b8a6
| * | | | | | Merge changes I3826b9ef,I91d68ca3Treehugger Robot2021-03-302-19/+40
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Add static for constant Get NetworkCapabilities from NetworkCallback