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

Commit d083fcc2 authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Catch IAE from Invalid PCC Report by Modem" into sc-dev

parents 683a4206 dc0f5ea5
Loading
Loading
Loading
Loading
+53 −43
Original line number Original line Diff line number Diff line
@@ -49,6 +49,8 @@ import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_RECORDS_RECEIVED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESTRICTED_STATE_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESTRICTED_STATE_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RIL_CONNECTED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RIL_CONNECTED;
@@ -68,8 +70,6 @@ import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UICC_SUBSCRI
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UNTHROTTLE_APN;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UNTHROTTLE_APN;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_VOICE_RADIO_TECH_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_VOICE_RADIO_TECH_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOl_CDMA_PRL_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOl_CDMA_PRL_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_RECORDS_RECEIVED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_CHANGED;


import android.hardware.radio.V1_0.CdmaCallWaiting;
import android.hardware.radio.V1_0.CdmaCallWaiting;
import android.hardware.radio.V1_0.CdmaInformationRecord;
import android.hardware.radio.V1_0.CdmaInformationRecord;
@@ -88,8 +88,8 @@ import android.hardware.radio.V1_0.StkCcUnsolSsResult;
import android.hardware.radio.V1_0.SuppSvcNotification;
import android.hardware.radio.V1_0.SuppSvcNotification;
import android.hardware.radio.V1_2.CellConnectionStatus;
import android.hardware.radio.V1_2.CellConnectionStatus;
import android.hardware.radio.V1_6.IRadioIndication;
import android.hardware.radio.V1_6.IRadioIndication;
import android.hardware.radio.V1_6.PhysicalChannelConfig.Band;
import android.hardware.radio.V1_6.PhonebookRecordInfo;
import android.hardware.radio.V1_6.PhonebookRecordInfo;
import android.hardware.radio.V1_6.PhysicalChannelConfig.Band;
import android.os.AsyncResult;
import android.os.AsyncResult;
import android.os.RemoteException;
import android.os.RemoteException;
import android.sysprop.TelephonyProperties;
import android.sysprop.TelephonyProperties;
@@ -116,9 +116,9 @@ import com.android.internal.telephony.cdma.SmsMessageConverter;
import com.android.internal.telephony.dataconnection.KeepaliveStatus;
import com.android.internal.telephony.dataconnection.KeepaliveStatus;
import com.android.internal.telephony.gsm.SsData;
import com.android.internal.telephony.gsm.SsData;
import com.android.internal.telephony.gsm.SuppServiceNotification;
import com.android.internal.telephony.gsm.SuppServiceNotification;
import com.android.internal.telephony.uicc.ReceivedPhonebookRecords;
import com.android.internal.telephony.uicc.IccRefreshResponse;
import com.android.internal.telephony.uicc.IccRefreshResponse;
import com.android.internal.telephony.uicc.IccUtils;
import com.android.internal.telephony.uicc.IccUtils;
import com.android.internal.telephony.uicc.ReceivedPhonebookRecords;
import com.android.internal.telephony.uicc.SimPhonebookRecord;
import com.android.internal.telephony.uicc.SimPhonebookRecord;


import java.util.ArrayList;
import java.util.ArrayList;
@@ -1275,6 +1275,7 @@ public class RadioIndication extends IRadioIndication.Stub {


    private void physicalChannelConfigsIndication(List<? extends Object> configs) {
    private void physicalChannelConfigsIndication(List<? extends Object> configs) {
        List<PhysicalChannelConfig> response = new ArrayList<>(configs.size());
        List<PhysicalChannelConfig> response = new ArrayList<>(configs.size());
        try {
            for (Object obj : configs) {
            for (Object obj : configs) {
                if (obj instanceof android.hardware.radio.V1_2.PhysicalChannelConfig) {
                if (obj instanceof android.hardware.radio.V1_2.PhysicalChannelConfig) {
                    android.hardware.radio.V1_2.PhysicalChannelConfig config =
                    android.hardware.radio.V1_2.PhysicalChannelConfig config =
@@ -1293,7 +1294,8 @@ public class RadioIndication extends IRadioIndication.Stub {
                    response.add(builder.setCellConnectionStatus(
                    response.add(builder.setCellConnectionStatus(
                            convertConnectionStatusFromCellConnectionStatus(config.base.status))
                            convertConnectionStatusFromCellConnectionStatus(config.base.status))
                            .setCellBandwidthDownlinkKhz(config.base.cellBandwidthDownlink)
                            .setCellBandwidthDownlinkKhz(config.base.cellBandwidthDownlink)
                        .setNetworkType(ServiceState.rilRadioTechnologyToNetworkType(config.rat))
                            .setNetworkType(
                                    ServiceState.rilRadioTechnologyToNetworkType(config.rat))
                            .setPhysicalCellId(config.physicalCellId)
                            .setPhysicalCellId(config.physicalCellId)
                            .setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray())
                            .setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray())
                            .build());
                            .build());
@@ -1308,7 +1310,8 @@ public class RadioIndication extends IRadioIndication.Stub {
                            .setUplinkChannelNumber(config.uplinkChannelNumber)
                            .setUplinkChannelNumber(config.uplinkChannelNumber)
                            .setCellBandwidthDownlinkKhz(config.cellBandwidthDownlinkKhz)
                            .setCellBandwidthDownlinkKhz(config.cellBandwidthDownlinkKhz)
                            .setCellBandwidthUplinkKhz(config.cellBandwidthUplinkKhz)
                            .setCellBandwidthUplinkKhz(config.cellBandwidthUplinkKhz)
                        .setNetworkType(ServiceState.rilRadioTechnologyToNetworkType(config.rat))
                            .setNetworkType(
                                    ServiceState.rilRadioTechnologyToNetworkType(config.rat))
                            .setPhysicalCellId(config.physicalCellId)
                            .setPhysicalCellId(config.physicalCellId)
                            .setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray())
                            .setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray())
                            .build());
                            .build());
@@ -1316,6 +1319,13 @@ public class RadioIndication extends IRadioIndication.Stub {
                    mRil.riljLoge("Unsupported PhysicalChannelConfig " + obj);
                    mRil.riljLoge("Unsupported PhysicalChannelConfig " + obj);
                }
                }
            }
            }
        } catch (IllegalArgumentException iae) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("918f0970-9aa9-4bcd-a28e-e49a83fe77d5"),
                    "Invalid PhysicalChannelConfig reported by HAL");
            mRil.riljLoge("Invalid PhysicalChannelConfig " + iae);
            return;
        }


        if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG, response);
        if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG, response);