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

Commit 7b2d5183 authored by Sarah Chin's avatar Sarah Chin Committed by Gerrit Code Review
Browse files

Merge changes from topics "multi-plmn", "nr_band"

* changes:
  Added NR band support
  Multi-Plmn and CSG Support For CellInfo
parents 98ab83c3 f8248cba
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -44962,6 +44962,7 @@ package android.telephony {
  }
  public final class CellIdentityGsm extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method public int getArfcn();
    method public int getBsic();
    method public int getCid();
@@ -44977,8 +44978,10 @@ package android.telephony {
  }
  public final class CellIdentityLte extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method public int getBandwidth();
    method public int getCi();
    method @Nullable public android.telephony.ClosedSubscriberGroupInfo getClosedSubscriberGroupInfo();
    method public int getEarfcn();
    method @Deprecated public int getMcc();
    method @Nullable public String getMccString();
@@ -44992,6 +44995,8 @@ package android.telephony {
  }
  public final class CellIdentityNr extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method public int getBand();
    method @Nullable public String getMccString();
    method @Nullable public String getMncString();
    method public long getNci();
@@ -45003,7 +45008,9 @@ package android.telephony {
  }
  public final class CellIdentityTdscdma extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method public int getCid();
    method @Nullable public android.telephony.ClosedSubscriberGroupInfo getClosedSubscriberGroupInfo();
    method public int getCpid();
    method public int getLac();
    method @Nullable public String getMccString();
@@ -45015,7 +45022,9 @@ package android.telephony {
  }
  public final class CellIdentityWcdma extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method public int getCid();
    method @Nullable public android.telephony.ClosedSubscriberGroupInfo getClosedSubscriberGroupInfo();
    method public int getLac();
    method @Deprecated public int getMcc();
    method @Nullable public String getMccString();
