Loading src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java +10 −2 Original line number Diff line number Diff line Loading @@ -450,8 +450,16 @@ public class SimStatusDialogController implements DefaultLifecycleObserver { String dataNetworkTypeName = null; String voiceNetworkTypeName = null; final int subId = mSubscriptionInfo.getSubscriptionId(); final int actualDataNetworkType = getTelephonyManager().getDataNetworkType(); final int actualVoiceNetworkType = getTelephonyManager().getVoiceNetworkType(); int actualDataNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; int actualVoiceNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; PackageManager pm = mContext.getPackageManager(); if (pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS)) { actualDataNetworkType = getTelephonyManager().getDataNetworkType(); } if (pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_CALLING)) { actualVoiceNetworkType = getTelephonyManager().getVoiceNetworkType(); } final int overrideNetworkType = mTelephonyDisplayInfo == null ? TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE : mTelephonyDisplayInfo.getOverrideNetworkType(); Loading src/com/android/settings/network/ims/ImsQueryEnhanced4gLteModeUserSetting.java +2 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ public class ImsQueryEnhanced4gLteModeUserSetting implements ImsQuery { return imsMmTelManager.isAdvancedCallingSettingEnabled(); } catch (IllegalArgumentException exception) { Log.w(LOG_TAG, "fail to get VoLte settings. subId=" + mSubId, exception); } catch (UnsupportedOperationException ex) { // expected on devices without IMS } return false; } Loading src/com/android/settings/network/telephony/Enhanced4gBasePreferenceController.java +6 −2 Original line number Diff line number Diff line Loading @@ -112,9 +112,13 @@ public class Enhanced4gBasePreferenceController extends TelephonyTogglePreferenc return CONDITIONALLY_UNAVAILABLE; } try { if (!queryState.isReadyToVoLte()) { return CONDITIONALLY_UNAVAILABLE; } } catch (UnsupportedOperationException ex) { return UNSUPPORTED_ON_DEVICE; } return (isUserControlAllowed(carrierConfig) && queryState.isAllowUserControl()) ? AVAILABLE : AVAILABLE_UNSEARCHABLE; } Loading tests/unit/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.content.Context; import android.content.pm.PackageManager; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; import android.telephony.ServiceState; Loading Loading @@ -67,9 +68,9 @@ import org.mockito.MockitoAnnotations; import java.util.ArrayList; import java.util.HashMap; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.Executor; @RunWith(AndroidJUnit4.class) public class SimStatusDialogControllerTest { Loading @@ -95,6 +96,7 @@ public class SimStatusDialogControllerTest { private SimStatusDialogController mController; private Context mContext; private PackageManager mPackageManager; @Mock private LifecycleOwner mLifecycleOwner; private Lifecycle mLifecycle; Loading @@ -112,6 +114,12 @@ public class SimStatusDialogControllerTest { MockitoAnnotations.initMocks(this); mContext = spy(ApplicationProvider.getApplicationContext()); when(mDialog.getContext()).thenReturn(mContext); mPackageManager = spy(mContext.getPackageManager()); when(mContext.getPackageManager()).thenReturn(mPackageManager); when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS)) .thenReturn(true); when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_CALLING)) .thenReturn(true); mLifecycle = new Lifecycle(mLifecycleOwner); mTelephonyManager = spy(mContext.getSystemService(TelephonyManager.class)); Loading Loading
src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java +10 −2 Original line number Diff line number Diff line Loading @@ -450,8 +450,16 @@ public class SimStatusDialogController implements DefaultLifecycleObserver { String dataNetworkTypeName = null; String voiceNetworkTypeName = null; final int subId = mSubscriptionInfo.getSubscriptionId(); final int actualDataNetworkType = getTelephonyManager().getDataNetworkType(); final int actualVoiceNetworkType = getTelephonyManager().getVoiceNetworkType(); int actualDataNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; int actualVoiceNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; PackageManager pm = mContext.getPackageManager(); if (pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS)) { actualDataNetworkType = getTelephonyManager().getDataNetworkType(); } if (pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_CALLING)) { actualVoiceNetworkType = getTelephonyManager().getVoiceNetworkType(); } final int overrideNetworkType = mTelephonyDisplayInfo == null ? TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE : mTelephonyDisplayInfo.getOverrideNetworkType(); Loading
src/com/android/settings/network/ims/ImsQueryEnhanced4gLteModeUserSetting.java +2 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ public class ImsQueryEnhanced4gLteModeUserSetting implements ImsQuery { return imsMmTelManager.isAdvancedCallingSettingEnabled(); } catch (IllegalArgumentException exception) { Log.w(LOG_TAG, "fail to get VoLte settings. subId=" + mSubId, exception); } catch (UnsupportedOperationException ex) { // expected on devices without IMS } return false; } Loading
src/com/android/settings/network/telephony/Enhanced4gBasePreferenceController.java +6 −2 Original line number Diff line number Diff line Loading @@ -112,9 +112,13 @@ public class Enhanced4gBasePreferenceController extends TelephonyTogglePreferenc return CONDITIONALLY_UNAVAILABLE; } try { if (!queryState.isReadyToVoLte()) { return CONDITIONALLY_UNAVAILABLE; } } catch (UnsupportedOperationException ex) { return UNSUPPORTED_ON_DEVICE; } return (isUserControlAllowed(carrierConfig) && queryState.isAllowUserControl()) ? AVAILABLE : AVAILABLE_UNSEARCHABLE; } Loading
tests/unit/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.content.Context; import android.content.pm.PackageManager; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; import android.telephony.ServiceState; Loading Loading @@ -67,9 +68,9 @@ import org.mockito.MockitoAnnotations; import java.util.ArrayList; import java.util.HashMap; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.Executor; @RunWith(AndroidJUnit4.class) public class SimStatusDialogControllerTest { Loading @@ -95,6 +96,7 @@ public class SimStatusDialogControllerTest { private SimStatusDialogController mController; private Context mContext; private PackageManager mPackageManager; @Mock private LifecycleOwner mLifecycleOwner; private Lifecycle mLifecycle; Loading @@ -112,6 +114,12 @@ public class SimStatusDialogControllerTest { MockitoAnnotations.initMocks(this); mContext = spy(ApplicationProvider.getApplicationContext()); when(mDialog.getContext()).thenReturn(mContext); mPackageManager = spy(mContext.getPackageManager()); when(mContext.getPackageManager()).thenReturn(mPackageManager); when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS)) .thenReturn(true); when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_CALLING)) .thenReturn(true); mLifecycle = new Lifecycle(mLifecycleOwner); mTelephonyManager = spy(mContext.getSystemService(TelephonyManager.class)); Loading