Loading telephony/java/android/telephony/CellIdentity.java +83 −0 Original line number Diff line number Diff line Loading @@ -22,10 +22,13 @@ 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; import com.android.telephony.Rlog; import java.util.Objects; import java.util.UUID; Loading Loading @@ -323,6 +326,86 @@ 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; Loading Loading
telephony/java/android/telephony/CellIdentity.java +83 −0 Original line number Diff line number Diff line Loading @@ -22,10 +22,13 @@ 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; import com.android.telephony.Rlog; import java.util.Objects; import java.util.UUID; Loading Loading @@ -323,6 +326,86 @@ 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; Loading