NTP-47816 | Added wifi data in clickstream in post payment screen (#15388)
This commit is contained in:
@@ -19,6 +19,7 @@ import com.navi.common.network.models.GenericErrorResponse
|
||||
import com.navi.common.network.models.RepoResult
|
||||
import com.navi.common.utils.TemporaryStorageHelper
|
||||
import com.navi.pay.common.magiclocation.model.view.CellularInfoEntity
|
||||
import com.navi.pay.common.magiclocation.model.view.WifiInfoEntity
|
||||
import com.navi.pay.common.model.network.ValidateVpaResponse
|
||||
import com.navi.pay.common.model.view.CheckBalanceAnalyticsEventData
|
||||
import com.navi.pay.common.model.view.DeviceData
|
||||
@@ -3068,6 +3069,7 @@ class NaviPayAnalytics private constructor() {
|
||||
fun networkInfoData(
|
||||
isLocationPermissionGranted: Boolean,
|
||||
cellularInfoEntityList: List<CellularInfoEntity>,
|
||||
wifiInfoEntityList: List<WifiInfoEntity>,
|
||||
geocode: String,
|
||||
payeeVpa: String,
|
||||
payeeMcc: String,
|
||||
@@ -3077,6 +3079,7 @@ class NaviPayAnalytics private constructor() {
|
||||
mapOf(
|
||||
"isLocationPermissionGranted" to isLocationPermissionGranted.toString(),
|
||||
"cellularInfoEntityList" to cellularInfoEntityList.toString(),
|
||||
"wifiInfoEntityList" to wifiInfoEntityList.toString(),
|
||||
"geocode" to geocode,
|
||||
"vpa" to payeeVpa,
|
||||
"mcc" to payeeMcc,
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.pay.common.magiclocation.model.view
|
||||
|
||||
data class WifiInfoEntity(val ssid: String = "", val bssid: String = "")
|
||||
@@ -11,6 +11,7 @@ import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.wifi.WifiManager
|
||||
import android.os.Build
|
||||
import android.telephony.CellInfoCdma
|
||||
import android.telephony.CellInfoGsm
|
||||
@@ -21,12 +22,15 @@ import android.telephony.CellInfoWcdma
|
||||
import android.telephony.TelephonyManager
|
||||
import androidx.core.app.ActivityCompat
|
||||
import com.navi.pay.common.magiclocation.model.view.CellularInfoEntity
|
||||
import com.navi.pay.common.magiclocation.model.view.WifiInfoEntity
|
||||
import com.navi.pay.utils.NAVI_PAY_UNKNOWN
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import javax.inject.Inject
|
||||
|
||||
interface NetworkInfoDataProvider {
|
||||
suspend fun getCellularInfoData(): List<CellularInfoEntity>
|
||||
|
||||
suspend fun getWifiInfoData(): List<WifiInfoEntity>
|
||||
}
|
||||
|
||||
class NetworkInfoDataProviderImpl
|
||||
@@ -84,4 +88,23 @@ constructor(@ApplicationContext private val context: Context) : NetworkInfoDataP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
override suspend fun getWifiInfoData(): List<WifiInfoEntity> {
|
||||
|
||||
val wifiManager =
|
||||
context.applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager
|
||||
|
||||
return wifiManager?.scanResults?.map {
|
||||
WifiInfoEntity(
|
||||
ssid =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
it.wifiSsid?.bytes?.toString(Charsets.UTF_8) ?: "Unknown SSID"
|
||||
} else {
|
||||
it.SSID
|
||||
},
|
||||
bssid = it.BSSID,
|
||||
)
|
||||
} ?: emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -934,6 +934,7 @@ constructor(
|
||||
naviPayAnalytics.networkInfoData(
|
||||
isLocationPermissionGranted = false,
|
||||
cellularInfoEntityList = emptyList(),
|
||||
wifiInfoEntityList = emptyList(),
|
||||
geocode = locationUseCase.execute(),
|
||||
payeeVpa = transactionEntity.value?.otherUserVpa ?: "",
|
||||
payeeMcc = transactionEntity.value?.transactionDetailEntity?.payeeInfo?.mcc ?: "",
|
||||
@@ -944,6 +945,7 @@ constructor(
|
||||
naviPayAnalytics.networkInfoData(
|
||||
isLocationPermissionGranted = true,
|
||||
cellularInfoEntityList = networkInfoDataProvider.getCellularInfoData(),
|
||||
wifiInfoEntityList = networkInfoDataProvider.getWifiInfoData(),
|
||||
geocode = locationUseCase.execute(),
|
||||
payeeVpa = transactionEntity.value?.otherUserVpa ?: "",
|
||||
payeeMcc = transactionEntity.value?.transactionDetailEntity?.payeeInfo?.mcc ?: "",
|
||||
|
||||
Reference in New Issue
Block a user