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

Commit 4167ae08 authored by Nathan Harold's avatar Nathan Harold Committed by Automerger Merge Worker
Browse files

Convert getAdditionalPlmns to return a Set am: a4e79e3d

Change-Id: I7850d00002537cbc4297ea14875d1006ec66b4a4
parents 4c1f620a a4e79e3d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -44997,7 +44997,7 @@ package android.telephony {
  }
  public final class CellIdentityGsm extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method @NonNull public java.util.Set<java.lang.String> getAdditionalPlmns();
    method public int getArfcn();
    method public int getBsic();
    method public int getCid();
@@ -45013,7 +45013,7 @@ package android.telephony {
  }
  public final class CellIdentityLte extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method @NonNull public java.util.Set<java.lang.String> getAdditionalPlmns();
    method @NonNull public java.util.List<java.lang.Integer> getBands();
    method public int getBandwidth();
    method public int getCi();
@@ -45031,7 +45031,7 @@ package android.telephony {
  }
  public final class CellIdentityNr extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method @NonNull public java.util.Set<java.lang.String> getAdditionalPlmns();
    method @NonNull public java.util.List<java.lang.Integer> getBands();
    method @Nullable public String getMccString();
    method @Nullable public String getMncString();
@@ -45044,7 +45044,7 @@ package android.telephony {
  }
  public final class CellIdentityTdscdma extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method @NonNull public java.util.Set<java.lang.String> getAdditionalPlmns();
    method public int getCid();
    method @Nullable public android.telephony.ClosedSubscriberGroupInfo getClosedSubscriberGroupInfo();
    method public int getCpid();
