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

Commit ef72a876 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix the Mmi code cast exception"

parents 2e334ca0 1c1d3cd5
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;