summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenedict Wong <benedictwong@google.com>2022-02-16 21:44:40 +0000
committerBenedict Wong <benedictwong@google.com>2022-02-16 21:47:33 +0000
commit6366a704349bc6e319ecd99d43b85b598ed7e716 (patch)
treea9ff3e81c3f5d5e0225863e93dc261b90e591aaa /tests
parent420e6d5a252ea9592069c75f59cc7365dc0b6b38 (diff)
Add type string to VCN NetworkAgentConfig
This change populates the VCN type string used in NetworkInfo. While the NetworkInfo API has long been deprecated, some apps apparently still use this API. Even more unusually, some apps use the NetworkInfo's type strings, and perform string comparisons on the type string, as opposed to the type integer/enums to determine network types. This change ensures maximum backward compatibility. Bug: 219287843 Original-Change: android-review.googlesource.com/1987026 Test: atest FrameworksVcnTests Change-Id: I059dbc997f97482f7355fdc29d464d5452933ce3 Merged-In: I059dbc997f97482f7355fdc29d464d5452933ce3
Diffstat (limited to 'tests')
-rw-r--r--tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
index 7b5f0b180c6e..a687bb893c4a 100644
--- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
+++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
@@ -307,7 +307,10 @@ public class VcnGatewayConnectionConnectedStateTest extends VcnGatewayConnection
ncCaptor.capture(),
lpCaptor.capture(),
any(),
- argThat(nac -> nac.getLegacyType() == ConnectivityManager.TYPE_MOBILE),
+ // Subtype integer/name and extras do not have getters; cannot be tested.
+ argThat(nac -> nac.getLegacyType() == ConnectivityManager.TYPE_MOBILE
+ && nac.getLegacyTypeName().equals(
+ VcnGatewayConnection.NETWORK_INFO_NETWORK_TYPE_STRING)),
any(),
any(),
any());