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

Commit 587cce5b authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by Automerger Merge Worker
Browse files

Merge changes from topic "LCE_ENDC" am: d046f19c

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1497041

Change-Id: Iefd33a93b349150e4e584420a20807db37f65a55
parents 2a37cf7d d046f19c
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.telephony.AccessNetworkConstants;
import android.telephony.BarringInfo;
import android.telephony.CarrierBandwidth;
import android.telephony.CarrierConfigManager;
import android.telephony.CellIdentity;
import android.telephony.ImsiEncryptionInfo;
@@ -244,6 +245,7 @@ public class GsmCdmaPhone extends Phone {
    private CarrierInfoManager mCIM;

    private final SettingsObserver mSettingsObserver;
    private CarrierBandwidth mCarrierBandwidth = new CarrierBandwidth();

    // Constructors

@@ -389,6 +391,7 @@ public class GsmCdmaPhone extends Phone {

        mCi.registerForRilConnected(this, EVENT_RIL_CONNECTED, null);
        mCi.registerForVoiceRadioTechChanged(this, EVENT_VOICE_RADIO_TECH_CHANGED, null);
        mCi.registerForLceInfo(this, EVENT_LINK_CAPACITY_CHANGED, null);
        IntentFilter filter = new IntentFilter(
                CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        filter.addAction(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED);
@@ -513,6 +516,37 @@ public class GsmCdmaPhone extends Phone {
        }
    }

    /**
     * get carrier bandwidth per primary and secondary carrier
     * @return CarrierBandwidth with bandwidth of both primary and secondary carrier.
     */
    public CarrierBandwidth getCarrierBandwidth() {
        return mCarrierBandwidth;
    }

    private void updateCarrierBandwidths(LinkCapacityEstimate lce) {
        if (DBG) logd("updateCarrierBandwidths: lce=" + lce);
        if (lce == null) {
            mCarrierBandwidth = new CarrierBandwidth();
            return;
        }
        int primaryDownlinkCapacityKbps = lce.downlinkCapacityKbps;
        int primaryUplinkCapacityKbps = lce.uplinkCapacityKbps;
        if (primaryDownlinkCapacityKbps != CarrierBandwidth.INVALID
                && lce.secondaryDownlinkCapacityKbps != CarrierBandwidth.INVALID) {
            primaryDownlinkCapacityKbps =
                    lce.downlinkCapacityKbps - lce.secondaryDownlinkCapacityKbps;
        }
        if (primaryUplinkCapacityKbps != CarrierBandwidth.INVALID
                && lce.secondaryUplinkCapacityKbps != CarrierBandwidth.INVALID) {
            primaryUplinkCapacityKbps =
                    lce.uplinkCapacityKbps - lce.secondaryUplinkCapacityKbps;
        }
        mCarrierBandwidth = new CarrierBandwidth(primaryDownlinkCapacityKbps,
                primaryUplinkCapacityKbps, lce.secondaryDownlinkCapacityKbps,
                lce.secondaryUplinkCapacityKbps);
    }

    @Override
    protected void finalize() {
        if(DBG) logd("GsmCdmaPhone finalized");
@@ -2781,6 +2815,15 @@ public class GsmCdmaPhone extends Phone {
                }
                break;

            case EVENT_LINK_CAPACITY_CHANGED:
                ar = (AsyncResult) msg.obj;
                if (ar.exception == null && ar.result != null) {
                    updateCarrierBandwidths((LinkCapacityEstimate) ar.result);
                } else {
                    logd("Unexpected exception on EVENT_LINK_CAPACITY_CHANGED");
                }
                break;

            case EVENT_UPDATE_PHONE_OBJECT:
                phoneObjectUpdater(msg.arg1);
                break;
+29 −2
Original line number Diff line number Diff line
@@ -29,12 +29,20 @@ public class LinkCapacityEstimate {
    /** LCE is suspended; Deprecated in HAL 1.2 */
    public static final int STATUS_SUSPENDED = 1;

    /** Downlink radio link capacity in kbps */
    /** Downlink radio link capacity in kbps. In case of a dual connected network,
     * this includes capacity of both primary and secondary */
    public final int downlinkCapacityKbps;

    /** Uplink radio link capacity; added in HAL 1.2 */
    /** Uplink radio link capacity; added in HAL 1.2. In case of a dual connected network,
     * this includes capacity of both primary and secondary */
    public final int uplinkCapacityKbps;

    /** Downlink radio link capacity of secondary network in kbps */
    public final int secondaryDownlinkCapacityKbps;

    /** Uplink radio link capacity of secondary network in kbps */
    public final int secondaryUplinkCapacityKbps;

    /** Confidence of the downlink estimate as a percentage [1, 100]; deprecated in HAL 1.2 */
    public final int confidence;

@@ -47,6 +55,8 @@ public class LinkCapacityEstimate {
        this.confidence = confidence;
        this.status = status;
        this.uplinkCapacityKbps = INVALID;
        this.secondaryDownlinkCapacityKbps = INVALID;
        this.secondaryUplinkCapacityKbps = INVALID;
    }

    /** Constructor matching the estimate in Radio HAL v1.2 */
@@ -55,6 +65,19 @@ public class LinkCapacityEstimate {
        this.uplinkCapacityKbps = uplinkCapacityKbps;
        this.confidence = INVALID;
        this.status = INVALID;
        this.secondaryDownlinkCapacityKbps = INVALID;
        this.secondaryUplinkCapacityKbps = INVALID;
    }

    /** Constructor matching the estimate in Radio HAL v1.6 */
    public LinkCapacityEstimate(int downlinkCapacityKbps, int uplinkCapacityKbps,
            int secondaryDownlinkCapacityKbps, int secondaryUplinkCapacityKbps) {
        this.downlinkCapacityKbps = downlinkCapacityKbps;
        this.uplinkCapacityKbps = uplinkCapacityKbps;
        this.confidence = INVALID;
        this.status = INVALID;
        this.secondaryDownlinkCapacityKbps = secondaryDownlinkCapacityKbps;
        this.secondaryUplinkCapacityKbps = secondaryUplinkCapacityKbps;
    }

    @Override
@@ -68,6 +91,10 @@ public class LinkCapacityEstimate {
                .append(confidence)
                .append(", status=")
                .append(status)
                .append("{secondaryDownlinkCapacityKbps=")
                .append(secondaryDownlinkCapacityKbps)
                .append(", secondaryUplinkCapacityKbps=")
                .append(secondaryUplinkCapacityKbps)
                .toString();
    }
}
+11 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.sysprop.TelephonyProperties;
import android.telecom.VideoProfile;
import android.telephony.AccessNetworkConstants;
import android.telephony.Annotation.ApnType;
import android.telephony.CarrierBandwidth;
import android.telephony.CarrierConfigManager;
import android.telephony.CarrierRestrictionRules;
import android.telephony.CellIdentity;
@@ -214,8 +215,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    protected static final int EVENT_REAPPLY_UICC_APPS_ENABLEMENT_DONE    = 56;
    protected static final int EVENT_REGISTRATION_FAILED = 57;
    protected static final int EVENT_BARRING_INFO_CHANGED = 58;
    protected static final int EVENT_LINK_CAPACITY_CHANGED = 59;

    protected static final int EVENT_LAST = EVENT_BARRING_INFO_CHANGED;
    protected static final int EVENT_LAST = EVENT_LINK_CAPACITY_CHANGED;

    // For shared prefs.
    private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_";
@@ -2198,6 +2200,14 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mCi.isNrDualConnectivityEnabled(message, workSource);
    }

    /**
     * get carrier bandwidth per primary and secondary carrier
     * @return CarrierBandwidth with bandwidth of both primary and secondary carrier.
     */
    public CarrierBandwidth getCarrierBandwidth() {
        return new CarrierBandwidth();
    }

    /**
     * Enable/Disable E-UTRA-NR Dual Connectivity
     * @param nrDualConnectivityState expected NR dual connectivity state
+11 −0
Original line number Diff line number Diff line
@@ -6857,6 +6857,17 @@ public class RIL extends BaseCommands implements CommandsInterface {
        return lce;
    }

    static LinkCapacityEstimate convertHalLceData(
            android.hardware.radio.V1_6.LinkCapacityEstimate halData, RIL ril) {
        final LinkCapacityEstimate lce = new LinkCapacityEstimate(
                halData.downlinkCapacityKbps,
                halData.uplinkCapacityKbps,
                halData.secondaryDownlinkCapacityKbps,
                halData.secondaryUplinkCapacityKbps);
        ril.riljLog("LCE capacity information received:" + lce);
        return lce;
    }

    /**
     * Convert CellInfo defined in 1.0/types.hal to CellInfo type.
     * @param records List of CellInfo defined in 1.0/types.hal
+27 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ import android.hardware.radio.V1_0.SsInfoData;
import android.hardware.radio.V1_0.StkCcUnsolSsResult;
import android.hardware.radio.V1_0.SuppSvcNotification;
import android.hardware.radio.V1_2.CellConnectionStatus;
import android.hardware.radio.V1_5.IRadioIndication;
import android.hardware.radio.V1_6.IRadioIndication;
import android.os.AsyncResult;
import android.sysprop.TelephonyProperties;
import android.telephony.Annotation.RadioPowerState;
@@ -263,6 +263,22 @@ public class RadioIndication extends IRadioIndication.Stub {
        }
    }

    /**
     * Indicates current link capacity estimate.
     */
    public void currentLinkCapacityEstimate_1_6(int indicationType,
            android.hardware.radio.V1_6.LinkCapacityEstimate lce) {
        mRil.processIndication(indicationType);

        LinkCapacityEstimate response = RIL.convertHalLceData(lce, mRil);

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

        if (mRil.mLceInfoRegistrants != null) {
            mRil.mLceInfoRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
        }
    }

    /**
     * Indicates the current signal strength of the camped or primary serving cell.
     */
@@ -359,6 +375,16 @@ public class RadioIndication extends IRadioIndication.Stub {
        responseDataCallListChanged(indicationType, dcList);
    }

    /** Indicates current data call list with radio HAL 1.6. */
    public void dataCallListChanged_1_6(int indicationType,
            ArrayList<android.hardware.radio.V1_6.SetupDataCallResult> dcList) {
        responseDataCallListChanged(indicationType, dcList);
    }

    /**  unthrottleApn */
    public void unthrottleApn(int indicationType, String apn) {
    }

    public void suppSvcNotify(int indicationType, SuppSvcNotification suppSvcNotification) {
        mRil.processIndication(indicationType);

Loading