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

Commit a2b25c93 authored by Nathan Harold's avatar Nathan Harold Committed by Gerrit Code Review
Browse files

Merge changes If37bd0b7,I9cbdd477

* changes:
  Fix LTE_CA bit to be enabled for < 1.5
  NPE Check for invalid regFailed or barringInfo ind
parents 1512a912 0b6dd83d
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -355,14 +355,8 @@ public class CellularNetworkService extends NetworkService {
            List<Integer> availableServices = getAvailableServices(
                    regState, domain, emergencyOnly);

            // In earlier versions of the HAL, LTE_CA was allowed to indicate that the device
            // is on CA; however, that has been superseded by the PHYSICAL_CHANNEL_CONFIG signal.
            // Because some vendors provide both NETWORK_TYPE_LTE_CA *and* PHYSICAL_CHANNEL_CONFIG,
            // this tweak is left for compatibility; however, the network type is no longer allowed
            // to be used to declare that carrier aggregation is in effect, because the other
            // signal provides a much richer information set, and we want to mitigate confusion in
            // how CA information is being provided.
            if (networkType == TelephonyManager.NETWORK_TYPE_LTE_CA) {
                isUsingCarrierAggregation = true;
                networkType = TelephonyManager.NETWORK_TYPE_LTE;
            }

@@ -388,9 +382,14 @@ public class CellularNetworkService extends NetworkService {

            // Network Type fixup for carrier aggregation
            int networkType = ServiceState.rilRadioTechnologyToNetworkType(regResult.rat);
            boolean isUsingCarrierAggregation = false;
            // In earlier versions of the HAL, LTE_CA was allowed to indicate that the device
            // is on CA; however, that has been superseded by the PHYSICAL_CHANNEL_CONFIG signal.
            // Because some vendors provide both NETWORK_TYPE_LTE_CA *and* PHYSICAL_CHANNEL_CONFIG,
            // this tweak is left for compatibility; however, the network type is no longer allowed
            // to be used to declare that carrier aggregation is in effect, because the other
            // signal provides a much richer information set, and we want to mitigate confusion in
            // how CA information is being provided.
            if (networkType == TelephonyManager.NETWORK_TYPE_LTE_CA) {
                isUsingCarrierAggregation = true;
                networkType = TelephonyManager.NETWORK_TYPE_LTE;
            }

@@ -449,7 +448,7 @@ public class CellularNetworkService extends NetworkService {
                    return new NetworkRegistrationInfo(domain, transportType, regState, networkType,
                            reasonForDenial, isEmergencyOnly, availableServices, cellIdentity,
                            rplmn, MAX_DATA_CALLS, isDcNrRestricted, isNrAvailable, isEndcAvailable,
                            vopsInfo, isUsingCarrierAggregation);
                            vopsInfo, false /* isUsingCarrierAggregation */);
            }
        }

+26 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ import android.hardware.radio.V1_5.IRadioIndication;
import android.os.AsyncResult;
import android.sysprop.TelephonyProperties;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.AnomalyReporter;
import android.telephony.BarringInfo;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
@@ -100,6 +101,7 @@ import android.telephony.SmsMessage;
import android.telephony.TelephonyManager;
import android.telephony.data.DataCallResponse;
import android.telephony.emergency.EmergencyNumber;
import android.text.TextUtils;

import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
import com.android.internal.telephony.cdma.CdmaInformationRecords;
@@ -112,6 +114,7 @@ import com.android.internal.telephony.uicc.IccUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class RadioIndication extends IRadioIndication.Stub {
    RIL mRil;
@@ -1007,6 +1010,20 @@ public class RadioIndication extends IRadioIndication.Stub {
            int causeCode, int additionalCauseCode) {
        mRil.processIndication(indicationType);

        if (cellIdentity == null
                || TextUtils.isEmpty(chosenPlmn)
                || (domain & NetworkRegistrationInfo.DOMAIN_CS_PS) == 0
                || (domain & ~NetworkRegistrationInfo.DOMAIN_CS_PS) != 0
                || causeCode < 0 || additionalCauseCode < 0
                || (causeCode == Integer.MAX_VALUE && additionalCauseCode == Integer.MAX_VALUE)) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("f16e5703-6105-4341-9eb3-e68189156eb4"),
                            "Invalid registrationFailed indication");

            mRil.riljLoge("Invalid registrationFailed indication");
            return;
        }

        CellIdentity ci = CellIdentity.create(cellIdentity);

        mRil.mRegistrationFailedRegistrant.notifyRegistrant(
@@ -1029,6 +1046,15 @@ public class RadioIndication extends IRadioIndication.Stub {
            ArrayList<android.hardware.radio.V1_5.BarringInfo> barringInfos) {
        mRil.processIndication(indicationType);

        if (cellIdentity == null || barringInfos == null) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("645b16bb-c930-4c1c-9c5d-568696542e05"),
                            "Invalid barringInfoChanged indication");

            mRil.riljLoge("Invalid barringInfoChanged indication");
            return;
        }

        CellIdentity ci = CellIdentity.create(cellIdentity);
        BarringInfo cbi = BarringInfo.create(cellIdentity, barringInfos);