Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97e5eb0b authored by Youming Ye's avatar Youming Ye Committed by Android (Google) Code Review
Browse files

Merge "Fix the Mmi code cast exception" into qt-dev

parents afa38d35 3b30de8b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.uicc.IccRecords;

import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -1550,8 +1551,14 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode {
                sb.append(getErrorMessage(ar));
            }
        } else {
            List<ImsSsInfo> infos = (List<ImsSsInfo>) ar.result;
            if (infos.size() == 0) {
            List<ImsSsInfo> infos = null;
            try {
                infos = (List<ImsSsInfo>) ar.result;
            } catch (ClassCastException cce) {
                // TODO in R: #157# still has ImsSsInfo[] type, fix the type in IImsUtListener.aidl.
                infos = Arrays.asList((ImsSsInfo[]) ar.result);
            }
            if (infos == null || infos.size() == 0) {
                sb.append(mContext.getText(com.android.internal.R.string.serviceDisabled));
            } else {
                ImsSsInfo info;