summaryrefslogtreecommitdiff
path: root/test/com/google/android
diff options
context:
space:
mode:
authorPo-Chun Lee <pochunlee@google.com>2024-01-31 00:46:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-01-31 00:46:59 +0000
commitffe1598b8c49fc4f24b00694d562213f766b6b4a (patch)
treea051cd1488e45dc10adefab79f23bcb9955a1846 /test/com/google/android
parentc3c4fff6b7b169f035926f664713f904e496255f (diff)
parent62a52056a59feaa48a9528aa8ac57edafcd95fa9 (diff)
downloadIwlan-ffe1598b8c49fc4f24b00694d562213f766b6b4a.tar.gz
N1_MODE_CAPABILITY Exclusion for Emergency Session am: 62a52056a5
Original change: https://android-review.googlesource.com/c/platform/packages/services/Iwlan/+/2935533 Change-Id: Id870a9ba5ed9245c8281ae6ab9819ebec7e0d59c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'test/com/google/android')
-rw-r--r--test/com/google/android/iwlan/IwlanDataServiceTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/com/google/android/iwlan/IwlanDataServiceTest.java b/test/com/google/android/iwlan/IwlanDataServiceTest.java
index dc2b2cf..f5914d9 100644
--- a/test/com/google/android/iwlan/IwlanDataServiceTest.java
+++ b/test/com/google/android/iwlan/IwlanDataServiceTest.java
@@ -2294,6 +2294,11 @@ public class IwlanDataServiceTest {
private void mockSetupDataCallWithPduSessionId(int pduSessionId) {
DataProfile dp = buildImsDataProfile();
+
+ verifySetupDataCallRequestHandled(pduSessionId, dp);
+ }
+
+ private void verifySetupDataCallRequestHandled(int pduSessionId, DataProfile dp) {
onSystemDefaultNetworkConnected(
mMockNetwork, mLinkProperties, TRANSPORT_WIFI, INVALID_SUB_INDEX);
mSpyIwlanDataServiceProvider.setupDataCall(
@@ -2316,4 +2321,36 @@ public class IwlanDataServiceTest {
any(IwlanTunnelCallback.class),
any(IwlanTunnelMetricsImpl.class));
}
+
+ @Test
+ public void testN1ModeForEmergencySession() {
+ int pduSessionId = 5;
+ DataProfile dp = buildDataProfile(ApnSetting.TYPE_EMERGENCY);
+ verifySetupDataCallRequestHandled(pduSessionId, dp);
+
+ ArgumentCaptor<TunnelSetupRequest> tunnelSetupRequestCaptor =
+ ArgumentCaptor.forClass(TunnelSetupRequest.class);
+ verify(mMockEpdgTunnelManager, times(1))
+ .bringUpTunnel(tunnelSetupRequestCaptor.capture(), any(), any());
+ TunnelSetupRequest tunnelSetupRequest = tunnelSetupRequestCaptor.getValue();
+ assertEquals(pduSessionId, tunnelSetupRequest.getPduSessionId());
+ }
+
+ @Test
+ public void testN1ModeExclusionForEmergencySession() {
+ when(IwlanCarrierConfig.getConfigBoolean(
+ mMockContext,
+ DEFAULT_SLOT_INDEX,
+ IwlanCarrierConfig.KEY_N1_MODE_EXCLUSION_FOR_EMERGENCY_SESSION_BOOL))
+ .thenReturn(true);
+ DataProfile dp = buildDataProfile(ApnSetting.TYPE_EMERGENCY);
+ verifySetupDataCallRequestHandled(5 /* pduSessionId */, dp);
+
+ ArgumentCaptor<TunnelSetupRequest> tunnelSetupRequestCaptor =
+ ArgumentCaptor.forClass(TunnelSetupRequest.class);
+ verify(mMockEpdgTunnelManager, times(1))
+ .bringUpTunnel(tunnelSetupRequestCaptor.capture(), any(), any());
+ TunnelSetupRequest tunnelSetupRequest = tunnelSetupRequestCaptor.getValue();
+ assertEquals(PDU_SESSION_ID_UNSET, tunnelSetupRequest.getPduSessionId());
+ }
}