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

Commit 6e3d94b2 authored by Nathan Harold's avatar Nathan Harold
Browse files

Add TimeStamp Constructor for HAL 1.4 Support

Becuase the Timestamp is no longer passed by the
radio, CellInfo objects are stamped when received
by the RIL. Since the structure passed to these
constructors is a HAL structure, we have to pass the
timestamp all the way through to have it supported
for constructors invoked on a 1.4 HAL object.

Bug: 126911026
Test: atest RILTest#testCellInfoTimestamp_1_4;
      atest RILTest#testCellInfoTimestamp_1_2
Change-Id: I2b0833a0a8b6eeb75bff9cbe956ad36656a46208
parent b967dce9
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.annotation.UnsupportedAppUsage;
import android.hardware.radio.V1_4.CellInfo.Info;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;

import com.android.internal.annotations.VisibleForTesting;

@@ -320,9 +319,9 @@ public abstract class CellInfo implements Parcelable {
    }

    /** @hide */
    protected CellInfo(android.hardware.radio.V1_4.CellInfo ci) {
    protected CellInfo(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) {
        this.mRegistered = ci.isRegistered;
        this.mTimeStamp = SystemClock.elapsedRealtimeNanos();
        this.mTimeStamp = timeStamp;
        this.mCellConnectionStatus = ci.connectionStatus;
    }

@@ -353,14 +352,14 @@ public abstract class CellInfo implements Parcelable {
    }

    /** @hide */
    public static CellInfo create(android.hardware.radio.V1_4.CellInfo ci) {
    public static CellInfo create(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) {
        if (ci == null) return null;
        switch (ci.info.getDiscriminator()) {
            case Info.hidl_discriminator.gsm: return new CellInfoGsm(ci);
            case Info.hidl_discriminator.cdma: return new CellInfoCdma(ci);
            case Info.hidl_discriminator.lte: return new CellInfoLte(ci);
            case Info.hidl_discriminator.wcdma: return new CellInfoWcdma(ci);
            case Info.hidl_discriminator.tdscdma: return new CellInfoTdscdma(ci);
            case Info.hidl_discriminator.gsm: return new CellInfoGsm(ci, timeStamp);
            case Info.hidl_discriminator.cdma: return new CellInfoCdma(ci, timeStamp);
            case Info.hidl_discriminator.lte: return new CellInfoLte(ci, timeStamp);
            case Info.hidl_discriminator.wcdma: return new CellInfoWcdma(ci, timeStamp);
            case Info.hidl_discriminator.tdscdma: return new CellInfoTdscdma(ci, timeStamp);
            default: return null;
        }
    }
+2 −2
Original line number Diff line number Diff line
@@ -68,8 +68,8 @@ public final class CellInfoCdma extends CellInfo implements Parcelable {
    }

    /** @hide */
    public CellInfoCdma(android.hardware.radio.V1_4.CellInfo ci) {
        super(ci);
    public CellInfoCdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) {
        super(ci, timeStamp);
        final android.hardware.radio.V1_2.CellInfoCdma cic = ci.info.cdma();
        mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma);
        mCellSignalStrengthCdma =
+2 −2
Original line number Diff line number Diff line
@@ -64,8 +64,8 @@ public final class CellInfoGsm extends CellInfo implements Parcelable {
    }

    /** @hide */
    public CellInfoGsm(android.hardware.radio.V1_4.CellInfo ci) {
        super(ci);
    public CellInfoGsm(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) {
        super(ci, timeStamp);
        final android.hardware.radio.V1_2.CellInfoGsm cig = ci.info.gsm();
        mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm);
        mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm);
+2 −2
Original line number Diff line number Diff line
@@ -71,8 +71,8 @@ public final class CellInfoLte extends CellInfo implements Parcelable {
    }

    /** @hide */
    public CellInfoLte(android.hardware.radio.V1_4.CellInfo ci) {
        super(ci);
    public CellInfoLte(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) {
        super(ci, timeStamp);
        final android.hardware.radio.V1_4.CellInfoLte cil = ci.info.lte();
        mCellIdentityLte = new CellIdentityLte(cil.base.cellIdentityLte);
        mCellSignalStrengthLte = new CellSignalStrengthLte(cil.base.signalStrengthLte);
+2 −2
Original line number Diff line number Diff line
@@ -65,8 +65,8 @@ public final class CellInfoTdscdma extends CellInfo implements Parcelable {
    }

    /** @hide */
    public CellInfoTdscdma(android.hardware.radio.V1_4.CellInfo ci) {
        super(ci);
    public CellInfoTdscdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) {
        super(ci, timeStamp);
        final android.hardware.radio.V1_2.CellInfoTdscdma cit = ci.info.tdscdma();
        mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma);
        mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma);
Loading