Add 5G/NR QOS support

Bug: 155176305
Bug: 182317794
Test: atest ConnectivityServiceTest
      atest QosCallbackTrackerTest

Change-Id: Idf6d8a7c3b80bc50a2c1244ceaefea9381d40c2f
This commit is contained in:
Jayachandran C
2021-03-15 15:58:11 -07:00
parent 651b002c6c
commit 6cdedaee91
10 changed files with 127 additions and 22 deletions

View File

@@ -266,6 +266,7 @@ import android.security.Credentials;
import android.system.Os;
import android.telephony.TelephonyManager;
import android.telephony.data.EpsBearerQosSessionAttributes;
import android.telephony.data.NrQosSessionAttributes;
import android.test.mock.MockContentResolver;
import android.text.TextUtils;
import android.util.ArraySet;
@@ -9966,13 +9967,43 @@ public class ConnectivityServiceTest {
&& session.getSessionType() == QosSession.TYPE_EPS_BEARER), eq(attributes));
mQosCallbackMockHelper.mAgentWrapper.getNetworkAgent()
.sendQosSessionLost(qosCallbackId, sessionId);
.sendQosSessionLost(qosCallbackId, sessionId, QosSession.TYPE_EPS_BEARER);
waitForIdle();
verify(mQosCallbackMockHelper.mCallback).onQosSessionLost(argThat(session ->
session.getSessionId() == sessionId
&& session.getSessionType() == QosSession.TYPE_EPS_BEARER));
}
@Test
public void testNrQosCallbackAvailableAndLost() throws Exception {
mQosCallbackMockHelper = new QosCallbackMockHelper();
final int sessionId = 10;
final int qosCallbackId = 1;
when(mQosCallbackMockHelper.mFilter.validate())
.thenReturn(QosCallbackException.EX_TYPE_FILTER_NONE);
mQosCallbackMockHelper.registerQosCallback(
mQosCallbackMockHelper.mFilter, mQosCallbackMockHelper.mCallback);
waitForIdle();
final NrQosSessionAttributes attributes = new NrQosSessionAttributes(
1, 2, 3, 4, 5, 6, 7, new ArrayList<>());
mQosCallbackMockHelper.mAgentWrapper.getNetworkAgent()
.sendQosSessionAvailable(qosCallbackId, sessionId, attributes);
waitForIdle();
verify(mQosCallbackMockHelper.mCallback).onNrQosSessionAvailable(argThat(session ->
session.getSessionId() == sessionId
&& session.getSessionType() == QosSession.TYPE_NR_BEARER), eq(attributes));
mQosCallbackMockHelper.mAgentWrapper.getNetworkAgent()
.sendQosSessionLost(qosCallbackId, sessionId, QosSession.TYPE_NR_BEARER);
waitForIdle();
verify(mQosCallbackMockHelper.mCallback).onQosSessionLost(argThat(session ->
session.getSessionId() == sessionId
&& session.getSessionType() == QosSession.TYPE_NR_BEARER));
}
@Test
public void testQosCallbackTooManyRequests() throws Exception {
mQosCallbackMockHelper = new QosCallbackMockHelper();