Loading src/java/com/android/internal/telephony/data/DataNetworkController.java +1 −1 Original line number Diff line number Diff line Loading @@ -2128,7 +2128,7 @@ public class DataNetworkController extends Handler { * @return The data network if found. */ @Nullable DataNetwork getDataNetworkByInterface(@NonNull String interfaceName) { public DataNetwork getDataNetworkByInterface(@NonNull String interfaceName) { return mDataNetworkList.stream() .filter(dataNetwork -> !dataNetwork.isDisconnecting()) .filter(dataNetwork -> interfaceName.equals( Loading tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java +5 −11 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import android.app.NotificationManager; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; Loading Loading @@ -122,7 +121,6 @@ public class PhoneSwitcherTest extends TelephonyTest { private ISetOpportunisticDataCallback mSetOpptDataCallback2; PhoneSwitcher.ImsRegTechProvider mMockImsRegTechProvider; private SubscriptionInfo mSubscriptionInfo; private NotificationManager mNotificationManager; private PhoneSwitcher mPhoneSwitcherUT; private SubscriptionManager.OnSubscriptionsChangedListener mSubChangedListener; Loading Loading @@ -158,7 +156,6 @@ public class PhoneSwitcherTest extends TelephonyTest { mSetOpptDataCallback2 = mock(ISetOpportunisticDataCallback.class); mMockImsRegTechProvider = mock(PhoneSwitcher.ImsRegTechProvider.class); mSubscriptionInfo = mock(SubscriptionInfo.class); mNotificationManager = mock(NotificationManager.class); PhoneCapability phoneCapability = new PhoneCapability(1, 1, null, false, new int[0]); doReturn(phoneCapability).when(mPhoneConfigurationManager).getCurrentPhoneCapability(); Loading Loading @@ -587,7 +584,6 @@ public class PhoneSwitcherTest extends TelephonyTest { @Test @SmallTest public void testAutoDataSwitchSetNotification() throws Exception { clearInvocations(mNotificationManager); SubscriptionInfo mockedInfo = mock(SubscriptionInfo.class); doReturn(false).when(mockedInfo).isOpportunistic(); doReturn(mockedInfo).when(mSubscriptionController).getSubscriptionInfo(anyInt()); Loading @@ -599,23 +595,23 @@ public class PhoneSwitcherTest extends TelephonyTest { setDefaultDataSubId(1); testAutoSwitchToSecondarySucceed(); clearInvocations(mSubscriptionController); Message.obtain(mPhoneSwitcherUT, EVENT_MODEM_COMMAND_DONE, new AsyncResult(1, null, null)) .sendToTarget(); processAllMessages(); verify(mNotificationManager).notify(eq(null), eq(AUTO_DATA_SWITCH_NOTIFICATION), any()); verify(mSubscriptionController).getSubscriptionInfo(2); // switch back to primary clearInvocations(mSubscriptionController); Message.obtain(mPhoneSwitcherUT, EVENT_MODEM_COMMAND_DONE, new AsyncResult(0, null, null)) .sendToTarget(); processAllMessages(); verify(mNotificationManager).cancel(eq(null), eq(AUTO_DATA_SWITCH_NOTIFICATION)); verify(mSubscriptionController, never()).getSubscriptionInfo(1); clearInvocations(mNotificationManager); Message.obtain(mPhoneSwitcherUT, EVENT_MODEM_COMMAND_DONE, new AsyncResult(1, null, null)) .sendToTarget(); processAllMessages(); verify(mNotificationManager, never()) .notify(eq(null), eq(AUTO_DATA_SWITCH_NOTIFICATION), any()); verify(mSubscriptionController, never()).getSubscriptionInfo(2); } /** Loading Loading @@ -1879,8 +1875,6 @@ public class PhoneSwitcherTest extends TelephonyTest { mPhoneSwitcherUT = new PhoneSwitcher(mMaxDataAttachModemCount, mContext, Looper.myLooper()); processAllMessages(); replaceInstance(PhoneSwitcher.class, "mNotificationManager", mPhoneSwitcherUT, mNotificationManager); Field field = PhoneSwitcher.class.getDeclaredField("mDataSettingsManagerCallbacks"); field.setAccessible(true); Loading tests/telephonytests/src/com/android/internal/telephony/euicc/EuiccControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ import libcore.junit.util.compat.CoreCompatChangeRule.EnableCompatChanges; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestRule; Loading Loading @@ -611,6 +612,7 @@ public class EuiccControllerTest extends TelephonyTest { assertFalse(mController.mCalledRefreshSubscriptionsAndSendResult); } @Ignore("b/255697307") @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_multiSim() Loading Loading @@ -887,6 +889,7 @@ public class EuiccControllerTest extends TelephonyTest { anyBoolean(), any(), anyBoolean()); } @Ignore("b/255697307") @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_success() throws Exception { Loading Loading
src/java/com/android/internal/telephony/data/DataNetworkController.java +1 −1 Original line number Diff line number Diff line Loading @@ -2128,7 +2128,7 @@ public class DataNetworkController extends Handler { * @return The data network if found. */ @Nullable DataNetwork getDataNetworkByInterface(@NonNull String interfaceName) { public DataNetwork getDataNetworkByInterface(@NonNull String interfaceName) { return mDataNetworkList.stream() .filter(dataNetwork -> !dataNetwork.isDisconnecting()) .filter(dataNetwork -> interfaceName.equals( Loading
tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java +5 −11 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import android.app.NotificationManager; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; Loading Loading @@ -122,7 +121,6 @@ public class PhoneSwitcherTest extends TelephonyTest { private ISetOpportunisticDataCallback mSetOpptDataCallback2; PhoneSwitcher.ImsRegTechProvider mMockImsRegTechProvider; private SubscriptionInfo mSubscriptionInfo; private NotificationManager mNotificationManager; private PhoneSwitcher mPhoneSwitcherUT; private SubscriptionManager.OnSubscriptionsChangedListener mSubChangedListener; Loading Loading @@ -158,7 +156,6 @@ public class PhoneSwitcherTest extends TelephonyTest { mSetOpptDataCallback2 = mock(ISetOpportunisticDataCallback.class); mMockImsRegTechProvider = mock(PhoneSwitcher.ImsRegTechProvider.class); mSubscriptionInfo = mock(SubscriptionInfo.class); mNotificationManager = mock(NotificationManager.class); PhoneCapability phoneCapability = new PhoneCapability(1, 1, null, false, new int[0]); doReturn(phoneCapability).when(mPhoneConfigurationManager).getCurrentPhoneCapability(); Loading Loading @@ -587,7 +584,6 @@ public class PhoneSwitcherTest extends TelephonyTest { @Test @SmallTest public void testAutoDataSwitchSetNotification() throws Exception { clearInvocations(mNotificationManager); SubscriptionInfo mockedInfo = mock(SubscriptionInfo.class); doReturn(false).when(mockedInfo).isOpportunistic(); doReturn(mockedInfo).when(mSubscriptionController).getSubscriptionInfo(anyInt()); Loading @@ -599,23 +595,23 @@ public class PhoneSwitcherTest extends TelephonyTest { setDefaultDataSubId(1); testAutoSwitchToSecondarySucceed(); clearInvocations(mSubscriptionController); Message.obtain(mPhoneSwitcherUT, EVENT_MODEM_COMMAND_DONE, new AsyncResult(1, null, null)) .sendToTarget(); processAllMessages(); verify(mNotificationManager).notify(eq(null), eq(AUTO_DATA_SWITCH_NOTIFICATION), any()); verify(mSubscriptionController).getSubscriptionInfo(2); // switch back to primary clearInvocations(mSubscriptionController); Message.obtain(mPhoneSwitcherUT, EVENT_MODEM_COMMAND_DONE, new AsyncResult(0, null, null)) .sendToTarget(); processAllMessages(); verify(mNotificationManager).cancel(eq(null), eq(AUTO_DATA_SWITCH_NOTIFICATION)); verify(mSubscriptionController, never()).getSubscriptionInfo(1); clearInvocations(mNotificationManager); Message.obtain(mPhoneSwitcherUT, EVENT_MODEM_COMMAND_DONE, new AsyncResult(1, null, null)) .sendToTarget(); processAllMessages(); verify(mNotificationManager, never()) .notify(eq(null), eq(AUTO_DATA_SWITCH_NOTIFICATION), any()); verify(mSubscriptionController, never()).getSubscriptionInfo(2); } /** Loading Loading @@ -1879,8 +1875,6 @@ public class PhoneSwitcherTest extends TelephonyTest { mPhoneSwitcherUT = new PhoneSwitcher(mMaxDataAttachModemCount, mContext, Looper.myLooper()); processAllMessages(); replaceInstance(PhoneSwitcher.class, "mNotificationManager", mPhoneSwitcherUT, mNotificationManager); Field field = PhoneSwitcher.class.getDeclaredField("mDataSettingsManagerCallbacks"); field.setAccessible(true); Loading
tests/telephonytests/src/com/android/internal/telephony/euicc/EuiccControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ import libcore.junit.util.compat.CoreCompatChangeRule.EnableCompatChanges; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestRule; Loading Loading @@ -611,6 +612,7 @@ public class EuiccControllerTest extends TelephonyTest { assertFalse(mController.mCalledRefreshSubscriptionsAndSendResult); } @Ignore("b/255697307") @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testDownloadSubscription_noPrivileges_hasCarrierPrivileges_multiSim() Loading Loading @@ -887,6 +889,7 @@ public class EuiccControllerTest extends TelephonyTest { anyBoolean(), any(), anyBoolean()); } @Ignore("b/255697307") @Test @DisableCompatChanges({EuiccManager.SHOULD_RESOLVE_PORT_INDEX_FOR_APPS}) public void testSwitchToSubscription_emptySubscription_success() throws Exception { Loading