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

Commit 47872bf7 authored by Nathan Harold's avatar Nathan Harold Committed by android-build-merger
Browse files

Merge "Refactor CellInfo Constructors" am: bd9da6de

am: 1d2825ce

Change-Id: I98f792d178813cc93c0123ba73486d3d18a4874f
parents da2cdd35 1d2825ce
Loading
Loading
Loading
Loading
+13 −20
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.telephony;

import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.telephony.cdma.CdmaCellLocation;

@@ -62,23 +61,6 @@ public final class CellIdentityCdma extends CellIdentity {
        mLatitude = CellInfo.UNAVAILABLE;
    }

    /**
     * public constructor
     * @param nid Network Id 0..65535
     * @param sid CDMA System Id 0..32767
     * @param bid Base Station Id 0..65535
     * @param lon Longitude is a decimal number ranges from -2592000
     *        to 2592000
     * @param lat Latitude is a decimal number ranges from -1296000
     *        to 1296000
     *
     * @hide
     */
    @UnsupportedAppUsage
    public CellIdentityCdma(int nid, int sid, int bid, int lon, int lat) {
        this(nid, sid, bid, lon, lat, null, null);
    }

    /**
     * public constructor
     * @param nid Network Id 0..65535
@@ -93,8 +75,8 @@ public final class CellIdentityCdma extends CellIdentity {
     *
     * @hide
     */
    public CellIdentityCdma(int nid, int sid, int bid, int lon, int lat, String alphal,
                             String alphas) {
    public CellIdentityCdma(
            int nid, int sid, int bid, int lon, int lat, String alphal, String alphas) {
        super(TAG, CellInfo.TYPE_CDMA, null, null, alphal, alphas);
        mNetworkId = nid;
        mSystemId = sid;
@@ -107,6 +89,17 @@ public final class CellIdentityCdma extends CellIdentity {
        }
    }

    /** @hide */
    public CellIdentityCdma(android.hardware.radio.V1_0.CellIdentityCdma cid) {
        this(cid.networkId, cid.systemId, cid.baseStationId, cid.longitude, cid.latitude, "", "");
    }

    /** @hide */
    public CellIdentityCdma(android.hardware.radio.V1_2.CellIdentityCdma cid) {
        this(cid.base.networkId, cid.base.systemId, cid.base.baseStationId, cid.base.longitude,
                cid.base.latitude, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort);
    }

    private CellIdentityCdma(CellIdentityCdma cid) {
        this(cid.mNetworkId, cid.mSystemId, cid.mBasestationId, cid.mLongitude, cid.mLatitude,
                cid.mAlphaLong, cid.mAlphaShort);
+14 −33
Original line number Diff line number Diff line
@@ -36,10 +36,8 @@ public final class CellIdentityGsm extends CellIdentity {
    // 16-bit GSM Cell Identity described in TS 27.007, 0..65535
    private final int mCid;
    // 16-bit GSM Absolute RF Channel Number
    @UnsupportedAppUsage
    private final int mArfcn;
    // 6-bit Base Station Identity Code
    @UnsupportedAppUsage
    private final int mBsic;

    /**
@@ -53,34 +51,6 @@ public final class CellIdentityGsm extends CellIdentity {
        mArfcn = CellInfo.UNAVAILABLE;
        mBsic = CellInfo.UNAVAILABLE;
    }
    /**
     * public constructor
     * @param mcc 3-digit Mobile Country Code, 0..999
     * @param mnc 2 or 3-digit Mobile Network Code, 0..999
     * @param lac 16-bit Location Area Code, 0..65535
     * @param cid 16-bit GSM Cell Identity or 28-bit UMTS Cell Identity
     *
     * @hide
     */
    public CellIdentityGsm(int mcc, int mnc, int lac, int cid) {
        this(lac, cid, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
                String.valueOf(mcc), String.valueOf(mnc), null, null);
    }

    /**
     * public constructor
     * @param mcc 3-digit Mobile Country Code, 0..999
     * @param mnc 2 or 3-digit Mobile Network Code, 0..999
     * @param lac 16-bit Location Area Code, 0..65535
     * @param cid 16-bit GSM Cell Identity or 28-bit UMTS Cell Identity
     * @param arfcn 16-bit GSM Absolute RF Channel Number
     * @param bsic 6-bit Base Station Identity Code
     *
     * @hide
     */
    public CellIdentityGsm(int mcc, int mnc, int lac, int cid, int arfcn, int bsic) {
        this(lac, cid, arfcn, bsic, String.valueOf(mcc), String.valueOf(mnc), null, null);
    }

    /**
     * public constructor
@@ -101,9 +71,20 @@ public final class CellIdentityGsm extends CellIdentity {
        mLac = lac;
        mCid = cid;
        mArfcn = arfcn;
        // In RIL BSIC is a UINT8, so 0xFF is the 'INVALID' designator
        // for inbound parcels
        mBsic = (bsic == 0xFF) ? CellInfo.UNAVAILABLE : bsic;
        mBsic = bsic;
    }

    /** @hide */
    public CellIdentityGsm(android.hardware.radio.V1_0.CellIdentityGsm cid) {
        this(cid.lac, cid.cid, cid.arfcn,
                cid.bsic == 0xFF ? CellInfo.UNAVAILABLE : cid.bsic, cid.mcc, cid.mnc, "", "");
    }

    /** @hide */
    public CellIdentityGsm(android.hardware.radio.V1_2.CellIdentityGsm cid) {
        this(cid.base.lac, cid.base.cid, cid.base.arfcn,
                cid.base.bsic == 0xFF ? CellInfo.UNAVAILABLE : cid.base.bsic, cid.base.mcc,
                cid.base.mnc, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort);
    }

    private CellIdentityGsm(CellIdentityGsm cid) {
+12 −17
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ public final class CellIdentityLte extends CellIdentity {
    // 16-bit tracking area code
    private final int mTac;
    // 18-bit Absolute RF Channel Number
    @UnsupportedAppUsage
    private final int mEarfcn;
    // cell bandwidth, in kHz
    private final int mBandwidth;
@@ -72,22 +71,6 @@ public final class CellIdentityLte extends CellIdentity {
                String.valueOf(mnc), null, null);
    }

    /**
     *
     * @param mcc 3-digit Mobile Country Code, 0..999
     * @param mnc 2 or 3-digit Mobile Network Code, 0..999
     * @param ci 28-bit Cell Identity
     * @param pci Physical Cell Id 0..503
     * @param tac 16-bit Tracking Area Code
     * @param earfcn 18-bit LTE Absolute RF Channel Number
     *
     * @hide
     */
    public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac, int earfcn) {
        this(ci, pci, tac, earfcn, CellInfo.UNAVAILABLE, String.valueOf(mcc), String.valueOf(mnc),
                null, null);
    }

    /**
     *
     * @param ci 28-bit Cell Identity
@@ -112,6 +95,18 @@ public final class CellIdentityLte extends CellIdentity {
        mBandwidth = bandwidth;
    }

    /** @hide */
    public CellIdentityLte(android.hardware.radio.V1_0.CellIdentityLte cid) {
        this(cid.ci, cid.pci, cid.tac, cid.earfcn, CellInfo.UNAVAILABLE, cid.mcc, cid.mnc, "", "");
    }

    /** @hide */
    public CellIdentityLte(android.hardware.radio.V1_2.CellIdentityLte cid) {
        this(cid.base.ci, cid.base.pci, cid.base.tac, cid.base.earfcn, cid.bandwidth,
                cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong,
                cid.operatorNames.alphaShort);
    }

    private CellIdentityLte(CellIdentityLte cid) {
        this(cid.mCi, cid.mPci, cid.mTac, cid.mEarfcn, cid.mBandwidth, cid.mMccStr,
                cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort);
+11 −16
Original line number Diff line number Diff line
@@ -50,22 +50,6 @@ public final class CellIdentityTdscdma extends CellIdentity {
        mUarfcn = CellInfo.UNAVAILABLE;
    }

    /**
     * @param mcc 3-digit Mobile Country Code, 0..999
     * @param mnc 2 or 3-digit Mobile Network Code, 0..999
     * @param lac 16-bit Location Area Code, 0..65535, CellInfo.UNAVAILABLE if unknown
     * @param cid 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, CellInfo.
     *        UNAVAILABLE if unknown
     * @param cpid 8-bit Cell Parameters ID described in TS 25.331, 0..127, CellInfo.UNAVAILABLE
     *        if unknown
     * @param uarfcn 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
     *
     * @hide
     */
    public CellIdentityTdscdma(int mcc, int mnc, int lac, int cid, int cpid, int uarfcn) {
        this(String.valueOf(mcc), String.valueOf(mnc), lac, cid, cpid, uarfcn, null, null);
    }

    /**
     * @param mcc 3-digit Mobile Country Code in string format
     * @param mnc 2 or 3-digit Mobile Network Code in string format
@@ -94,6 +78,17 @@ public final class CellIdentityTdscdma extends CellIdentity {
                cid.mCpid, cid.mUarfcn, cid.mAlphaLong, cid.mAlphaShort);
    }

    /** @hide */
    public CellIdentityTdscdma(android.hardware.radio.V1_0.CellIdentityTdscdma cid) {
        this(cid.mcc, cid.mnc, cid.lac, cid.cid, cid.cpid, CellInfo.UNAVAILABLE, "", "");
    }

    /** @hide */
    public CellIdentityTdscdma(android.hardware.radio.V1_2.CellIdentityTdscdma cid) {
        this(cid.base.mcc, cid.base.mnc, cid.base.lac, cid.base.cid, cid.base.cpid,
                cid.uarfcn, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort);
    }

    CellIdentityTdscdma copy() {
        return new CellIdentityTdscdma(this);
    }
+12 −29
Original line number Diff line number Diff line
@@ -51,35 +51,6 @@ public final class CellIdentityWcdma extends CellIdentity {
        mPsc = CellInfo.UNAVAILABLE;
        mUarfcn = CellInfo.UNAVAILABLE;
    }
    /**
     * public constructor
     * @param mcc 3-digit Mobile Country Code, 0..999
     * @param mnc 2 or 3-digit Mobile Network Code, 0..999
     * @param lac 16-bit Location Area Code, 0..65535
     * @param cid 28-bit UMTS Cell Identity
     * @param psc 9-bit UMTS Primary Scrambling Code
     *
     * @hide
     */
    public CellIdentityWcdma (int mcc, int mnc, int lac, int cid, int psc) {
        this(lac, cid, psc, CellInfo.UNAVAILABLE, String.valueOf(mcc), String.valueOf(mnc),
                null, null);
    }

    /**
     * public constructor
     * @param mcc 3-digit Mobile Country Code, 0..999
     * @param mnc 2 or 3-digit Mobile Network Code, 0..999
     * @param lac 16-bit Location Area Code, 0..65535
     * @param cid 28-bit UMTS Cell Identity
     * @param psc 9-bit UMTS Primary Scrambling Code
     * @param uarfcn 16-bit UMTS Absolute RF Channel Number described in TS 25.101 sec. 5.4.3
     *
     * @hide
     */
    public CellIdentityWcdma (int mcc, int mnc, int lac, int cid, int psc, int uarfcn) {
        this(lac, cid, psc, uarfcn, String.valueOf(mcc), String.valueOf(mnc), null, null);
    }

    /**
     * public constructor
@@ -103,6 +74,18 @@ public final class CellIdentityWcdma extends CellIdentity {
        mUarfcn = uarfcn;
    }

    /** @hide */
    public CellIdentityWcdma(android.hardware.radio.V1_0.CellIdentityWcdma cid) {
        this(cid.lac, cid.cid, cid.psc, cid.uarfcn, cid.mcc, cid.mnc, "", "");
    }

    /** @hide */
    public CellIdentityWcdma(android.hardware.radio.V1_2.CellIdentityWcdma cid) {
        this(cid.base.lac, cid.base.cid, cid.base.psc, cid.base.uarfcn,
                cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong,
                cid.operatorNames.alphaShort);
    }

    private CellIdentityWcdma(CellIdentityWcdma cid) {
        this(cid.mLac, cid.mCid, cid.mPsc, cid.mUarfcn, cid.mMccStr,
                cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort);
Loading