Loading src/java/com/android/internal/telephony/RIL.java +3 −3 Original line number Diff line number Diff line Loading @@ -1965,7 +1965,7 @@ public class RIL extends BaseCommands implements CommandsInterface { OptionalOsAppId optionalOsAppId = new OptionalOsAppId(); if (trafficDescriptor.getOsAppId() != null) { android.hardware.radio.V1_6.OsAppId osAppId = new android.hardware.radio.V1_6.OsAppId(); osAppId.osAppId = primitiveArrayToArrayList(trafficDescriptor.getOsAppId().getBytes()); osAppId.osAppId = primitiveArrayToArrayList(trafficDescriptor.getOsAppId()); optionalOsAppId.value(osAppId); } td.osAppId = optionalOsAppId; Loading Loading @@ -7707,8 +7707,8 @@ public class RIL extends BaseCommands implements CommandsInterface { android.hardware.radio.V1_6.TrafficDescriptor td) { String dnn = td.dnn.getDiscriminator() == OptionalDnn.hidl_discriminator.noinit ? null : td.dnn.value(); String osAppId = td.osAppId.getDiscriminator() == OptionalOsAppId.hidl_discriminator.noinit ? null : new String(arrayListToPrimitiveArray(td.osAppId.value().osAppId)); byte[] osAppId = td.osAppId.getDiscriminator() == OptionalOsAppId.hidl_discriminator.noinit ? null : arrayListToPrimitiveArray(td.osAppId.value().osAppId); TrafficDescriptor.Builder builder = new TrafficDescriptor.Builder(); if (dnn != null) { builder.setDataNetworkName(dnn); Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +14 −6 Original line number Diff line number Diff line Loading @@ -824,6 +824,16 @@ public class DataConnection extends StateMachine { : AccessNetworkConstants.TRANSPORT_TYPE_WWAN; } /** * API to generate the OSAppId for enterprise traffic category. * @return byte[] representing OSId + OSAppId */ @VisibleForTesting public static byte[] getEnterpriseOsAppId() { return NetworkCapabilities.getCapabilityCarrierName( NetworkCapabilities.NET_CAPABILITY_ENTERPRISE).getBytes(); } /** * Begin setting up a data connection, calls setupDataCall * and the ConnectionParams will be returned with the Loading Loading @@ -888,10 +898,9 @@ public class DataConnection extends StateMachine { || isUnmeteredApnType)); String dnn = null; String osAppId = null; byte[] osAppId = null; if (cp.mApnContext.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) { osAppId = NetworkCapabilities.getCapabilityCarrierName( NetworkCapabilities.NET_CAPABILITY_ENTERPRISE); osAppId = getEnterpriseOsAppId(); } else { dnn = mApnSetting.getApnName(); } Loading Loading @@ -1771,9 +1780,8 @@ public class DataConnection extends StateMachine { private boolean isEnterpriseUse() { boolean enterpriseTrafficDescriptor = mTrafficDescriptors .stream() .anyMatch(td -> td.getOsAppId() != null && td.getOsAppId().equals( NetworkCapabilities.getCapabilityCarrierName( NetworkCapabilities.NET_CAPABILITY_ENTERPRISE))); .anyMatch(td -> td.getOsAppId() != null && Arrays.equals(td.getOsAppId(), getEnterpriseOsAppId())); boolean enterpriseApnContext = mApnContexts.keySet() .stream() .anyMatch(ac -> ac.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE); Loading tests/telephonytests/src/com/android/internal/telephony/RILTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -2350,7 +2350,8 @@ public class RILTest extends TelephonyTest { android.hardware.radio.V1_6.OptionalOsAppId halOsAppId = new android.hardware.radio.V1_6.OptionalOsAppId(); android.hardware.radio.V1_6.OsAppId osAppId = new android.hardware.radio.V1_6.OsAppId(); osAppId.osAppId = mRILUnderTest.primitiveArrayToArrayList("OS_APP_ID".getBytes()); byte[] osAppIdArray = {1, 2, 3, 4}; osAppId.osAppId = mRILUnderTest.primitiveArrayToArrayList(osAppIdArray); halOsAppId.value(osAppId); halTrafficDescriptor.dnn = halDnn; Loading @@ -2358,7 +2359,7 @@ public class RILTest extends TelephonyTest { result16.trafficDescriptors = new ArrayList<>(Arrays.asList(halTrafficDescriptor)); List<TrafficDescriptor> trafficDescriptors = Arrays.asList( new TrafficDescriptor("DNN", "OS_APP_ID")); new TrafficDescriptor("DNN", osAppIdArray)); response = new DataCallResponse.Builder() .setCause(0) Loading tests/telephonytests/src/com/android/internal/telephony/dataconnection/DataCallResponseTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,8 @@ import java.util.Arrays; public class DataCallResponseTest extends AndroidTestCase { public static final String FAKE_DNN = "FAKE_DNN"; public static final String FAKE_OS_APP_ID = "FAKE_OS_APP_ID"; public static final byte[] FAKE_OS_APP_ID = {1, 2, 3, 4}; public static final byte[] FAKE_OS_APP_ID_2 = {5, 6, 8, 9}; @SmallTest public void testParcel() { Loading Loading @@ -131,7 +132,7 @@ public class DataCallResponseTest extends AndroidTestCase { .setMtuV4(1441) .setMtuV6(1440) .setTrafficDescriptors( Arrays.asList(new TrafficDescriptor("FAKE_DNN_2", "FAKE_OS_APP_ID_2"))) Arrays.asList(new TrafficDescriptor("FAKE_DNN_2", FAKE_OS_APP_ID_2))) .build(); assertNotSame(response1, response2); Loading tests/telephonytests/src/com/android/internal/telephony/dataconnection/DataConnectionTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -420,8 +420,8 @@ public class DataConnectionTest extends TelephonyTest { if (tdCaptor.getValue() != null) { if (mApnContext.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) { assertEquals(null, tdCaptor.getValue().getDataNetworkName()); assertTrue(tdCaptor.getValue().getOsAppId() .contains(ApnSetting.TYPE_ENTERPRISE_STRING)); assertTrue(Arrays.equals(DataConnection.getEnterpriseOsAppId(), tdCaptor.getValue().getOsAppId())); } else { assertEquals("spmode.ne.jp", tdCaptor.getValue().getDataNetworkName()); assertEquals(null, tdCaptor.getValue().getOsAppId()); Loading Loading
src/java/com/android/internal/telephony/RIL.java +3 −3 Original line number Diff line number Diff line Loading @@ -1965,7 +1965,7 @@ public class RIL extends BaseCommands implements CommandsInterface { OptionalOsAppId optionalOsAppId = new OptionalOsAppId(); if (trafficDescriptor.getOsAppId() != null) { android.hardware.radio.V1_6.OsAppId osAppId = new android.hardware.radio.V1_6.OsAppId(); osAppId.osAppId = primitiveArrayToArrayList(trafficDescriptor.getOsAppId().getBytes()); osAppId.osAppId = primitiveArrayToArrayList(trafficDescriptor.getOsAppId()); optionalOsAppId.value(osAppId); } td.osAppId = optionalOsAppId; Loading Loading @@ -7707,8 +7707,8 @@ public class RIL extends BaseCommands implements CommandsInterface { android.hardware.radio.V1_6.TrafficDescriptor td) { String dnn = td.dnn.getDiscriminator() == OptionalDnn.hidl_discriminator.noinit ? null : td.dnn.value(); String osAppId = td.osAppId.getDiscriminator() == OptionalOsAppId.hidl_discriminator.noinit ? null : new String(arrayListToPrimitiveArray(td.osAppId.value().osAppId)); byte[] osAppId = td.osAppId.getDiscriminator() == OptionalOsAppId.hidl_discriminator.noinit ? null : arrayListToPrimitiveArray(td.osAppId.value().osAppId); TrafficDescriptor.Builder builder = new TrafficDescriptor.Builder(); if (dnn != null) { builder.setDataNetworkName(dnn); Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +14 −6 Original line number Diff line number Diff line Loading @@ -824,6 +824,16 @@ public class DataConnection extends StateMachine { : AccessNetworkConstants.TRANSPORT_TYPE_WWAN; } /** * API to generate the OSAppId for enterprise traffic category. * @return byte[] representing OSId + OSAppId */ @VisibleForTesting public static byte[] getEnterpriseOsAppId() { return NetworkCapabilities.getCapabilityCarrierName( NetworkCapabilities.NET_CAPABILITY_ENTERPRISE).getBytes(); } /** * Begin setting up a data connection, calls setupDataCall * and the ConnectionParams will be returned with the Loading Loading @@ -888,10 +898,9 @@ public class DataConnection extends StateMachine { || isUnmeteredApnType)); String dnn = null; String osAppId = null; byte[] osAppId = null; if (cp.mApnContext.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) { osAppId = NetworkCapabilities.getCapabilityCarrierName( NetworkCapabilities.NET_CAPABILITY_ENTERPRISE); osAppId = getEnterpriseOsAppId(); } else { dnn = mApnSetting.getApnName(); } Loading Loading @@ -1771,9 +1780,8 @@ public class DataConnection extends StateMachine { private boolean isEnterpriseUse() { boolean enterpriseTrafficDescriptor = mTrafficDescriptors .stream() .anyMatch(td -> td.getOsAppId() != null && td.getOsAppId().equals( NetworkCapabilities.getCapabilityCarrierName( NetworkCapabilities.NET_CAPABILITY_ENTERPRISE))); .anyMatch(td -> td.getOsAppId() != null && Arrays.equals(td.getOsAppId(), getEnterpriseOsAppId())); boolean enterpriseApnContext = mApnContexts.keySet() .stream() .anyMatch(ac -> ac.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE); Loading
tests/telephonytests/src/com/android/internal/telephony/RILTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -2350,7 +2350,8 @@ public class RILTest extends TelephonyTest { android.hardware.radio.V1_6.OptionalOsAppId halOsAppId = new android.hardware.radio.V1_6.OptionalOsAppId(); android.hardware.radio.V1_6.OsAppId osAppId = new android.hardware.radio.V1_6.OsAppId(); osAppId.osAppId = mRILUnderTest.primitiveArrayToArrayList("OS_APP_ID".getBytes()); byte[] osAppIdArray = {1, 2, 3, 4}; osAppId.osAppId = mRILUnderTest.primitiveArrayToArrayList(osAppIdArray); halOsAppId.value(osAppId); halTrafficDescriptor.dnn = halDnn; Loading @@ -2358,7 +2359,7 @@ public class RILTest extends TelephonyTest { result16.trafficDescriptors = new ArrayList<>(Arrays.asList(halTrafficDescriptor)); List<TrafficDescriptor> trafficDescriptors = Arrays.asList( new TrafficDescriptor("DNN", "OS_APP_ID")); new TrafficDescriptor("DNN", osAppIdArray)); response = new DataCallResponse.Builder() .setCause(0) Loading
tests/telephonytests/src/com/android/internal/telephony/dataconnection/DataCallResponseTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,8 @@ import java.util.Arrays; public class DataCallResponseTest extends AndroidTestCase { public static final String FAKE_DNN = "FAKE_DNN"; public static final String FAKE_OS_APP_ID = "FAKE_OS_APP_ID"; public static final byte[] FAKE_OS_APP_ID = {1, 2, 3, 4}; public static final byte[] FAKE_OS_APP_ID_2 = {5, 6, 8, 9}; @SmallTest public void testParcel() { Loading Loading @@ -131,7 +132,7 @@ public class DataCallResponseTest extends AndroidTestCase { .setMtuV4(1441) .setMtuV6(1440) .setTrafficDescriptors( Arrays.asList(new TrafficDescriptor("FAKE_DNN_2", "FAKE_OS_APP_ID_2"))) Arrays.asList(new TrafficDescriptor("FAKE_DNN_2", FAKE_OS_APP_ID_2))) .build(); assertNotSame(response1, response2); Loading
tests/telephonytests/src/com/android/internal/telephony/dataconnection/DataConnectionTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -420,8 +420,8 @@ public class DataConnectionTest extends TelephonyTest { if (tdCaptor.getValue() != null) { if (mApnContext.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) { assertEquals(null, tdCaptor.getValue().getDataNetworkName()); assertTrue(tdCaptor.getValue().getOsAppId() .contains(ApnSetting.TYPE_ENTERPRISE_STRING)); assertTrue(Arrays.equals(DataConnection.getEnterpriseOsAppId(), tdCaptor.getValue().getOsAppId())); } else { assertEquals("spmode.ne.jp", tdCaptor.getValue().getDataNetworkName()); assertEquals(null, tdCaptor.getValue().getOsAppId()); Loading