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

Commit 186c297b authored by fenglu's avatar fenglu
Browse files

LCE feature enhancement

start LCE service when radio state changes from unavailable to available.
cherry pick from mwd to mnc-dev
capacityDownBps --> capacityDownKbps name nit fix

Bug: 21307951
Change-Id: I0a966440bbddff87417cbea12f46583657e0b1e7
parent 27b15ba4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2053,4 +2053,9 @@ public interface Phone {
     * @return {@code true} if video call is present, false otherwise.
     */
    public boolean isVideoCallPresent();

    /**
     * Returns the status of Link Capacity Estimation (LCE) service.
     */
    public int getLceStatus();
}
+12 −0
Original line number Diff line number Diff line
@@ -2365,10 +2365,22 @@ public abstract class PhoneBase extends Handler implements Phone {
        return false;
    }

    @Override
    public int getLceStatus() {
        return mLceStatus;
    }

    /**
     * Starts LCE service after radio becomes available.
     * LCE service state may get destroyed on the modem when radio becomes unavailable.
     */
    public void startLceAfterRadioIsAvailable() {
        if (mIsTheCurrentActivePhone) {
            mCi.startLceService(DEFAULT_REPORT_INTERVAL_MS, LCE_PULL_MODE,
                obtainMessage(EVENT_CONFIG_LCE));
        }
    }

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("PhoneBase: subId=" + getSubId());
        pw.println(" mPhoneId=" + mPhoneId);
+8 −0
Original line number Diff line number Diff line
@@ -1555,6 +1555,14 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.isVideoEnabled();
    }

    /**
     * Returns the status of Link Capacity Estimation (LCE) service.
     */
    @Override
    public int getLceStatus() {
        return mActivePhone.getLceStatus();
    }

    /**
     * @return true if we are in the emergency call back mode. This is a period where
     * the phone should be using as little power as possible and be ready to receive an
+3 −3
Original line number Diff line number Diff line
@@ -3982,16 +3982,16 @@ public final class RIL extends BaseCommands implements CommandsInterface {

    private Object responseLceData(Parcel p) {
        final ArrayList<Integer> capacityResponse = new ArrayList<Integer>();
        final int capacityDownBps = p.readInt();
        final int capacityDownKbps = p.readInt();
        final int confidenceLevel = p.readByte();
        final int lceSuspended = p.readByte();

        riljLog("LCE capacity information received:" +
                " capacity=" + capacityDownBps +
                " capacity=" + capacityDownKbps +
                " confidence=" + confidenceLevel +
                " lceSuspended=" + lceSuspended);

        capacityResponse.add(capacityDownBps);
        capacityResponse.add(capacityDownKbps);
        capacityResponse.add(confidenceLevel);
        capacityResponse.add(lceSuspended);
        return capacityResponse;
+1 −0
Original line number Diff line number Diff line
@@ -1205,6 +1205,7 @@ public class CDMAPhone extends PhoneBase {

                mCi.getDeviceIdentity(obtainMessage(EVENT_GET_DEVICE_IDENTITY_DONE));
                mCi.getRadioCapability(obtainMessage(EVENT_GET_RADIO_CAPABILITY));
                startLceAfterRadioIsAvailable();
            }
            break;

Loading