NTP-58492 | Updated params for cell type based on backend contract (#15998)
This commit is contained in:
@@ -34,14 +34,14 @@ data class CellularInfoEntity(
|
||||
val cellInfoType: String = "",
|
||||
val isRegistered: Boolean = false,
|
||||
val cellConnectionStatus: String = "",
|
||||
val ci: Int = 0,
|
||||
val pci: Int = 0,
|
||||
val tac: Int = 0,
|
||||
val mcc: Int = 0,
|
||||
val mnc: Int = 0,
|
||||
val rssi: Int = 0,
|
||||
val rsrp: Int = 0,
|
||||
val rsrq: Int = 0,
|
||||
val ci: String = "",
|
||||
val pci: String = "",
|
||||
val tac: String = "",
|
||||
val mcc: String = "",
|
||||
val mnc: String = "",
|
||||
val rssi: String = "",
|
||||
val rsrp: String = "",
|
||||
val rsrq: String = "",
|
||||
val isInternetSource: Boolean = false,
|
||||
)
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ data class CellularInfo(
|
||||
@SerializedName("cellInfoType") val cellInfoType: String,
|
||||
@SerializedName("isRegistered") val isRegistered: Boolean,
|
||||
@SerializedName("cellConnectionStatus") val cellConnectionStatus: String,
|
||||
@SerializedName("ci") val ci: Int,
|
||||
@SerializedName("pci") val pci: Int,
|
||||
@SerializedName("tac") val tac: Int,
|
||||
@SerializedName("mcc") val mcc: Int,
|
||||
@SerializedName("mnc") val mnc: Int,
|
||||
@SerializedName("rssi") val rssi: Int,
|
||||
@SerializedName("rsrp") val rsrp: Int,
|
||||
@SerializedName("rsrq") val rsrq: Int,
|
||||
@SerializedName("ci") val ci: String,
|
||||
@SerializedName("pci") val pci: String,
|
||||
@SerializedName("tac") val tac: String,
|
||||
@SerializedName("mcc") val mcc: String,
|
||||
@SerializedName("mnc") val mnc: String,
|
||||
@SerializedName("rssi") val rssi: String,
|
||||
@SerializedName("rsrp") val rsrp: String,
|
||||
@SerializedName("rsrq") val rsrq: String,
|
||||
@SerializedName("isInternetSource") val isInternetSource: Boolean,
|
||||
)
|
||||
|
||||
@@ -39,6 +39,6 @@ data class WifiInfo(
|
||||
)
|
||||
|
||||
data class Geolocation(
|
||||
@SerializedName("latitude") val latitude: String? = null,
|
||||
@SerializedName("longitude") val longitude: String? = null,
|
||||
@SerializedName("latitude") val latitude: Double? = null,
|
||||
@SerializedName("longitude") val longitude: Double? = null,
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.cache.model.NaviCacheEntity
|
||||
import com.navi.base.cache.repository.NaviCacheRepository
|
||||
import com.navi.base.utils.TrustedTimeAccessor
|
||||
import com.navi.base.utils.toDoubleWithSafe
|
||||
import com.navi.common.checkmate.model.MetricInfo
|
||||
import com.navi.common.constants.GEO_NETWORK_SIGNATURE_LAST_SYNC_TS_KEY
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
|
||||
@@ -110,8 +111,8 @@ constructor(
|
||||
geolocation =
|
||||
if (isLocationPermissionAvailable) {
|
||||
Geolocation(
|
||||
latitude = CommonUtils.getUserLocation()?.latitude,
|
||||
longitude = CommonUtils.getUserLocation()?.longitude,
|
||||
latitude = CommonUtils.getUserLocation()?.latitude?.toDoubleWithSafe(),
|
||||
longitude = CommonUtils.getUserLocation()?.longitude?.toDoubleWithSafe(),
|
||||
)
|
||||
} else null,
|
||||
)
|
||||
|
||||
@@ -33,32 +33,32 @@ fun CellInfoLte.getCellularInfoEntity(context: Context): CellularInfoEntity {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
this.cellConnectionStatus.toString()
|
||||
} else "Unknown",
|
||||
ci = cellIdentity.ci,
|
||||
pci = cellIdentity.pci,
|
||||
tac = cellIdentity.tac,
|
||||
ci = cellIdentity.ci.toString(),
|
||||
pci = cellIdentity.pci.toString(),
|
||||
tac = cellIdentity.tac.toString(),
|
||||
mcc =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.mccString?.toInt() ?: 0
|
||||
cellIdentity.mccString ?: ""
|
||||
} else {
|
||||
val mcc = cellIdentity.mcc
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc else 0
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc.toString() else ""
|
||||
},
|
||||
mnc =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.mncString?.toInt() ?: 0
|
||||
cellIdentity.mncString ?: ""
|
||||
} else {
|
||||
val mcc = cellIdentity.mnc
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc else 0
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc.toString() else ""
|
||||
},
|
||||
rssi = signalStrength.dbm,
|
||||
rssi = signalStrength.dbm.toString(),
|
||||
rsrp =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
signalStrength.rsrp
|
||||
} else 0,
|
||||
signalStrength.rsrp.toString()
|
||||
} else "",
|
||||
rsrq =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
signalStrength.rsrq
|
||||
} else 0,
|
||||
signalStrength.rsrq.toString()
|
||||
} else "",
|
||||
isInternetSource = getIsCellularInternetSource(context),
|
||||
)
|
||||
}
|
||||
@@ -89,26 +89,26 @@ fun CellInfoGsm.getCellularInfoEntity(context: Context): CellularInfoEntity {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
this.cellConnectionStatus.toString()
|
||||
} else "Unknown",
|
||||
ci = cellIdentity.cid,
|
||||
ci = cellIdentity.cid.toString(),
|
||||
tac =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.lac
|
||||
} else 0,
|
||||
cellIdentity.lac.toString()
|
||||
} else "",
|
||||
mcc =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.mccString?.toInt() ?: 0
|
||||
cellIdentity.mccString ?: ""
|
||||
} else {
|
||||
val mcc = cellIdentity.mcc
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc else 0
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc.toString() else ""
|
||||
},
|
||||
mnc =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.mncString?.toInt() ?: 0
|
||||
cellIdentity.mncString ?: ""
|
||||
} else {
|
||||
val mcc = cellIdentity.mnc
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc else 0
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc.toString() else ""
|
||||
},
|
||||
rssi = signalStrength.dbm,
|
||||
rssi = signalStrength.dbm.toString(),
|
||||
isInternetSource = getIsCellularInternetSource(context),
|
||||
)
|
||||
}
|
||||
@@ -124,27 +124,27 @@ fun CellInfoWcdma.getCellularInfoEntity(context: Context): CellularInfoEntity {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
this.cellConnectionStatus.toString()
|
||||
} else "Unknown",
|
||||
ci = cellIdentity.cid,
|
||||
pci = cellIdentity.psc,
|
||||
ci = cellIdentity.cid.toString(),
|
||||
pci = cellIdentity.psc.toString(),
|
||||
tac =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.lac
|
||||
} else 0,
|
||||
cellIdentity.lac.toString()
|
||||
} else "",
|
||||
mcc =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.mccString?.toInt() ?: 0
|
||||
cellIdentity.mccString ?: ""
|
||||
} else {
|
||||
val mcc = cellIdentity.mcc
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc else 0
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc.toString() else ""
|
||||
},
|
||||
mnc =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
cellIdentity.mncString?.toInt() ?: 0
|
||||
cellIdentity.mncString ?: ""
|
||||
} else {
|
||||
val mcc = cellIdentity.mnc
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc else 0
|
||||
if (mcc != Integer.MAX_VALUE && mcc != -1) mcc.toString() else ""
|
||||
},
|
||||
rssi = signalStrength.dbm,
|
||||
rssi = signalStrength.dbm.toString(),
|
||||
isInternetSource = getIsCellularInternetSource(context),
|
||||
)
|
||||
}
|
||||
@@ -160,9 +160,9 @@ fun CellInfoCdma.getCellularInfoEntity(context: Context): CellularInfoEntity {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
this.cellConnectionStatus.toString()
|
||||
} else "Unknown",
|
||||
ci = cellIdentity.basestationId,
|
||||
pci = cellIdentity.networkId,
|
||||
rssi = signalStrength.dbm,
|
||||
ci = cellIdentity.basestationId.toString(),
|
||||
pci = cellIdentity.networkId.toString(),
|
||||
rssi = signalStrength.dbm.toString(),
|
||||
isInternetSource = getIsCellularInternetSource(context),
|
||||
)
|
||||
}
|
||||
@@ -176,12 +176,12 @@ fun CellInfoTdscdma.getCellularInfoEntity(context: Context): CellularInfoEntity
|
||||
cellInfoType = CellInfoTdscdma::class.java.simpleName,
|
||||
isRegistered = this.isRegistered,
|
||||
cellConnectionStatus = this.cellConnectionStatus.toString(),
|
||||
ci = cellIdentity.cid,
|
||||
pci = cellIdentity.cpid,
|
||||
tac = cellIdentity.lac,
|
||||
mcc = cellIdentity.mccString?.toInt() ?: 0,
|
||||
mnc = cellIdentity.mncString?.toInt() ?: 0,
|
||||
rssi = signalStrength.dbm,
|
||||
ci = cellIdentity.cid.toString(),
|
||||
pci = cellIdentity.cpid.toString(),
|
||||
tac = cellIdentity.lac.toString(),
|
||||
mcc = cellIdentity.mccString ?: "",
|
||||
mnc = cellIdentity.mncString ?: "",
|
||||
rssi = signalStrength.dbm.toString(),
|
||||
isInternetSource = getIsCellularInternetSource(context),
|
||||
)
|
||||
}
|
||||
@@ -195,14 +195,14 @@ fun CellInfoNr.getCellularInfoEntity(context: Context): CellularInfoEntity {
|
||||
cellInfoType = CellInfoNr::class.java.simpleName,
|
||||
isRegistered = this.isRegistered,
|
||||
cellConnectionStatus = this.cellConnectionStatus.toString(),
|
||||
ci = cellIdentity.nci.toInt(),
|
||||
pci = cellIdentity.pci,
|
||||
tac = cellIdentity.tac,
|
||||
mcc = cellIdentity.mccString?.toInt() ?: 0,
|
||||
mnc = cellIdentity.mncString?.toInt() ?: 0,
|
||||
rsrp = signalStrength.csiRsrp,
|
||||
rsrq = signalStrength.csiRsrq,
|
||||
rssi = signalStrength.dbm,
|
||||
ci = cellIdentity.nci.toString(),
|
||||
pci = cellIdentity.pci.toString(),
|
||||
tac = cellIdentity.tac.toString(),
|
||||
mcc = cellIdentity.mccString ?: "",
|
||||
mnc = cellIdentity.mncString ?: "",
|
||||
rsrp = signalStrength.csiRsrp.toString(),
|
||||
rsrq = signalStrength.csiRsrq.toString(),
|
||||
rssi = signalStrength.dbm.toString(),
|
||||
isInternetSource = getIsCellularInternetSource(context),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user