Loading src/java/com/android/internal/telephony/gsm/GsmMmiCode.java +1 −1 Original line number Diff line number Diff line Loading @@ -1228,7 +1228,7 @@ public final class GsmMmiCode extends Handler implements MmiCode { onUssdFinishedError() { if (mState == State.PENDING) { mState = State.FAILED; if (mMessage.length() == 0) { if (TextUtils.isEmpty(mMessage)) { mMessage = mContext.getText(com.android.internal.R.string.mmiError); } Rlog.d(LOG_TAG, "onUssdFinishedError"); Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java +4 −6 Original line number Diff line number Diff line Loading @@ -346,8 +346,8 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { return dialString; } static ImsPhoneMmiCode newNetworkInitiatedUssd(String ussdMessage, boolean isUssdRequest, ImsPhone phone) { public static ImsPhoneMmiCode newNetworkInitiatedUssd(String ussdMessage, boolean isUssdRequest, ImsPhone phone) { ImsPhoneMmiCode ret; ret = new ImsPhoneMmiCode(phone); Loading Loading @@ -1194,12 +1194,10 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { * * The radio has reset, and this is still pending */ void onUssdFinishedError() { public void onUssdFinishedError() { if (mState == State.PENDING) { mState = State.FAILED; if (mMessage.length() == 0) { if (TextUtils.isEmpty(mMessage)) { mMessage = mContext.getText(com.android.internal.R.string.mmiError); } Rlog.d(LOG_TAG, "onUssdFinishedError: mmi=" + this); Loading tests/telephonytests/src/com/android/internal/telephony/gsm/GsmMmiCodeTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony.gsm; import static junit.framework.Assert.fail; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; Loading Loading @@ -95,6 +97,16 @@ public class GsmMmiCodeTest extends TelephonyTest { assertTrue(mGsmMmiCode == null); } @Test public void testNoCrashOnEmptyMessage() { GsmMmiCode mmi = GsmMmiCode.newNetworkInitiatedUssd(null, true, mGsmCdmaPhoneUT, null); try { mmi.onUssdFinishedError(); } catch (Exception e) { fail("Shouldn't crash!!!"); } } private void setCarrierSupportsCallerIdVerticalServiceCodesCarrierConfig() { final PersistableBundle bundle = new PersistableBundle(); bundle.putBoolean(CarrierConfigManager Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneMmiCodeTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony.imsphone; import static junit.framework.Assert.fail; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; Loading Loading @@ -101,6 +103,16 @@ public class ImsPhoneMmiCodeTest extends TelephonyTest { assertTrue(mImsPhoneMmiCode == null); } @Test public void testNoCrashOnEmptyMessage() { ImsPhoneMmiCode mmi = ImsPhoneMmiCode.newNetworkInitiatedUssd(null, true, mImsPhoneUT); try { mmi.onUssdFinishedError(); } catch (Exception e) { fail("Shouldn't crash!!!"); } } private void setCarrierSupportsCallerIdVerticalServiceCodesCarrierConfig() { final PersistableBundle bundle = new PersistableBundle(); bundle.putBoolean(CarrierConfigManager Loading Loading
src/java/com/android/internal/telephony/gsm/GsmMmiCode.java +1 −1 Original line number Diff line number Diff line Loading @@ -1228,7 +1228,7 @@ public final class GsmMmiCode extends Handler implements MmiCode { onUssdFinishedError() { if (mState == State.PENDING) { mState = State.FAILED; if (mMessage.length() == 0) { if (TextUtils.isEmpty(mMessage)) { mMessage = mContext.getText(com.android.internal.R.string.mmiError); } Rlog.d(LOG_TAG, "onUssdFinishedError"); Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java +4 −6 Original line number Diff line number Diff line Loading @@ -346,8 +346,8 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { return dialString; } static ImsPhoneMmiCode newNetworkInitiatedUssd(String ussdMessage, boolean isUssdRequest, ImsPhone phone) { public static ImsPhoneMmiCode newNetworkInitiatedUssd(String ussdMessage, boolean isUssdRequest, ImsPhone phone) { ImsPhoneMmiCode ret; ret = new ImsPhoneMmiCode(phone); Loading Loading @@ -1194,12 +1194,10 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { * * The radio has reset, and this is still pending */ void onUssdFinishedError() { public void onUssdFinishedError() { if (mState == State.PENDING) { mState = State.FAILED; if (mMessage.length() == 0) { if (TextUtils.isEmpty(mMessage)) { mMessage = mContext.getText(com.android.internal.R.string.mmiError); } Rlog.d(LOG_TAG, "onUssdFinishedError: mmi=" + this); Loading
tests/telephonytests/src/com/android/internal/telephony/gsm/GsmMmiCodeTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony.gsm; import static junit.framework.Assert.fail; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; Loading Loading @@ -95,6 +97,16 @@ public class GsmMmiCodeTest extends TelephonyTest { assertTrue(mGsmMmiCode == null); } @Test public void testNoCrashOnEmptyMessage() { GsmMmiCode mmi = GsmMmiCode.newNetworkInitiatedUssd(null, true, mGsmCdmaPhoneUT, null); try { mmi.onUssdFinishedError(); } catch (Exception e) { fail("Shouldn't crash!!!"); } } private void setCarrierSupportsCallerIdVerticalServiceCodesCarrierConfig() { final PersistableBundle bundle = new PersistableBundle(); bundle.putBoolean(CarrierConfigManager Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneMmiCodeTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony.imsphone; import static junit.framework.Assert.fail; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doReturn; Loading Loading @@ -101,6 +103,16 @@ public class ImsPhoneMmiCodeTest extends TelephonyTest { assertTrue(mImsPhoneMmiCode == null); } @Test public void testNoCrashOnEmptyMessage() { ImsPhoneMmiCode mmi = ImsPhoneMmiCode.newNetworkInitiatedUssd(null, true, mImsPhoneUT); try { mmi.onUssdFinishedError(); } catch (Exception e) { fail("Shouldn't crash!!!"); } } private void setCarrierSupportsCallerIdVerticalServiceCodesCarrierConfig() { final PersistableBundle bundle = new PersistableBundle(); bundle.putBoolean(CarrierConfigManager Loading