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

Commit 6c646af6 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Disable more CDMA related code

Bug: 379356026
Test: m
Flag: com.android.internal.telephony.flags.cleanup_cdma
Change-Id: Ide8bf7398fdf3f06a28f3fe07a9f14cdb5f2900d
parent 09429c7d
Loading
Loading
Loading
Loading
+50 −20
Original line number Diff line number Diff line
@@ -105,7 +105,16 @@ public final class CellIdentityCdma extends CellIdentity {
     */
    public CellIdentityCdma(int nid, int sid, int bid, int lon, int lat,
            @Nullable String alphal, @Nullable String alphas) {
        super(TAG, CellInfo.TYPE_CDMA, null, null, alphal, alphas);
        super(TAG, CellInfo.TYPE_CDMA, null, null, Flags.cleanupCdma() ? null : alphal,
                Flags.cleanupCdma() ? null : alphas);
        if (Flags.cleanupCdma()) {
            mNetworkId = CellInfo.UNAVAILABLE;
            mSystemId = CellInfo.UNAVAILABLE;
            mBasestationId = CellInfo.UNAVAILABLE;
            mLongitude = CellInfo.UNAVAILABLE;
            mLatitude = CellInfo.UNAVAILABLE;
            mGlobalCellId = null;
        } else {
            mNetworkId = inRangeOrUnavailable(nid, 0, NETWORK_ID_MAX);
            mSystemId = inRangeOrUnavailable(sid, 0, SYSTEM_ID_MAX);
            mBasestationId = inRangeOrUnavailable(bid, 0, BASESTATION_ID_MAX);
@@ -120,6 +129,7 @@ public final class CellIdentityCdma extends CellIdentity {
            }
            updateGlobalCellId();
        }
    }

    private CellIdentityCdma(@NonNull CellIdentityCdma cid) {
        this(cid.mNetworkId, cid.mSystemId, cid.mBasestationId, cid.mLongitude, cid.mLatitude,
@@ -300,6 +310,25 @@ public final class CellIdentityCdma extends CellIdentity {
    /** Construct from Parcel, type has already been processed */
    private CellIdentityCdma(Parcel in) {
        super(TAG, CellInfo.TYPE_CDMA, in);

        if (Flags.cleanupCdma()) {
            in.readInt();
            mNetworkId = CellInfo.UNAVAILABLE;

            in.readInt();
            mSystemId = CellInfo.UNAVAILABLE;

            in.readInt();
            mBasestationId = CellInfo.UNAVAILABLE;

            in.readInt();
            mLongitude = CellInfo.UNAVAILABLE;

            in.readInt();
            mLatitude = CellInfo.UNAVAILABLE;

            mGlobalCellId = null;
        } else {
            mNetworkId = in.readInt();
            mSystemId = in.readInt();
            mBasestationId = in.readInt();
@@ -309,6 +338,7 @@ public final class CellIdentityCdma extends CellIdentity {
            updateGlobalCellId();
            if (DBG) log(toString());
        }
    }

    /**
     * Implement the Parcelable interface
+22 −7
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;

import com.android.internal.telephony.flags.Flags;
import com.android.telephony.Rlog;

import java.util.Objects;
@@ -68,6 +69,9 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
     */
    public CellSignalStrengthCdma(int cdmaDbm, int cdmaEcio, int evdoDbm, int evdoEcio,
            int evdoSnr) {
        if (Flags.cleanupCdma()) {
            setDefaultValues();
        } else {
            mCdmaDbm = inRangeOrUnavailable(cdmaDbm, -120, 0);
            mCdmaEcio = inRangeOrUnavailable(cdmaEcio, -160, 0);
            mEvdoDbm = inRangeOrUnavailable(evdoDbm, -120, 0);
@@ -76,6 +80,7 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements

            updateLevel(null, null);
        }
    }

    /** @hide */
    public CellSignalStrengthCdma(CellSignalStrengthCdma s) {
@@ -84,6 +89,10 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements

    /** @hide */
    protected void copyFrom(CellSignalStrengthCdma s) {
        if (Flags.cleanupCdma()) {
            setDefaultValues();
            return;
        }
        mCdmaDbm = s.mCdmaDbm;
        mCdmaEcio = s.mCdmaEcio;
        mEvdoDbm = s.mEvdoDbm;
@@ -389,6 +398,7 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
    /** @hide */
    @Override
    public boolean isValid() {
        if (Flags.cleanupCdma()) return false;
        return !this.equals(sInvalid);
    }

@@ -446,8 +456,13 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements
        mEvdoEcio = in.readInt();
        mEvdoSnr = in.readInt();
        mLevel = in.readInt();

        if (Flags.cleanupCdma()) {
            setDefaultValues();
        } else {
            if (DBG) log("CellSignalStrengthCdma(Parcel): " + toString());
        }
    }

    /** Implement the Parcelable interface */
    @Override