@@ -45185,6 +45194,15 @@ package android.telephony {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthWcdma> CREATOR;
  }
  public final class ClosedSubscriberGroupInfo implements android.os.Parcelable {
    method public int describeContents();
    method @IntRange(from=0, to=134217727) public int getCsgIdentity();
    method public boolean getCsgIndicator();
    method @NonNull public String getHomeNodebName();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ClosedSubscriberGroupInfo> CREATOR;
  }
  public class IccOpenLogicalChannelResponse implements android.os.Parcelable {
    method public int describeContents();
    method public int getChannel();
+7 −0
Original line number Diff line number Diff line
@@ -8391,6 +8391,13 @@ package android.telephony {
    field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff
  }
  public static final class AccessNetworkConstants.NgranBands {
    method public static int getFrequencyRangeGroup(int);
    field public static final int FREQUENCY_RANGE_GROUP_1 = 1; // 0x1
    field public static final int FREQUENCY_RANGE_GROUP_2 = 2; // 0x2
    field public static final int FREQUENCY_RANGE_GROUP_UNKNOWN = 0; // 0x0
  }
  public final class CallAttributes implements android.os.Parcelable {
    ctor public CallAttributes(@NonNull android.telephony.PreciseCallState, int, @NonNull android.telephony.CallQuality);
    method public int describeContents();
+7 −0
Original line number Diff line number Diff line
@@ -3036,6 +3036,13 @@ package android.telephony {
    field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff
  }

  public static final class AccessNetworkConstants.NgranBands {
    method public static int getFrequencyRangeGroup(int);
    field public static final int FREQUENCY_RANGE_GROUP_1 = 1; // 0x1
    field public static final int FREQUENCY_RANGE_GROUP_2 = 2; // 0x2
    field public static final int FREQUENCY_RANGE_GROUP_UNKNOWN = 0; // 0x0
  }

  public final class CallQuality implements android.os.Parcelable {
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
    method public int describeContents();
+153 −0
Original line number Diff line number Diff line
@@ -317,6 +317,159 @@ public final class AccessNetworkConstants {
        public static final int BAND_260 = 260;
        public static final int BAND_261 = 261;

        /**
         * NR Bands
         *
         * @hide */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef(prefix = {"BAND_"},
                value = {BAND_1,
                        BAND_2,
                        BAND_3,
                        BAND_5,
                        BAND_7,
                        BAND_8,
                        BAND_12,
                        BAND_14,
                        BAND_18,
                        BAND_20,
                        BAND_25,
                        BAND_28,
                        BAND_29,
                        BAND_30,
                        BAND_34,
                        BAND_38,
                        BAND_39,
                        BAND_40,
                        BAND_41,
                        BAND_48,
                        BAND_50,
                        BAND_51,
                        BAND_65,
                        BAND_66,
                        BAND_70,
                        BAND_71,
                        BAND_74,
                        BAND_75,
                        BAND_76,
                        BAND_77,
                        BAND_78,
                        BAND_79,
                        BAND_80,
                        BAND_81,
                        BAND_82,
                        BAND_83,
                        BAND_84,
                        BAND_86,
                        BAND_90,
                        BAND_257,
                        BAND_258,
                        BAND_260,
                        BAND_261})
        public @interface NgranBand {}

        /**
         * Unknown NR frequency.
         *
         * @hide
         */
        @SystemApi
        @TestApi
        public static final int FREQUENCY_RANGE_GROUP_UNKNOWN = 0;

        /**
         * NR frequency group 1 defined in 3GPP TS 38.101-1 table 5.2-1
         *
         * @hide
         */
        @SystemApi
        @TestApi
        public static final int FREQUENCY_RANGE_GROUP_1 = 1;

        /**
         * NR frequency group 2 defined in 3GPP TS 38.101-2 table 5.2-1
         *
         * @hide
         */
        @SystemApi
        @TestApi
        public static final int FREQUENCY_RANGE_GROUP_2 = 2;

        /**
         * Radio frequency range group
         *
         * @hide
         */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef(prefix = {"FREQUENCY_RANGE_GROUP_"},
                value = {
                        FREQUENCY_RANGE_GROUP_UNKNOWN,
                        FREQUENCY_RANGE_GROUP_1,
                        FREQUENCY_RANGE_GROUP_2})
        public @interface FrequencyRangeGroup {}

        /**
         * Get frequency range group
         *
         * @param band NR band
         * @return The frequency range group
         *
         * @hide
         */
        @SystemApi
        @TestApi
        public static @FrequencyRangeGroup int getFrequencyRangeGroup(@NgranBand int band) {
            switch (band) {
                case BAND_1:
                case BAND_2:
                case BAND_3:
                case BAND_5:
                case BAND_7:
                case BAND_8:
                case BAND_12:
                case BAND_14:
                case BAND_18:
                case BAND_20:
                case BAND_25:
                case BAND_28:
                case BAND_29:
                case BAND_30:
                case BAND_34:
                case BAND_38:
                case BAND_39:
                case BAND_40:
                case BAND_41:
                case BAND_48:
                case BAND_50:
                case BAND_51:
                case BAND_65:
                case BAND_66:
                case BAND_70:
                case BAND_71:
                case BAND_74:
                case BAND_75:
                case BAND_76:
                case BAND_77:
                case BAND_78:
                case BAND_79:
                case BAND_80:
                case BAND_81:
                case BAND_82:
                case BAND_83:
                case BAND_84:
                case BAND_86:
                case BAND_90:
                    return FREQUENCY_RANGE_GROUP_1;
                case BAND_257:
                case BAND_258:
                case BAND_260:
                case BAND_261:
                    return FREQUENCY_RANGE_GROUP_2;
                default:
                    return FREQUENCY_RANGE_GROUP_UNKNOWN;
            }
        };

        /** @hide */
        private NgranBands() {}
    }
+37 −6
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;

import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
@@ -46,6 +48,9 @@ public final class CellIdentityGsm extends CellIdentity {
    // 6-bit Base Station Identity Code
    private final int mBsic;

    // a list of additional PLMN-IDs reported for this cell
    private final List<String> mAdditionalPlmns;

    /**
     * @hide
     */
@@ -56,6 +61,7 @@ public final class CellIdentityGsm extends CellIdentity {
        mCid = CellInfo.UNAVAILABLE;
        mArfcn = CellInfo.UNAVAILABLE;
        mBsic = CellInfo.UNAVAILABLE;
        mAdditionalPlmns = Collections.emptyList();
    }

    /**
@@ -68,35 +74,48 @@ public final class CellIdentityGsm extends CellIdentity {
     * @param mncStr 2 or 3-digit Mobile Network Code in string format
     * @param alphal long alpha Operator Name String or Enhanced Operator Name String
     * @param alphas short alpha Operator Name String or Enhanced Operator Name String
     * @param additionalPlmns a list of additional PLMN IDs broadcast by the cell
     *
     * @hide
     */
    public CellIdentityGsm(int lac, int cid, int arfcn, int bsic, String mccStr,
                            String mncStr, String alphal, String alphas) {
                            String mncStr, String alphal, String alphas,
                            List<String> additionalPlmns) {
        super(TAG, CellInfo.TYPE_GSM, mccStr, mncStr, alphal, alphas);
        mLac = inRangeOrUnavailable(lac, 0, MAX_LAC);
        mCid = inRangeOrUnavailable(cid, 0, MAX_CID);
        mArfcn = inRangeOrUnavailable(arfcn, 0, MAX_ARFCN);
        mBsic = inRangeOrUnavailable(bsic, 0, MAX_BSIC);
        mAdditionalPlmns = additionalPlmns;
    }

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

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

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

    private CellIdentityGsm(CellIdentityGsm cid) {
        this(cid.mLac, cid.mCid, cid.mArfcn, cid.mBsic, cid.mMccStr,
                cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort);
                cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns);
    }

    CellIdentityGsm copy() {
@@ -107,7 +126,7 @@ public final class CellIdentityGsm extends CellIdentity {
    @Override
    public @NonNull CellIdentityGsm sanitizeLocationInfo() {
        return new CellIdentityGsm(CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
                CellInfo.UNAVAILABLE, mMccStr, mMncStr, mAlphaLong, mAlphaShort);
                CellInfo.UNAVAILABLE, mMccStr, mMncStr, mAlphaLong, mAlphaShort, mAdditionalPlmns);
    }

    /**
@@ -192,6 +211,14 @@ public final class CellIdentityGsm extends CellIdentity {
        return mArfcn;
    }

    /**
     * @return a list of additional PLMN IDs supported by this cell.
     */
    @NonNull
    public List<String> getAdditionalPlmns() {
        return mAdditionalPlmns;
    }

    /**
     * @deprecated Primary Scrambling Code is not applicable to GSM.
     * @return {@link android.telephony.CellInfo#UNAVAILABLE UNAVAILABLE} - undefined for GSM
@@ -215,7 +242,7 @@ public final class CellIdentityGsm extends CellIdentity {

    @Override
    public int hashCode() {
        return Objects.hash(mLac, mCid, super.hashCode());
        return Objects.hash(mLac, mCid, mAdditionalPlmns.hashCode(), super.hashCode());
    }

    @Override
@@ -235,6 +262,7 @@ public final class CellIdentityGsm extends CellIdentity {
                && mBsic == o.mBsic
                && TextUtils.equals(mMccStr, o.mMccStr)
                && TextUtils.equals(mMncStr, o.mMncStr)
                && mAdditionalPlmns.equals(o.mAdditionalPlmns)
                && super.equals(other);
    }

@@ -249,6 +277,7 @@ public final class CellIdentityGsm extends CellIdentity {
        .append(" mMnc=").append(mMncStr)
        .append(" mAlphaLong=").append(mAlphaLong)
        .append(" mAlphaShort=").append(mAlphaShort)
        .append(" mAdditionalPlmns=").append(mAdditionalPlmns)
        .append("}").toString();
    }

@@ -261,6 +290,7 @@ public final class CellIdentityGsm extends CellIdentity {
        dest.writeInt(mCid);
        dest.writeInt(mArfcn);
        dest.writeInt(mBsic);
        dest.writeList(mAdditionalPlmns);
    }

    /** Construct from Parcel, type has already been processed */
@@ -270,6 +300,7 @@ public final class CellIdentityGsm extends CellIdentity {
        mCid = in.readInt();
        mArfcn = in.readInt();
        mBsic = in.readInt();
        mAdditionalPlmns = in.readArrayList(null);

        if (DBG) log(toString());
    }
Loading