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

Commit 7b3f7a44 authored by Nathan Harold's avatar Nathan Harold
Browse files

Access Identity and SignalStrength from CellInfo

Accessing common CellIdentity and CellSignalStrength
information should not require RTTI. Thus, add
overloaded methods that allow the access the common
versions of these functions from a top level CellInfo.

Bug: 10151416
Test: compilation

Change-Id: I18f31c5cec075dcd68cc493e24c2d551138dd73c
parent 5cb7cd68
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.telephony;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;

@@ -124,6 +125,14 @@ public abstract class CellInfo implements Parcelable {
        mTimeStamp = timeStamp;
    }

    /** @hide */
    @NonNull
    public abstract CellIdentity getCellIdentity();

    /** @hide */
    @NonNull
    public abstract CellSignalStrength getCellSignalStrength();

    /**
     * Gets the connection status of this cell.
     *
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public final class CellInfoCdma extends CellInfo implements Parcelable {
        this.mCellSignalStrengthCdma = ci.mCellSignalStrengthCdma.copy();
    }

    @Override
    public CellIdentityCdma getCellIdentity() {
        return mCellIdentityCdma;
    }
@@ -53,6 +54,7 @@ public final class CellInfoCdma extends CellInfo implements Parcelable {
        mCellIdentityCdma = cid;
    }

    @Override
    public CellSignalStrengthCdma getCellSignalStrength() {
        return mCellSignalStrengthCdma;
    }
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public final class CellInfoGsm extends CellInfo implements Parcelable {
        this.mCellSignalStrengthGsm = ci.mCellSignalStrengthGsm.copy();
    }

    @Override
    public CellIdentityGsm getCellIdentity() {
        return mCellIdentityGsm;
    }
@@ -53,6 +54,7 @@ public final class CellInfoGsm extends CellInfo implements Parcelable {
        mCellIdentityGsm = cid;
    }

    @Override
    public CellSignalStrengthGsm getCellSignalStrength() {
        return mCellSignalStrengthGsm;
    }
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public final class CellInfoLte extends CellInfo implements Parcelable {
        this.mCellSignalStrengthLte = ci.mCellSignalStrengthLte.copy();
    }

    @Override
    public CellIdentityLte getCellIdentity() {
        if (DBG) log("getCellIdentity: " + mCellIdentityLte);
        return mCellIdentityLte;
@@ -55,6 +56,7 @@ public final class CellInfoLte extends CellInfo implements Parcelable {
        mCellIdentityLte = cid;
    }

    @Override
    public CellSignalStrengthLte getCellSignalStrength() {
        if (DBG) log("getCellSignalStrength: " + mCellSignalStrengthLte);
        return mCellSignalStrengthLte;
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public final class CellInfoTdscdma extends CellInfo implements Parcelable {
        this.mCellSignalStrengthTdscdma = ci.mCellSignalStrengthTdscdma.copy();
    }

    @Override
    public CellIdentityTdscdma getCellIdentity() {
        return mCellIdentityTdscdma;
    }
@@ -56,6 +57,7 @@ public final class CellInfoTdscdma extends CellInfo implements Parcelable {
        mCellIdentityTdscdma = cid;
    }

    @Override
    public CellSignalStrengthTdscdma getCellSignalStrength() {
        return mCellSignalStrengthTdscdma;
    }
Loading