diff --git a/telephony/java/android/telephony/BarringInfo.java b/telephony/java/android/telephony/BarringInfo.java index e9698adc03563..0aa4b5805cd68 100644 --- a/telephony/java/android/telephony/BarringInfo.java +++ b/telephony/java/android/telephony/BarringInfo.java @@ -28,7 +28,6 @@ import android.util.SparseArray; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.util.List; import java.util.Objects; /** @@ -269,42 +268,6 @@ public final class BarringInfo implements Parcelable { mBarringServiceInfos = barringServiceInfos; } - /** @hide */ - public static BarringInfo create( - @NonNull android.hardware.radio.V1_5.CellIdentity halBarringCellId, - @NonNull List halBarringInfos) { - CellIdentity ci = CellIdentity.create(halBarringCellId); - SparseArray serviceInfos = new SparseArray<>(); - - for (android.hardware.radio.V1_5.BarringInfo halBarringInfo : halBarringInfos) { - if (halBarringInfo.barringType - == android.hardware.radio.V1_5.BarringInfo.BarringType.CONDITIONAL) { - if (halBarringInfo.barringTypeSpecificInfo.getDiscriminator() - != android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo - .hidl_discriminator.conditional) { - // this is an error case where the barring info is conditional but the - // conditional barring fields weren't included - continue; - } - android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo - .Conditional conditionalInfo = - halBarringInfo.barringTypeSpecificInfo.conditional(); - serviceInfos.put( - halBarringInfo.serviceType, new BarringServiceInfo( - halBarringInfo.barringType, // will always be CONDITIONAL here - conditionalInfo.isBarred, - conditionalInfo.factor, - conditionalInfo.timeSeconds)); - } else { - // Barring type is either NONE or UNCONDITIONAL - serviceInfos.put( - halBarringInfo.serviceType, new BarringServiceInfo( - halBarringInfo.barringType, false, 0, 0)); - } - } - return new BarringInfo(ci, serviceInfos); - } - /** * Get the BarringServiceInfo for a specified service. * diff --git a/telephony/java/android/telephony/CellConfigLte.java b/telephony/java/android/telephony/CellConfigLte.java index 4b57d71d84baa..3e4e244a3dc6c 100644 --- a/telephony/java/android/telephony/CellConfigLte.java +++ b/telephony/java/android/telephony/CellConfigLte.java @@ -33,11 +33,6 @@ public class CellConfigLte implements Parcelable { mIsEndcAvailable = false; } - /** @hide */ - public CellConfigLte(android.hardware.radio.V1_4.CellConfigLte cellConfig) { - mIsEndcAvailable = cellConfig.isEndcAvailable; - } - /** @hide */ public CellConfigLte(boolean isEndcAvailable) { mIsEndcAvailable = isEndcAvailable; diff --git a/telephony/java/android/telephony/CellIdentity.java b/telephony/java/android/telephony/CellIdentity.java index 15147da925b8b..06cfd67186640 100644 --- a/telephony/java/android/telephony/CellIdentity.java +++ b/telephony/java/android/telephony/CellIdentity.java @@ -20,7 +20,6 @@ import android.annotation.CallSuper; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.hardware.radio.V1_0.CellInfoType; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; @@ -359,104 +358,4 @@ public abstract class CellIdentity implements Parcelable { return true; } - - /** @hide */ - public static CellIdentity create(android.hardware.radio.V1_0.CellIdentity cellIdentity) { - if (cellIdentity == null) return null; - switch(cellIdentity.cellInfoType) { - case CellInfoType.GSM: { - if (cellIdentity.cellIdentityGsm.size() == 1) { - return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); - } - break; - } - case CellInfoType.WCDMA: { - if (cellIdentity.cellIdentityWcdma.size() == 1) { - return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); - } - break; - } - case CellInfoType.TD_SCDMA: { - if (cellIdentity.cellIdentityTdscdma.size() == 1) { - return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); - } - break; - } - case CellInfoType.LTE: { - if (cellIdentity.cellIdentityLte.size() == 1) { - return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); - } - break; - } - case CellInfoType.CDMA: { - if (cellIdentity.cellIdentityCdma.size() == 1) { - return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); - } - break; - } - case CellInfoType.NONE: break; - default: break; - } - return null; - } - - /** @hide */ - public static CellIdentity create(android.hardware.radio.V1_2.CellIdentity cellIdentity) { - if (cellIdentity == null) return null; - switch(cellIdentity.cellInfoType) { - case CellInfoType.GSM: { - if (cellIdentity.cellIdentityGsm.size() == 1) { - return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); - } - break; - } - case CellInfoType.WCDMA: { - if (cellIdentity.cellIdentityWcdma.size() == 1) { - return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); - } - break; - } - case CellInfoType.TD_SCDMA: { - if (cellIdentity.cellIdentityTdscdma.size() == 1) { - return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); - } - break; - } - case CellInfoType.LTE: { - if (cellIdentity.cellIdentityLte.size() == 1) { - return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); - } - break; - } - case CellInfoType.CDMA: { - if (cellIdentity.cellIdentityCdma.size() == 1) { - return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); - } - break; - } - case CellInfoType.NONE: break; - default: break; - } - return null; - } - - /** @hide */ - public static CellIdentity create(android.hardware.radio.V1_5.CellIdentity ci) { - if (ci == null) return null; - switch (ci.getDiscriminator()) { - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.gsm: - return new CellIdentityGsm(ci.gsm()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.cdma: - return new CellIdentityCdma(ci.cdma()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.lte: - return new CellIdentityLte(ci.lte()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.wcdma: - return new CellIdentityWcdma(ci.wcdma()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.tdscdma: - return new CellIdentityTdscdma(ci.tdscdma()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.nr: - return new CellIdentityNr(ci.nr()); - default: return null; - } - } } diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java index 58a01e9d01af5..ba3a192074bcb 100644 --- a/telephony/java/android/telephony/CellIdentityCdma.java +++ b/telephony/java/android/telephony/CellIdentityCdma.java @@ -112,17 +112,6 @@ public final class CellIdentityCdma extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityCdma(@NonNull android.hardware.radio.V1_0.CellIdentityCdma cid) { - this(cid.networkId, cid.systemId, cid.baseStationId, cid.longitude, cid.latitude, "", ""); - } - - /** @hide */ - public CellIdentityCdma(@NonNull 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(@NonNull CellIdentityCdma cid) { this(cid.mNetworkId, cid.mSystemId, cid.mBasestationId, cid.mLongitude, cid.mLatitude, cid.mAlphaLong, cid.mAlphaShort); diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java index a3bec339794b8..2516a79546f8c 100644 --- a/telephony/java/android/telephony/CellIdentityGsm.java +++ b/telephony/java/android/telephony/CellIdentityGsm.java @@ -101,30 +101,6 @@ public final class CellIdentityGsm extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - 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, "", "", new ArraySet<>()); - } - - /** @hide */ - public CellIdentityGsm(@NonNull 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, - new ArraySet<>()); - } - - /** @hide */ - public CellIdentityGsm(@NonNull 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(@NonNull CellIdentityGsm cid) { this(cid.mLac, cid.mCid, cid.mArfcn, cid.mBsic, cid.mMccStr, cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns); diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java index bd92d00a03213..4db00cf258e5a 100644 --- a/telephony/java/android/telephony/CellIdentityLte.java +++ b/telephony/java/android/telephony/CellIdentityLte.java @@ -136,31 +136,6 @@ public final class CellIdentityLte extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityLte(@NonNull android.hardware.radio.V1_0.CellIdentityLte cid) { - this(cid.ci, cid.pci, cid.tac, cid.earfcn, new int[] {}, - 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, new int[] {}, - cid.bandwidth, cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong, - cid.operatorNames.alphaShort, new ArraySet<>(), null); - } - - /** @hide */ - public CellIdentityLte(@NonNull android.hardware.radio.V1_5.CellIdentityLte cid) { - this(cid.base.base.ci, cid.base.base.pci, cid.base.base.tac, cid.base.base.earfcn, - cid.bands.stream().mapToInt(Integer::intValue).toArray(), cid.base.bandwidth, - cid.base.base.mcc, cid.base.base.mnc, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, cid.additionalPlmns, - cid.optionalCsgInfo.getDiscriminator() - == android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo - ? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) - : null); - } - private CellIdentityLte(@NonNull CellIdentityLte cid) { this(cid.mCi, cid.mPci, cid.mTac, cid.mEarfcn, cid.mBands, cid.mBandwidth, cid.mMccStr, cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo); diff --git a/telephony/java/android/telephony/CellIdentityNr.java b/telephony/java/android/telephony/CellIdentityNr.java index 4f5052151af5b..6aeb482fb2369 100644 --- a/telephony/java/android/telephony/CellIdentityNr.java +++ b/telephony/java/android/telephony/CellIdentityNr.java @@ -65,7 +65,6 @@ public final class CellIdentityNr extends CellIdentity { } /** - * * @param pci Physical Cell Id in range [0, 1007]. * @param tac 24-bit Tracking Area Code. * @param nrArfcn NR Absolute Radio Frequency Channel Number, in range [0, 3279165]. @@ -99,21 +98,6 @@ public final class CellIdentityNr extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityNr(@NonNull android.hardware.radio.V1_4.CellIdentityNr cid) { - this(cid.pci, cid.tac, cid.nrarfcn, new int[] {}, cid.mcc, cid.mnc, cid.nci, - cid.operatorNames.alphaLong, cid.operatorNames.alphaShort, - new ArraySet<>()); - } - - /** @hide */ - public CellIdentityNr(@NonNull android.hardware.radio.V1_5.CellIdentityNr cid) { - this(cid.base.pci, cid.base.tac, cid.base.nrarfcn, - cid.bands.stream().mapToInt(Integer::intValue).toArray(), cid.base.mcc, - cid.base.mnc, cid.base.nci, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, cid.additionalPlmns); - } - /** @hide */ @Override public @NonNull CellIdentityNr sanitizeLocationInfo() { diff --git a/telephony/java/android/telephony/CellIdentityTdscdma.java b/telephony/java/android/telephony/CellIdentityTdscdma.java index ec07d54948493..13d93737f751c 100644 --- a/telephony/java/android/telephony/CellIdentityTdscdma.java +++ b/telephony/java/android/telephony/CellIdentityTdscdma.java @@ -112,31 +112,6 @@ public final class CellIdentityTdscdma extends CellIdentity { cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo); } - /** @hide */ - public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_0.CellIdentityTdscdma cid) { - this(cid.mcc, cid.mnc, cid.lac, cid.cid, cid.cpid, CellInfo.UNAVAILABLE, "", "", - Collections.emptyList(), null); - } - - /** @hide */ - public CellIdentityTdscdma(@NonNull 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, - Collections.emptyList(), null); - } - - /** @hide */ - public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_5.CellIdentityTdscdma cid) { - this(cid.base.base.mcc, cid.base.base.mnc, cid.base.base.lac, cid.base.base.cid, - cid.base.base.cpid, cid.base.uarfcn, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, - cid.additionalPlmns, - cid.optionalCsgInfo.getDiscriminator() - == android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo - ? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) - : null); - } - /** @hide */ @Override public @NonNull CellIdentityTdscdma sanitizeLocationInfo() { diff --git a/telephony/java/android/telephony/CellIdentityWcdma.java b/telephony/java/android/telephony/CellIdentityWcdma.java index b04a51d238c1d..9b463da14f162 100644 --- a/telephony/java/android/telephony/CellIdentityWcdma.java +++ b/telephony/java/android/telephony/CellIdentityWcdma.java @@ -107,30 +107,6 @@ public final class CellIdentityWcdma extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityWcdma(@NonNull android.hardware.radio.V1_0.CellIdentityWcdma cid) { - this(cid.lac, cid.cid, cid.psc, cid.uarfcn, cid.mcc, cid.mnc, "", "", - new ArraySet<>(), null); - } - - /** @hide */ - public CellIdentityWcdma(@NonNull 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, new ArraySet<>(), null); - } - - /** @hide */ - public CellIdentityWcdma(@NonNull android.hardware.radio.V1_5.CellIdentityWcdma cid) { - this(cid.base.base.lac, cid.base.base.cid, cid.base.base.psc, cid.base.base.uarfcn, - cid.base.base.mcc, cid.base.base.mnc, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, cid.additionalPlmns, - cid.optionalCsgInfo.getDiscriminator() - == android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo - ? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) - : null); - } - private CellIdentityWcdma(@NonNull CellIdentityWcdma cid) { this(cid.mLac, cid.mCid, cid.mPsc, cid.mUarfcn, cid.mMccStr, cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo); diff --git a/telephony/java/android/telephony/CellInfo.java b/telephony/java/android/telephony/CellInfo.java index 189a4b898886e..2b2df24bb2687 100644 --- a/telephony/java/android/telephony/CellInfo.java +++ b/telephony/java/android/telephony/CellInfo.java @@ -20,7 +20,6 @@ import android.annotation.ElapsedRealtimeLong; import android.annotation.IntDef; import android.annotation.NonNull; import android.compat.annotation.UnsupportedAppUsage; -import android.hardware.radio.V1_4.CellInfo.Info; import android.os.Parcel; import android.os.Parcelable; @@ -149,6 +148,13 @@ public abstract class CellInfo implements Parcelable { // Observation time stamped as type in nanoseconds since boot private long mTimeStamp; + /** @hide */ + protected CellInfo(int cellConnectionStatus, boolean registered, long timestamp) { + mCellConnectionStatus = cellConnectionStatus; + mRegistered = registered; + mTimeStamp = timestamp; + } + /** @hide */ protected CellInfo() { this.mRegistered = false; @@ -321,131 +327,4 @@ public abstract class CellInfo implements Parcelable { return new CellInfo[size]; } }; - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_0.CellInfo ci) { - this.mRegistered = ci.registered; - this.mTimeStamp = ci.timeStamp; - this.mCellConnectionStatus = CONNECTION_UNKNOWN; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_2.CellInfo ci) { - this.mRegistered = ci.registered; - this.mTimeStamp = ci.timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - this.mRegistered = ci.isRegistered; - this.mTimeStamp = timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - this.mRegistered = ci.registered; - this.mTimeStamp = timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - this.mRegistered = ci.registered; - this.mTimeStamp = timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_0.CellInfo ci) { - if (ci == null) return null; - switch(ci.cellInfoType) { - case android.hardware.radio.V1_0.CellInfoType.GSM: return new CellInfoGsm(ci); - case android.hardware.radio.V1_0.CellInfoType.CDMA: return new CellInfoCdma(ci); - case android.hardware.radio.V1_0.CellInfoType.LTE: return new CellInfoLte(ci); - case android.hardware.radio.V1_0.CellInfoType.WCDMA: return new CellInfoWcdma(ci); - case android.hardware.radio.V1_0.CellInfoType.TD_SCDMA: return new CellInfoTdscdma(ci); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_2.CellInfo ci) { - if (ci == null) return null; - switch(ci.cellInfoType) { - case android.hardware.radio.V1_0.CellInfoType.GSM: return new CellInfoGsm(ci); - case android.hardware.radio.V1_0.CellInfoType.CDMA: return new CellInfoCdma(ci); - case android.hardware.radio.V1_0.CellInfoType.LTE: return new CellInfoLte(ci); - case android.hardware.radio.V1_0.CellInfoType.WCDMA: return new CellInfoWcdma(ci); - case android.hardware.radio.V1_0.CellInfoType.TD_SCDMA: return new CellInfoTdscdma(ci); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - if (ci == null) return null; - switch (ci.info.getDiscriminator()) { - case Info.hidl_discriminator.gsm: return new CellInfoGsm(ci, timeStamp); - case Info.hidl_discriminator.cdma: return new CellInfoCdma(ci, timeStamp); - case Info.hidl_discriminator.lte: return new CellInfoLte(ci, timeStamp); - case Info.hidl_discriminator.wcdma: return new CellInfoWcdma(ci, timeStamp); - case Info.hidl_discriminator.tdscdma: return new CellInfoTdscdma(ci, timeStamp); - case Info.hidl_discriminator.nr: return new CellInfoNr(ci, timeStamp); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - if (ci == null) return null; - switch (ci.ratSpecificInfo.getDiscriminator()) { - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.gsm: - return new CellInfoGsm(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.cdma: - return new CellInfoCdma(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.lte: - return new CellInfoLte(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.wcdma: - return new CellInfoWcdma(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.tdscdma: - return new CellInfoTdscdma(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.nr: - return new CellInfoNr(ci, timeStamp); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - if (ci == null) return null; - switch (ci.ratSpecificInfo.getDiscriminator()) { - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.gsm: - return new CellInfoGsm(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.cdma: - return new CellInfoCdma(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.lte: - return new CellInfoLte(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.wcdma: - return new CellInfoWcdma(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.tdscdma: - return new CellInfoTdscdma(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.nr: - return new CellInfoNr(ci, timeStamp); - default: return null; - } - } } diff --git a/telephony/java/android/telephony/CellInfoCdma.java b/telephony/java/android/telephony/CellInfoCdma.java index dbb30d29eb872..aa8cff52bcaf6 100644 --- a/telephony/java/android/telephony/CellInfoCdma.java +++ b/telephony/java/android/telephony/CellInfoCdma.java @@ -52,48 +52,11 @@ public final class CellInfoCdma extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoCdma cic = ci.cdma.get(0); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.cdma.get(0); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.info.cdma(); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.ratSpecificInfo.cdma(); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.ratSpecificInfo.cdma(); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); + public CellInfoCdma(int connectionStatus, boolean registered, long timeStamp, + CellIdentityCdma cellIdentityCdma, CellSignalStrengthCdma cellSignalStrengthCdma) { + super(connectionStatus, registered, timeStamp); + mCellIdentityCdma = cellIdentityCdma; + mCellSignalStrengthCdma = cellSignalStrengthCdma; } /** diff --git a/telephony/java/android/telephony/CellInfoGsm.java b/telephony/java/android/telephony/CellInfoGsm.java index e1d996e87fcf9..76e825bf426c1 100644 --- a/telephony/java/android/telephony/CellInfoGsm.java +++ b/telephony/java/android/telephony/CellInfoGsm.java @@ -51,43 +51,11 @@ public final class CellInfoGsm extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoGsm cig = ci.gsm.get(0); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoGsm cig = ci.gsm.get(0); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoGsm cig = ci.info.gsm(); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoGsm cig = ci.ratSpecificInfo.gsm(); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoGsm cig = ci.ratSpecificInfo.gsm(); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); + public CellInfoGsm(int cellConnectionStatus, boolean registered, long timeStamp, + CellIdentityGsm cellIdentityGsm, CellSignalStrengthGsm cellSignalStrengthGsm) { + super(cellConnectionStatus, registered, timeStamp); + mCellIdentityGsm = cellIdentityGsm; + mCellSignalStrengthGsm = cellSignalStrengthGsm; } /** diff --git a/telephony/java/android/telephony/CellInfoLte.java b/telephony/java/android/telephony/CellInfoLte.java index 39b320afdac9f..2d176d52c05c0 100644 --- a/telephony/java/android/telephony/CellInfoLte.java +++ b/telephony/java/android/telephony/CellInfoLte.java @@ -56,48 +56,13 @@ public final class CellInfoLte extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoLte(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoLte cil = ci.lte.get(0); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoLte cil = ci.lte.get(0); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_4.CellInfoLte cil = ci.info.lte(); - mCellIdentityLte = new CellIdentityLte(cil.base.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.base.signalStrengthLte); - mCellConfig = new CellConfigLte(cil.cellConfig); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoLte cil = ci.ratSpecificInfo.lte(); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_6.CellInfoLte cil = ci.ratSpecificInfo.lte(); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); + public CellInfoLte(int connectionStatus, boolean registered, long timeStamp, + CellIdentityLte cellIdentityLte, CellSignalStrengthLte cellSignalStrengthLte, + CellConfigLte cellConfig) { + super(connectionStatus, registered, timeStamp); + mCellIdentityLte = cellIdentityLte; + mCellSignalStrengthLte = cellSignalStrengthLte; + mCellConfig = cellConfig; } /** diff --git a/telephony/java/android/telephony/CellInfoNr.java b/telephony/java/android/telephony/CellInfoNr.java index 12e6a38bfdc0c..37fac24ab5e7f 100644 --- a/telephony/java/android/telephony/CellInfoNr.java +++ b/telephony/java/android/telephony/CellInfoNr.java @@ -53,27 +53,11 @@ public final class CellInfoNr extends CellInfo { } /** @hide */ - public CellInfoNr(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_4.CellInfoNr cil = ci.info.nr(); - mCellIdentity = new CellIdentityNr(cil.cellidentity); - mCellSignalStrength = new CellSignalStrengthNr(cil.signalStrength); - } - - /** @hide */ - public CellInfoNr(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoNr cil = ci.ratSpecificInfo.nr(); - mCellIdentity = new CellIdentityNr(cil.cellIdentityNr); - mCellSignalStrength = new CellSignalStrengthNr(cil.signalStrengthNr); - } - - /** @hide */ - public CellInfoNr(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_6.CellInfoNr cil = ci.ratSpecificInfo.nr(); - mCellIdentity = new CellIdentityNr(cil.cellIdentityNr); - mCellSignalStrength = new CellSignalStrengthNr(cil.signalStrengthNr); + public CellInfoNr(int connectionStatus, boolean registered, long timeStamp, + CellIdentityNr cellIdentityNr, CellSignalStrengthNr cellSignalStrengthNr) { + super(connectionStatus, registered, timeStamp); + mCellIdentity = cellIdentityNr; + mCellSignalStrength = cellSignalStrengthNr; } /** diff --git a/telephony/java/android/telephony/CellInfoTdscdma.java b/telephony/java/android/telephony/CellInfoTdscdma.java index 994b317a47fda..d8db4295f3743 100644 --- a/telephony/java/android/telephony/CellInfoTdscdma.java +++ b/telephony/java/android/telephony/CellInfoTdscdma.java @@ -54,43 +54,12 @@ public final class CellInfoTdscdma extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoTdscdma cit = ci.tdscdma.get(0); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoTdscdma cit = ci.tdscdma.get(0); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoTdscdma cit = ci.info.tdscdma(); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoTdscdma cit = ci.ratSpecificInfo.tdscdma(); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoTdscdma cit = ci.ratSpecificInfo.tdscdma(); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); + public CellInfoTdscdma(int connectionStatus, boolean registered, long timeStamp, + CellIdentityTdscdma cellIdentityTdscdma, + CellSignalStrengthTdscdma cellSignalStrengthTdscdma) { + super(connectionStatus, registered, timeStamp); + mCellIdentityTdscdma = cellIdentityTdscdma; + mCellSignalStrengthTdscdma = cellSignalStrengthTdscdma; } /** diff --git a/telephony/java/android/telephony/CellInfoWcdma.java b/telephony/java/android/telephony/CellInfoWcdma.java index 62ac0b8ae04e8..dc8e1fed1392b 100644 --- a/telephony/java/android/telephony/CellInfoWcdma.java +++ b/telephony/java/android/telephony/CellInfoWcdma.java @@ -49,43 +49,11 @@ public final class CellInfoWcdma extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoWcdma ciw = ci.wcdma.get(0); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoWcdma ciw = ci.wcdma.get(0); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoWcdma ciw = ci.info.wcdma(); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoWcdma ciw = ci.ratSpecificInfo.wcdma(); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoWcdma ciw = ci.ratSpecificInfo.wcdma(); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); + public CellInfoWcdma(int connectionStatus, boolean registered, long timeStamp, + CellIdentityWcdma cellIdentityWcdma, CellSignalStrengthWcdma cellSignalStrengthWcdma) { + super(connectionStatus, registered, timeStamp); + mCellIdentityWcdma = cellIdentityWcdma; + mCellSignalStrengthWcdma = cellSignalStrengthWcdma; } /** diff --git a/telephony/java/android/telephony/CellSignalStrength.java b/telephony/java/android/telephony/CellSignalStrength.java index e0896570d3ed5..9727ab7d23e2a 100644 --- a/telephony/java/android/telephony/CellSignalStrength.java +++ b/telephony/java/android/telephony/CellSignalStrength.java @@ -108,7 +108,7 @@ public abstract class CellSignalStrength { // Range for RSSI in ASU (0-31, 99) as defined in TS 27.007 8.69 /** @hide */ - protected static final int getRssiDbmFromAsu(int asu) { + public static final int getRssiDbmFromAsu(int asu) { if (asu > 31 || asu < 0) return CellInfo.UNAVAILABLE; return -113 + (2 * asu); } @@ -122,7 +122,7 @@ public abstract class CellSignalStrength { // Range for RSCP in ASU (0-96, 255) as defined in TS 27.007 8.69 /** @hide */ - protected static final int getRscpDbmFromAsu(int asu) { + public static final int getRscpDbmFromAsu(int asu) { if (asu > 96 || asu < 0) return CellInfo.UNAVAILABLE; return asu - 120; } @@ -136,7 +136,7 @@ public abstract class CellSignalStrength { // Range for SNR in ASU (0-49, 255) as defined in TS 27.007 8.69 /** @hide */ - protected static final int getEcNoDbFromAsu(int asu) { + public static final int getEcNoDbFromAsu(int asu) { if (asu > 49 || asu < 0) return CellInfo.UNAVAILABLE; return -24 + (asu / 2); } diff --git a/telephony/java/android/telephony/CellSignalStrengthCdma.java b/telephony/java/android/telephony/CellSignalStrengthCdma.java index d00049c1ebe59..5298e67bdf801 100644 --- a/telephony/java/android/telephony/CellSignalStrengthCdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthCdma.java @@ -77,13 +77,6 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements updateLevel(null, null); } - /** @hide */ - public CellSignalStrengthCdma(android.hardware.radio.V1_0.CdmaSignalStrength cdma, - android.hardware.radio.V1_0.EvdoSignalStrength evdo) { - // Convert from HAL values as part of construction. - this(-cdma.dbm, -cdma.ecio, -evdo.dbm, -evdo.ecio, evdo.signalNoiseRatio); - } - /** @hide */ public CellSignalStrengthCdma(CellSignalStrengthCdma s) { copyFrom(s); diff --git a/telephony/java/android/telephony/CellSignalStrengthGsm.java b/telephony/java/android/telephony/CellSignalStrengthGsm.java index 51e1ebc63cf28..7b780843061b2 100644 --- a/telephony/java/android/telephony/CellSignalStrengthGsm.java +++ b/telephony/java/android/telephony/CellSignalStrengthGsm.java @@ -66,16 +66,6 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P updateLevel(null, null); } - /** @hide */ - public CellSignalStrengthGsm(android.hardware.radio.V1_0.GsmSignalStrength gsm) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(gsm.signalStrength), gsm.bitErrorRate, gsm.timingAdvance); - - if (mRssi == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - /** @hide */ public CellSignalStrengthGsm(CellSignalStrengthGsm s) { copyFrom(s); diff --git a/telephony/java/android/telephony/CellSignalStrengthLte.java b/telephony/java/android/telephony/CellSignalStrengthLte.java index 9211482fc067c..e8633dd4b7bd4 100644 --- a/telephony/java/android/telephony/CellSignalStrengthLte.java +++ b/telephony/java/android/telephony/CellSignalStrengthLte.java @@ -165,25 +165,6 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P this(rssi, rsrp, rsrq, rssnr, CellInfo.UNAVAILABLE, cqi, timingAdvance); } - /** @hide */ - public CellSignalStrengthLte(android.hardware.radio.V1_0.LteSignalStrength lte) { - // Convert from HAL values as part of construction. - this(convertRssiAsuToDBm(lte.signalStrength), - lte.rsrp != CellInfo.UNAVAILABLE ? -lte.rsrp : lte.rsrp, - lte.rsrq != CellInfo.UNAVAILABLE ? -lte.rsrq : lte.rsrq, - convertRssnrUnitFromTenDbToDB(lte.rssnr), lte.cqi, lte.timingAdvance); - } - - /** @hide */ - public CellSignalStrengthLte(android.hardware.radio.V1_6.LteSignalStrength lte) { - // Convert from HAL values as part of construction. - this(convertRssiAsuToDBm(lte.base.signalStrength), - lte.base.rsrp != CellInfo.UNAVAILABLE ? -lte.base.rsrp : lte.base.rsrp, - lte.base.rsrq != CellInfo.UNAVAILABLE ? -lte.base.rsrq : lte.base.rsrq, - convertRssnrUnitFromTenDbToDB(lte.base.rssnr), lte.cqiTableIndex, lte.base.cqi, - lte.base.timingAdvance); - } - /** @hide */ public CellSignalStrengthLte(CellSignalStrengthLte s) { copyFrom(s); @@ -617,11 +598,13 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P Rlog.w(LOG_TAG, s); } - private static int convertRssnrUnitFromTenDbToDB(int rssnr) { + /** @hide */ + public static int convertRssnrUnitFromTenDbToDB(int rssnr) { return rssnr / 10; } - private static int convertRssiAsuToDBm(int rssiAsu) { + /** @hide */ + public static int convertRssiAsuToDBm(int rssiAsu) { if (rssiAsu == SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN) { return CellInfo.UNAVAILABLE; } diff --git a/telephony/java/android/telephony/CellSignalStrengthNr.java b/telephony/java/android/telephony/CellSignalStrengthNr.java index 6ada32e1a86d7..cd22abddd3a7e 100644 --- a/telephony/java/android/telephony/CellSignalStrengthNr.java +++ b/telephony/java/android/telephony/CellSignalStrengthNr.java @@ -201,30 +201,13 @@ public final class CellSignalStrengthNr extends CellSignalStrength implements Pa ssRsrp, ssRsrq, ssSinr); } - /** - * @hide - * @param ss signal strength from modem. - */ - public CellSignalStrengthNr(android.hardware.radio.V1_4.NrSignalStrength ss) { - this(flip(ss.csiRsrp), flip(ss.csiRsrq), ss.csiSinr, flip(ss.ssRsrp), flip(ss.ssRsrq), - ss.ssSinr); - } - - /** - * @hide - * @param ss signal strength from modem. - */ - public CellSignalStrengthNr(android.hardware.radio.V1_6.NrSignalStrength ss) { - this(flip(ss.base.csiRsrp), flip(ss.base.csiRsrq), ss.base.csiSinr, ss.csiCqiTableIndex, - ss.csiCqiReport, flip(ss.base.ssRsrp), flip(ss.base.ssRsrq), ss.base.ssSinr); - } - /** * Flip sign cell strength value when taking in the value from hal * @param val cell strength value * @return flipped value + * @hide */ - private static int flip(int val) { + public static int flip(int val) { return val != CellInfo.UNAVAILABLE ? -val : val; } diff --git a/telephony/java/android/telephony/CellSignalStrengthTdscdma.java b/telephony/java/android/telephony/CellSignalStrengthTdscdma.java index e96f200280b64..8a7c70ec5ea90 100644 --- a/telephony/java/android/telephony/CellSignalStrengthTdscdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthTdscdma.java @@ -74,28 +74,6 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen updateLevel(null, null); } - /** @hide */ - public CellSignalStrengthTdscdma(android.hardware.radio.V1_0.TdScdmaSignalStrength tdscdma) { - // Convert from HAL values as part of construction. - this(CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, - tdscdma.rscp != CellInfo.UNAVAILABLE ? -tdscdma.rscp : tdscdma.rscp); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - - /** @hide */ - public CellSignalStrengthTdscdma(android.hardware.radio.V1_2.TdscdmaSignalStrength tdscdma) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(tdscdma.signalStrength), - tdscdma.bitErrorRate, getRscpDbmFromAsu(tdscdma.rscp)); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - /** @hide */ public CellSignalStrengthTdscdma(CellSignalStrengthTdscdma s) { copyFrom(s); diff --git a/telephony/java/android/telephony/CellSignalStrengthWcdma.java b/telephony/java/android/telephony/CellSignalStrengthWcdma.java index 8b14b74906790..f30440d951585 100644 --- a/telephony/java/android/telephony/CellSignalStrengthWcdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthWcdma.java @@ -94,30 +94,6 @@ public final class CellSignalStrengthWcdma extends CellSignalStrength implements updateLevel(null, null); } - /** @hide */ - public CellSignalStrengthWcdma(android.hardware.radio.V1_0.WcdmaSignalStrength wcdma) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(wcdma.signalStrength), wcdma.bitErrorRate, - CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - - /** @hide */ - public CellSignalStrengthWcdma(android.hardware.radio.V1_2.WcdmaSignalStrength wcdma) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(wcdma.base.signalStrength), - wcdma.base.bitErrorRate, - getRscpDbmFromAsu(wcdma.rscp), - getEcNoDbFromAsu(wcdma.ecno)); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - /** @hide */ public CellSignalStrengthWcdma(CellSignalStrengthWcdma s) { copyFrom(s); diff --git a/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java b/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java index e9262725d232f..bf418ab386484 100644 --- a/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java +++ b/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java @@ -44,12 +44,6 @@ public final class ClosedSubscriberGroupInfo implements Parcelable { mCsgIdentity = csgIdentity; } - /** @hide */ - public ClosedSubscriberGroupInfo( - @NonNull android.hardware.radio.V1_5.ClosedSubscriberGroupInfo csgInfo) { - this(csgInfo.csgIndication, csgInfo.homeNodebName, csgInfo.csgIdentity); - } - /** * Indicates whether the cell is restricted to only CSG members. * diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index b317c55571080..b7bc46736e185 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -144,64 +144,6 @@ public class SignalStrength implements Parcelable { mTimestampMillis = SystemClock.elapsedRealtime(); } - /** - * Constructor for Radio HAL V1.0 - * - * @hide - */ - public SignalStrength(android.hardware.radio.V1_0.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gw), - new CellSignalStrengthWcdma(), - new CellSignalStrengthTdscdma(signalStrength.tdScdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr()); - } - - /** - * Constructor for Radio HAL V1.2 - * - * @hide - */ - public SignalStrength(android.hardware.radio.V1_2.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gsm), - new CellSignalStrengthWcdma(signalStrength.wcdma), - new CellSignalStrengthTdscdma(signalStrength.tdScdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr()); - } - - /** - * Constructor for Radio HAL V1.4. - * - * @param signalStrength signal strength reported from modem. - * @hide - */ - public SignalStrength(android.hardware.radio.V1_4.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gsm), - new CellSignalStrengthWcdma(signalStrength.wcdma), - new CellSignalStrengthTdscdma(signalStrength.tdscdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr(signalStrength.nr)); - } - - /** - * Constructor for Radio HAL V1.6. - * - * @param signalStrength signal strength reported from modem. - * @hide - */ - public SignalStrength(android.hardware.radio.V1_6.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gsm), - new CellSignalStrengthWcdma(signalStrength.wcdma), - new CellSignalStrengthTdscdma(signalStrength.tdscdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr(signalStrength.nr)); - } - private CellSignalStrength getPrimary() { // This behavior is intended to replicate the legacy behavior of getLevel() by prioritizing // newer faster RATs for default/for display purposes.