Loading src/java/com/android/internal/telephony/data/AutoDataSwitchController.java +5 −2 Original line number Diff line number Diff line Loading @@ -191,8 +191,7 @@ public class AutoDataSwitchController extends Handler { /** The phone */ @NonNull private final Phone mPhone; /** Data registration state of the phone */ @RegistrationState private int mDataRegState = NetworkRegistrationInfo .REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING; @RegistrationState private int mDataRegState; /** Current Telephony display info of the phone */ @NonNull private TelephonyDisplayInfo mDisplayInfo; /** Signal strength of the phone */ Loading @@ -201,6 +200,10 @@ public class AutoDataSwitchController extends Handler { private boolean mListeningForEvents; private PhoneSignalStatus(@NonNull Phone phone) { this.mPhone = phone; this.mDataRegState = phone.getServiceState().getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .getRegistrationState(); this.mDisplayInfo = phone.getDisplayInfoController().getTelephonyDisplayInfo(); this.mSignalStrength = phone.getSignalStrength(); } Loading tests/telephonytests/src/com/android/internal/telephony/data/AutoDataSwitchControllerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,17 @@ public class AutoDataSwitchControllerTest extends TelephonyTest { mPhones = new Phone[]{mPhone, mPhone2}; for (Phone phone : mPhones) { ServiceState ss = new ServiceState(); ss.addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setIsNonTerrestrialNetwork(mIsNonTerrestrialNetwork) .build()); doReturn(ss).when(phone).getServiceState(); doReturn(mSST).when(phone).getServiceStateTracker(); doReturn(mDisplayInfoController).when(phone).getDisplayInfoController(); doReturn(mSignalStrengthController).when(phone).getSignalStrengthController(); Loading tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -1936,6 +1936,17 @@ public class PhoneSwitcherTest extends TelephonyTest { } replaceInstance(PhoneFactory.class, "sPhones", null, mPhones); for (Phone phone : mPhones) { ServiceState ss = new ServiceState(); ss.addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .build()); doReturn(ss).when(phone).getServiceState(); } } private void initializeCommandInterfacesMock() { Loading Loading
src/java/com/android/internal/telephony/data/AutoDataSwitchController.java +5 −2 Original line number Diff line number Diff line Loading @@ -191,8 +191,7 @@ public class AutoDataSwitchController extends Handler { /** The phone */ @NonNull private final Phone mPhone; /** Data registration state of the phone */ @RegistrationState private int mDataRegState = NetworkRegistrationInfo .REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING; @RegistrationState private int mDataRegState; /** Current Telephony display info of the phone */ @NonNull private TelephonyDisplayInfo mDisplayInfo; /** Signal strength of the phone */ Loading @@ -201,6 +200,10 @@ public class AutoDataSwitchController extends Handler { private boolean mListeningForEvents; private PhoneSignalStatus(@NonNull Phone phone) { this.mPhone = phone; this.mDataRegState = phone.getServiceState().getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .getRegistrationState(); this.mDisplayInfo = phone.getDisplayInfoController().getTelephonyDisplayInfo(); this.mSignalStrength = phone.getSignalStrength(); } Loading
tests/telephonytests/src/com/android/internal/telephony/data/AutoDataSwitchControllerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,17 @@ public class AutoDataSwitchControllerTest extends TelephonyTest { mPhones = new Phone[]{mPhone, mPhone2}; for (Phone phone : mPhones) { ServiceState ss = new ServiceState(); ss.addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setIsNonTerrestrialNetwork(mIsNonTerrestrialNetwork) .build()); doReturn(ss).when(phone).getServiceState(); doReturn(mSST).when(phone).getServiceStateTracker(); doReturn(mDisplayInfoController).when(phone).getDisplayInfoController(); doReturn(mSignalStrengthController).when(phone).getSignalStrengthController(); Loading
tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -1936,6 +1936,17 @@ public class PhoneSwitcherTest extends TelephonyTest { } replaceInstance(PhoneFactory.class, "sPhones", null, mPhones); for (Phone phone : mPhones) { ServiceState ss = new ServiceState(); ss.addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .build()); doReturn(ss).when(phone).getServiceState(); } } private void initializeCommandInterfacesMock() { Loading