@@ -45058,7 +45058,7 @@ package android.telephony {
  }
  public final class CellIdentityWcdma extends android.telephony.CellIdentity {
    method @NonNull public java.util.List<java.lang.String> getAdditionalPlmns();
    method @NonNull public java.util.Set<java.lang.String> getAdditionalPlmns();
    method public int getCid();
    method @Nullable public android.telephony.ClosedSubscriberGroupInfo getClosedSubscriberGroupInfo();
    method public int getLac();
+13 −12
Original line number Diff line number Diff line
@@ -22,11 +22,12 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
import android.util.ArraySet;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * CellIdentity to represent a unique GSM cell
@@ -50,7 +51,7 @@ public final class CellIdentityGsm extends CellIdentity {
    private final int mBsic;

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

    /**
     * @hide
@@ -62,7 +63,7 @@ public final class CellIdentityGsm extends CellIdentity {
        mCid = CellInfo.UNAVAILABLE;
        mArfcn = CellInfo.UNAVAILABLE;
        mBsic = CellInfo.UNAVAILABLE;
        mAdditionalPlmns = Collections.emptyList();
        mAdditionalPlmns = new ArraySet<>();
    }

    /**
@@ -81,13 +82,13 @@ public final class CellIdentityGsm extends CellIdentity {
     */
    public CellIdentityGsm(int lac, int cid, int arfcn, int bsic, @Nullable String mccStr,
            @Nullable String mncStr, @Nullable String alphal, @Nullable String alphas,
            @NonNull List<String> additionalPlmns) {
            @NonNull Collection<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 = new ArrayList<>(additionalPlmns.size());
        mAdditionalPlmns = new ArraySet<>(additionalPlmns.size());
        for (String plmn : additionalPlmns) {
            if (isValidPlmn(plmn)) {
                mAdditionalPlmns.add(plmn);
@@ -99,7 +100,7 @@ public final class CellIdentityGsm extends CellIdentity {
    public CellIdentityGsm(@NonNull 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, "", "", Collections.emptyList());
                cid.mcc, cid.mnc, "", "", new ArraySet<>());
    }

    /** @hide */
@@ -107,7 +108,7 @@ public final class CellIdentityGsm extends CellIdentity {
        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,
                Collections.emptyList());
                new ArraySet<>());
    }

    /** @hide */
@@ -221,8 +222,8 @@ public final class CellIdentityGsm extends CellIdentity {
     * @return a list of additional PLMN IDs supported by this cell.
     */
    @NonNull
    public List<String> getAdditionalPlmns() {
        return mAdditionalPlmns;
    public Set<String> getAdditionalPlmns() {
        return Collections.unmodifiableSet(mAdditionalPlmns);
    }

    /**
@@ -296,7 +297,7 @@ public final class CellIdentityGsm extends CellIdentity {
        dest.writeInt(mCid);
        dest.writeInt(mArfcn);
        dest.writeInt(mBsic);
        dest.writeList(mAdditionalPlmns);
        dest.writeArraySet(mAdditionalPlmns);
    }

    /** Construct from Parcel, type has already been processed */
@@ -306,7 +307,7 @@ public final class CellIdentityGsm extends CellIdentity {
        mCid = in.readInt();
        mArfcn = in.readInt();
        mBsic = in.readInt();
        mAdditionalPlmns = in.readArrayList(null);
        mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);

        if (DBG) log(toString());
    }
+14 −12
Original line number Diff line number Diff line
@@ -23,11 +23,13 @@ import android.os.Build;
import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
import android.util.ArraySet;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * CellIdentity is to represent a unique LTE cell
@@ -54,7 +56,7 @@ public final class CellIdentityLte extends CellIdentity {
    private final int mBandwidth;

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

    private ClosedSubscriberGroupInfo mCsgInfo;

@@ -69,7 +71,7 @@ public final class CellIdentityLte extends CellIdentity {
        mTac = CellInfo.UNAVAILABLE;
        mEarfcn = CellInfo.UNAVAILABLE;
        mBandwidth = CellInfo.UNAVAILABLE;
        mAdditionalPlmns = Collections.emptyList();
        mAdditionalPlmns = new ArraySet<>();
        mCsgInfo = null;
    }

@@ -86,7 +88,7 @@ public final class CellIdentityLte extends CellIdentity {
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac) {
        this(ci, pci, tac, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, String.valueOf(mcc),
                String.valueOf(mnc), null, null, Collections.emptyList(), null);
                String.valueOf(mnc), null, null, new ArraySet<>(), null);
    }

    /**
@@ -107,7 +109,7 @@ public final class CellIdentityLte extends CellIdentity {
     */
    public CellIdentityLte(int ci, int pci, int tac, int earfcn, int bandwidth,
            @Nullable String mccStr, @Nullable String mncStr, @Nullable String alphal,
            @Nullable String alphas, @NonNull List<String> additionalPlmns,
            @Nullable String alphas, @NonNull Collection<String> additionalPlmns,
            @Nullable ClosedSubscriberGroupInfo csgInfo) {
        super(TAG, CellInfo.TYPE_LTE, mccStr, mncStr, alphal, alphas);
        mCi = inRangeOrUnavailable(ci, 0, MAX_CI);
@@ -115,7 +117,7 @@ public final class CellIdentityLte extends CellIdentity {
        mTac = inRangeOrUnavailable(tac, 0, MAX_TAC);
        mEarfcn = inRangeOrUnavailable(earfcn, 0, MAX_EARFCN);
        mBandwidth = inRangeOrUnavailable(bandwidth, 0, MAX_BANDWIDTH);
        mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
        mAdditionalPlmns = new ArraySet<>(additionalPlmns.size());
        for (String plmn : additionalPlmns) {
            if (isValidPlmn(plmn)) {
                mAdditionalPlmns.add(plmn);
@@ -127,14 +129,14 @@ public final class CellIdentityLte extends CellIdentity {
    /** @hide */
    public CellIdentityLte(@NonNull android.hardware.radio.V1_0.CellIdentityLte cid) {
        this(cid.ci, cid.pci, cid.tac, cid.earfcn,
                CellInfo.UNAVAILABLE, cid.mcc, cid.mnc, "", "", Collections.emptyList(), null);
                CellInfo.UNAVAILABLE, cid.mcc, cid.mnc, "", "", new ArraySet<>(), null);
    }

    /** @hide */
    public CellIdentityLte(@NonNull 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, Collections.emptyList(), null);
                cid.operatorNames.alphaShort, new ArraySet<>(), null);
    }

    /** @hide */
@@ -270,8 +272,8 @@ public final class CellIdentityLte extends CellIdentity {
     * @return a list of additional PLMN IDs supported by this cell.
     */
    @NonNull
    public List<String> getAdditionalPlmns() {
        return mAdditionalPlmns;
    public Set<String> getAdditionalPlmns() {
        return Collections.unmodifiableSet(mAdditionalPlmns);
    }

    /**
@@ -361,7 +363,7 @@ public final class CellIdentityLte extends CellIdentity {
        dest.writeInt(mTac);
        dest.writeInt(mEarfcn);
        dest.writeInt(mBandwidth);
        dest.writeList(mAdditionalPlmns);
        dest.writeArraySet(mAdditionalPlmns);
        dest.writeParcelable(mCsgInfo, flags);
    }

@@ -373,7 +375,7 @@ public final class CellIdentityLte extends CellIdentity {
        mTac = in.readInt();
        mEarfcn = in.readInt();
        mBandwidth = in.readInt();
        mAdditionalPlmns = in.readArrayList(null);
        mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
        mCsgInfo = in.readParcelable(null);
        if (DBG) log(toString());
    }
+11 −8
Original line number Diff line number Diff line
@@ -22,11 +22,14 @@ import android.annotation.Nullable;
import android.os.Parcel;
import android.telephony.AccessNetworkConstants.NgranBands.NgranBand;
import android.telephony.gsm.GsmCellLocation;
import android.util.ArraySet;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * Information to represent a unique NR(New Radio 5G) cell.
@@ -46,7 +49,7 @@ public final class CellIdentityNr extends CellIdentity {
    private final List<Integer> mBands;

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

    /**
     *
@@ -66,14 +69,14 @@ public final class CellIdentityNr extends CellIdentity {
    public CellIdentityNr(int pci, int tac, int nrArfcn, @NgranBand List<Integer> bands,
                          @Nullable String mccStr, @Nullable String mncStr, long nci,
                          @Nullable String alphal, @Nullable String alphas,
                          @NonNull List<String> additionalPlmns) {
                          @NonNull Collection<String> additionalPlmns) {
        super(TAG, CellInfo.TYPE_NR, mccStr, mncStr, alphal, alphas);
        mPci = inRangeOrUnavailable(pci, 0, MAX_PCI);
        mTac = inRangeOrUnavailable(tac, 0, MAX_TAC);
        mNrArfcn = inRangeOrUnavailable(nrArfcn, 0, MAX_NRARFCN);
        mBands = new ArrayList<>(bands);
        mNci = inRangeOrUnavailable(nci, 0, MAX_NCI);
        mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
        mAdditionalPlmns = new ArraySet<>(additionalPlmns.size());
        for (String plmn : additionalPlmns) {
            if (isValidPlmn(plmn)) {
                mAdditionalPlmns.add(plmn);
@@ -85,7 +88,7 @@ public final class CellIdentityNr extends CellIdentity {
    public CellIdentityNr(@NonNull android.hardware.radio.V1_4.CellIdentityNr cid) {
        this(cid.pci, cid.tac, cid.nrarfcn, Collections.emptyList(), cid.mcc, cid.mnc, cid.nci,
                cid.operatorNames.alphaLong, cid.operatorNames.alphaShort,
                Collections.emptyList());
                new ArraySet<>());
    }

    /** @hide */
@@ -212,8 +215,8 @@ public final class CellIdentityNr extends CellIdentity {
     * @return a list of additional PLMN IDs supported by this cell.
     */
    @NonNull
    public List<String> getAdditionalPlmns() {
        return Collections.unmodifiableList(mAdditionalPlmns);
    public Set<String> getAdditionalPlmns() {
        return Collections.unmodifiableSet(mAdditionalPlmns);
    }

    @Override
@@ -241,7 +244,7 @@ public final class CellIdentityNr extends CellIdentity {
        dest.writeInt(mNrArfcn);
        dest.writeList(mBands);
        dest.writeLong(mNci);
        dest.writeList(mAdditionalPlmns);
        dest.writeArraySet(mAdditionalPlmns);
    }

    /** Construct from Parcel, type has already been processed */
@@ -252,7 +255,7 @@ public final class CellIdentityNr extends CellIdentity {
        mNrArfcn = in.readInt();
        mBands = in.readArrayList(null);
        mNci = in.readLong();
        mAdditionalPlmns = in.readArrayList(null);
        mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
    }

    /** Implement the Parcelable interface */
+12 −10
Original line number Diff line number Diff line
@@ -20,11 +20,12 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
import android.util.ArraySet;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * CellIdentity is to represent a unique TD-SCDMA cell
@@ -50,7 +51,7 @@ public final class CellIdentityTdscdma extends CellIdentity {
    private final int mUarfcn;

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

    private ClosedSubscriberGroupInfo mCsgInfo;

@@ -63,7 +64,7 @@ public final class CellIdentityTdscdma extends CellIdentity {
        mCid = CellInfo.UNAVAILABLE;
        mCpid = CellInfo.UNAVAILABLE;
        mUarfcn = CellInfo.UNAVAILABLE;
        mAdditionalPlmns = Collections.emptyList();
        mAdditionalPlmns = new ArraySet<>();
        mCsgInfo = null;
    }

@@ -85,13 +86,14 @@ public final class CellIdentityTdscdma extends CellIdentity {
     */
    public CellIdentityTdscdma(@Nullable String mcc, @Nullable String mnc, int lac, int cid,
            int cpid, int uarfcn, @Nullable String alphal, @Nullable String alphas,
            @NonNull List<String> additionalPlmns, @Nullable ClosedSubscriberGroupInfo csgInfo) {
            @NonNull Collection<String> additionalPlmns,
            @Nullable ClosedSubscriberGroupInfo csgInfo) {
        super(TAG, CellInfo.TYPE_TDSCDMA, mcc, mnc, alphal, alphas);
        mLac = inRangeOrUnavailable(lac, 0, MAX_LAC);
        mCid = inRangeOrUnavailable(cid, 0, MAX_CID);
        mCpid = inRangeOrUnavailable(cpid, 0, MAX_CPID);
        mUarfcn = inRangeOrUnavailable(uarfcn, 0, MAX_UARFCN);
        mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
        mAdditionalPlmns = new ArraySet<>(additionalPlmns.size());
        for (String plmn : additionalPlmns) {
            if (isValidPlmn(plmn)) {
                mAdditionalPlmns.add(plmn);
@@ -208,8 +210,8 @@ public final class CellIdentityTdscdma extends CellIdentity {
     * @return a list of additional PLMN IDs supported by this cell.
     */
    @NonNull
    public List<String> getAdditionalPlmns() {
        return mAdditionalPlmns;
    public Set<String> getAdditionalPlmns() {
        return Collections.unmodifiableSet(mAdditionalPlmns);
    }

    /**
@@ -289,7 +291,7 @@ public final class CellIdentityTdscdma extends CellIdentity {
        dest.writeInt(mCid);
        dest.writeInt(mCpid);
        dest.writeInt(mUarfcn);
        dest.writeList(mAdditionalPlmns);
        dest.writeArraySet(mAdditionalPlmns);
        dest.writeParcelable(mCsgInfo, flags);
    }

@@ -300,7 +302,7 @@ public final class CellIdentityTdscdma extends CellIdentity {
        mCid = in.readInt();
        mCpid = in.readInt();
        mUarfcn = in.readInt();
        mAdditionalPlmns = in.readArrayList(null);
        mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
        mCsgInfo = in.readParcelable(null);
        if (DBG) log(toString());
    }
Loading