Loading src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java +4 −3 Original line number Diff line number Diff line Loading @@ -67,14 +67,15 @@ public class CdmaSubscriptionPreferenceController extends CdmaBasePreferenceCont public boolean onPreferenceChange(Preference preference, Object object) { final int newMode = Integer.parseInt((String) object); //TODO(b/117611981): only set it in one place if (mTelephonyManager.setCdmaSubscriptionMode(newMode)) { try { mTelephonyManager.setCdmaSubscriptionMode(newMode); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.CDMA_SUBSCRIPTION_MODE, newMode); return true; } } catch (IllegalStateException e) { return false; } } @VisibleForTesting boolean deviceSupportsNvAndRuim() { Loading src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java +4 −3 Original line number Diff line number Diff line Loading @@ -63,14 +63,15 @@ public class CdmaSystemSelectPreferenceController extends CdmaBasePreferenceCont public boolean onPreferenceChange(Preference preference, Object object) { int newMode = Integer.parseInt((String) object); //TODO(b/117611981): only set it in one place if (mTelephonyManager.setCdmaRoamingMode(newMode)) { try { mTelephonyManager.setCdmaRoamingMode(newMode); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.CDMA_ROAMING_MODE, newMode); return true; } } catch (IllegalStateException e) { return false; } } private void resetCdmaRoamingModeToDefault() { final ListPreference listPreference = (ListPreference) mPreference; Loading tests/robotests/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceControllerTest.java +0 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.settings.network.telephony.cdma; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; Loading Loading @@ -86,8 +85,6 @@ public class CdmaSubscriptionPreferenceControllerTest { @Test public void onPreferenceChange_selectNV_returnNVMode() { doReturn(true).when(mTelephonyManager).setCdmaSubscriptionMode(anyInt()); mController.onPreferenceChange(mPreference, Integer.toString( TelephonyManager.CDMA_SUBSCRIPTION_NV)); Loading tests/robotests/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.settings.network.telephony.cdma; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; Loading Loading @@ -92,7 +91,6 @@ public class CdmaSystemSelectPreferenceControllerTest { Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.CDMA_ROAMING_MODE, TelephonyManager.CDMA_ROAMING_MODE_ANY); doReturn(true).when(mTelephonyManager).setCdmaRoamingMode(anyInt()); mController.onPreferenceChange(mPreference, Integer.toString(TelephonyManager.CDMA_ROAMING_MODE_HOME)); Loading Loading
src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java +4 −3 Original line number Diff line number Diff line Loading @@ -67,14 +67,15 @@ public class CdmaSubscriptionPreferenceController extends CdmaBasePreferenceCont public boolean onPreferenceChange(Preference preference, Object object) { final int newMode = Integer.parseInt((String) object); //TODO(b/117611981): only set it in one place if (mTelephonyManager.setCdmaSubscriptionMode(newMode)) { try { mTelephonyManager.setCdmaSubscriptionMode(newMode); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.CDMA_SUBSCRIPTION_MODE, newMode); return true; } } catch (IllegalStateException e) { return false; } } @VisibleForTesting boolean deviceSupportsNvAndRuim() { Loading
src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java +4 −3 Original line number Diff line number Diff line Loading @@ -63,14 +63,15 @@ public class CdmaSystemSelectPreferenceController extends CdmaBasePreferenceCont public boolean onPreferenceChange(Preference preference, Object object) { int newMode = Integer.parseInt((String) object); //TODO(b/117611981): only set it in one place if (mTelephonyManager.setCdmaRoamingMode(newMode)) { try { mTelephonyManager.setCdmaRoamingMode(newMode); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.CDMA_ROAMING_MODE, newMode); return true; } } catch (IllegalStateException e) { return false; } } private void resetCdmaRoamingModeToDefault() { final ListPreference listPreference = (ListPreference) mPreference; Loading
tests/robotests/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceControllerTest.java +0 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.settings.network.telephony.cdma; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; Loading Loading @@ -86,8 +85,6 @@ public class CdmaSubscriptionPreferenceControllerTest { @Test public void onPreferenceChange_selectNV_returnNVMode() { doReturn(true).when(mTelephonyManager).setCdmaSubscriptionMode(anyInt()); mController.onPreferenceChange(mPreference, Integer.toString( TelephonyManager.CDMA_SUBSCRIPTION_NV)); Loading
tests/robotests/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.settings.network.telephony.cdma; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; Loading Loading @@ -92,7 +91,6 @@ public class CdmaSystemSelectPreferenceControllerTest { Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.CDMA_ROAMING_MODE, TelephonyManager.CDMA_ROAMING_MODE_ANY); doReturn(true).when(mTelephonyManager).setCdmaRoamingMode(anyInt()); mController.onPreferenceChange(mPreference, Integer.toString(TelephonyManager.CDMA_ROAMING_MODE_HOME)); Loading