NTP-7562 | Bump com.diffplug.spotless from 6.25.0 to 7.0.0 (#288)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivam Goyal <shivam.goyal@navi.com>
This commit is contained in:
dependabot[bot]
2025-01-07 03:29:29 -08:00
committed by GitHub
parent c7511f5bc1
commit 9fc691bf71
36 changed files with 206 additions and 204 deletions

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023-2024 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -35,7 +35,7 @@ class AlfredDemoApplication : Application(), Application.ActivityLifecycleCallba
"1020",
"4.9.9",
"qa",
"oMv77fgpBg9NFGom0Psizbf7lbrdBVJz"
"oMv77fgpBg9NFGom0Psizbf7lbrdBVJz",
)
AlfredManager.init(alfredConfig, this, 27, "Critical Journey")
@@ -45,7 +45,7 @@ class AlfredDemoApplication : Application(), Application.ActivityLifecycleCallba
cruiseApiSuccessful = { response ->
Log.d(
"Alfred",
"Alfred - getAlfredCruiseInfo cruiseApiSuccessful h response = $response"
"Alfred - getAlfredCruiseInfo cruiseApiSuccessful h response = $response",
)
}
)
@@ -68,7 +68,7 @@ class AlfredDemoApplication : Application(), Application.ActivityLifecycleCallba
"SCREEN_NAME" to ("Alfred Demo App"),
"METHOD_NAME" to it.cause?.stackTrace?.get(0)?.methodName.orEmpty(),
"LINE_NUMBER" to it.cause?.stackTrace?.get(0)?.lineNumber.toString(),
"APP_IN_FOREGROUND" to isAppInForeground().toString()
"APP_IN_FOREGROUND" to isAppInForeground().toString(),
)
anrEventProperties["STACK_TRACE"] = it.cause?.stackTrace?.get(0).toString()
AlfredManager.handleAnrEvent(anrEventProperties)
@@ -88,7 +88,7 @@ class AlfredDemoApplication : Application(), Application.ActivityLifecycleCallba
"SCREEN_NAME" to ("Alfred Demo App"),
"METHOD_NAME" to exception.stackTrace[0]?.methodName.orEmpty(),
"LINE_NUMBER" to exception.stackTrace[0]?.lineNumber.toString(),
"APP_IN_FOREGROUND" to isAppInForeground().toString()
"APP_IN_FOREGROUND" to isAppInForeground().toString(),
)
exception.stackTrace[0]?.let { stackTraceElement ->
crashEventProperties["STACK_TRACE"] = stackTraceElement.toString()
@@ -147,7 +147,7 @@ class AlfredDemoApplication : Application(), Application.ActivityLifecycleCallba
activity = activity,
screenName = screenName,
moduleName = moduleName,
applicationContext = applicationContext
applicationContext = applicationContext,
)
} catch (e: Exception) {
e.log()

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -34,7 +34,7 @@ class AlfredNetworkFailureReceiver : BroadcastReceiver() {
CoroutineScope(Dispatchers.IO).launch {
Log.d(
"AlfredNetworkFailure",
"Network Failure exception = $exception, request = $request, errorMessage = $errorMessage"
"Network Failure exception = $exception, request = $request, errorMessage = $errorMessage",
)
}
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023-2024 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -27,7 +27,7 @@ class SWWActivity : AppCompatActivity() {
screenName = "SWW Activity",
moduleName = "Alfred Demo App",
statusCode = 400,
networkType = "WIFI"
networkType = "WIFI",
)
}
}
@@ -47,7 +47,7 @@ class SWWActivity : AppCompatActivity() {
screenName: String?,
moduleName: String,
statusCode: Int?,
networkType: String?
networkType: String?,
) {
val swwEventProperties =
mapOf(
@@ -56,7 +56,7 @@ class SWWActivity : AppCompatActivity() {
Pair("code", code.orEmpty()),
Pair("screen_name", screenName.orEmpty()),
Pair("status_code", statusCode.toString()),
Pair("network_type", networkType.orEmpty())
Pair("network_type", networkType.orEmpty()),
)
AlfredManager.handleSWWEvent(swwEventProperties)
}

View File

@@ -16,7 +16,7 @@ ksp = "2.1.0-1.0.29"
loggingInterceptor = "4.12.0"
retrofit = "2.11.0"
room = "2.5.2"
spotless = "6.25.0"
spotless = "7.0.0"
[libraries]
android-material = { module = "com.google.android.material:material", version.ref = "android-material" }

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -67,27 +67,27 @@ data class AlfredConfig(
internal var imageType: String = AlfredConstants.IMAGE_TYPE_JPEG,
internal var alfredTimeGap: Long = 0,
internal var isPixelCopyEnabled: Boolean = true,
internal var zipFileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION
internal var zipFileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION,
) {
constructor(
appName: String,
appVersionCode: String,
appVersionName: String,
flavor: String,
apiKey: String
apiKey: String,
) : this(
appVersionCode = appVersionCode,
appVersionName = appVersionName,
appName = appName,
flavor = flavor,
apiKey = apiKey,
disableAlfredLogs = false
disableAlfredLogs = false,
)
fun getDeviceId(): String =
Settings.System.getString(
AlfredManager.applicationContext.contentResolver,
Settings.Secure.ANDROID_ID
Settings.Secure.ANDROID_ID,
)
fun setEventStartRecordingTime(setToNext: Boolean? = false) {
@@ -338,8 +338,8 @@ data class AlfredConfig(
DeviceAttributes(
battery = getBatteryPercentage(),
storage = getStorageUsage(),
memory = getMemoryUsagePercentage()
)
memory = getMemoryUsagePercentage(),
),
)
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -117,7 +117,7 @@ object AlfredManager {
config: AlfredConfig,
context: Context,
criticalJourneyResponseCode: Int,
criticalJourneyResponseMessage: String
criticalJourneyResponseMessage: String,
) {
this.config = config
this.applicationContext = context
@@ -136,7 +136,7 @@ object AlfredManager {
screenName: String? = null,
moduleName: String,
activity: Activity? = null,
applicationContext: Context
applicationContext: Context,
) {
isActivityResumed = true
if (isAlfredRecordingEnabled() || !isCruiseApiCalled) {
@@ -169,7 +169,7 @@ object AlfredManager {
buildEvent(
AlfredConstants.START_RECORDING_EVENT,
screenName = currentScreenName,
moduleName = currentModuleName
moduleName = currentModuleName,
)
AlfredDispatcher.addTaskToQueue(AddEventTask(startRecordingEvent, context))
hasRecordingStarted = true
@@ -210,7 +210,7 @@ object AlfredManager {
insertScreenShotPathInDb(
this,
applicationContext,
bmpForThirdPartySdkScreen
bmpForThirdPartySdkScreen,
)
} else {
if (bmpForCanvas == null) {
@@ -226,7 +226,7 @@ object AlfredManager {
canvas = bmpForCanvas?.first,
bmp = bmpForCanvas?.second,
moduleName = currentModuleName,
activity = currentActivity?.get()
activity = currentActivity?.get(),
)
}
} catch (e: Exception) {
@@ -246,7 +246,7 @@ object AlfredManager {
canvas = bmpForCanvas?.first,
bmp = bmpForCanvas?.second,
moduleName = currentModuleName,
activity = currentActivity?.get()
activity = currentActivity?.get(),
)
}
} catch (e: Exception) {
@@ -276,7 +276,7 @@ object AlfredManager {
buildEvent(
AlfredConstants.STOP_RECORDING_EVENT,
screenName = currentScreenName,
moduleName = currentModuleName
moduleName = currentModuleName,
)
AlfredDispatcher.addTaskToQueue(AddEventTask(stopRecordingEvent, applicationContext))
if (ScreenShotStorageHelper.images.size > 0) {
@@ -328,7 +328,7 @@ object AlfredManager {
fun handleTouchEvent(
currentTouchEvent: MotionEvent?,
screenName: String? = null,
moduleName: String? = null
moduleName: String? = null,
) {
if (isAlfredRecordingEnabled()) {
if (config.getAlfredSessionId().isNotEmpty()) {
@@ -352,7 +352,7 @@ object AlfredManager {
touchEventData.first,
touchEventData.second,
screenName = screenName,
moduleName = moduleName
moduleName = moduleName,
)
AlfredDispatcher.addTaskToQueue(AddEventTask(event, applicationContext))
}
@@ -373,7 +373,7 @@ object AlfredManager {
buildEvent(
AlfredConstants.SCREEN_TRANSITION_EVENT,
screenName = screenName,
moduleName = moduleName
moduleName = moduleName,
)
AlfredDispatcher.addTaskToQueue(AddEventTask(event, applicationContext))
} catch (e: Exception) {
@@ -396,7 +396,7 @@ object AlfredManager {
AlfredConstants.ANR_EVENT,
anrEventProperties as HashMap<String, String>,
screenName = currentScreenName,
moduleName = currentModuleName
moduleName = currentModuleName,
)
AlfredDispatcher.addTaskToQueue(AddNegativeCase(event, this.applicationContext))
}
@@ -417,7 +417,7 @@ object AlfredManager {
AlfredConstants.CRASH_ANALYTICS_EVENT,
crashEventProperties as HashMap<String, String>,
screenName = currentScreenName,
moduleName = currentModuleName
moduleName = currentModuleName,
)
AlfredDispatcher.addTaskToQueue(AddNegativeCase(event, applicationContext))
}
@@ -434,7 +434,7 @@ object AlfredManager {
AlfredConstants.ERROR_LOG,
swwEventProperties as HashMap<String, String>,
screenName = currentScreenName,
moduleName = currentModuleName
moduleName = currentModuleName,
)
AlfredDispatcher.addTaskToQueue(AddNegativeCase(event, applicationContext))
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -27,10 +27,10 @@ import com.navi.alfred.db.model.ZipDetailsHelper
ScreenShotPathHelper::class,
ZipDetailsHelper::class,
NegativeCase::class,
FailureEvent::class
FailureEvent::class,
],
version = 8,
exportSchema = true
exportSchema = true,
)
abstract class AlfredDatabase : RoomDatabase() {
abstract fun analyticsDao(): AnalyticsDAO

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -14,7 +14,7 @@ import com.navi.alfred.model.DeviceAttributes
@Entity
data class AnalyticsEvent(
@ColumnInfo(name = "time") val time: Long?,
@ColumnInfo(name = "details") val details: String?
@ColumnInfo(name = "details") val details: String?,
) {
@PrimaryKey(autoGenerate = true) var eventId: Int = 0
}
@@ -22,7 +22,7 @@ data class AnalyticsEvent(
@Entity
data class ScreenShotPathHelper(
@ColumnInfo(name = "time") val time: Long?,
@ColumnInfo(name = "screenShotPath") val screenShotPath: String?
@ColumnInfo(name = "screenShotPath") val screenShotPath: String?,
) {
@PrimaryKey(autoGenerate = true) var id: Int = 0
}
@@ -36,7 +36,7 @@ data class ZipDetailsHelper(
@ColumnInfo(name = "alfredEventId") val alfredEventId: String,
@ColumnInfo(name = "latestScreenshotTimestamp") val latestScreenshotTimestamp: Long,
@ColumnInfo(name = "zipUploadStatus") val zipUploadStatus: Boolean,
@ColumnInfo(name = "fileTypeExtension") val fileTypeExtension: String
@ColumnInfo(name = "fileTypeExtension") val fileTypeExtension: String,
) {
@PrimaryKey(autoGenerate = true) var id: Int = 0
}
@@ -44,7 +44,7 @@ data class ZipDetailsHelper(
@Entity
data class NegativeCase(
@ColumnInfo(name = "time") val time: Long?,
@ColumnInfo(name = "details") val details: String?
@ColumnInfo(name = "details") val details: String?,
) {
@PrimaryKey(autoGenerate = true) var negativeCaseId: Int = 0
}
@@ -52,7 +52,7 @@ data class NegativeCase(
@Entity
data class FailureEvent(
@ColumnInfo(name = "time") val time: Long?,
@ColumnInfo(name = "details") val details: String?
@ColumnInfo(name = "details") val details: String?,
) {
@PrimaryKey(autoGenerate = true) var eventId: Int = 0
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -17,7 +17,7 @@ class AnalyticsDataDeserializer : JsonDeserializer<AnalyticsRequest> {
override fun deserialize(
json: JsonElement?,
typeOfT: Type?,
context: JsonDeserializationContext?
context: JsonDeserializationContext?,
): AnalyticsRequest? {
json?.let {
return context?.deserialize(json, AnalyticsRequest::class.java)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -18,7 +18,7 @@ class FailureDataDeserializer : JsonDeserializer<FailureRequest> {
override fun deserialize(
json: JsonElement?,
typeOfT: Type?,
context: JsonDeserializationContext?
context: JsonDeserializationContext?,
): FailureRequest? {
Timber.d("FailureDataDeserializer deserialize: $json")
json?.let {

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -17,7 +17,7 @@ class SessionDataDeserializer : JsonDeserializer<SessionRequest> {
override fun deserialize(
json: JsonElement?,
typeOfT: Type?,
context: JsonDeserializationContext?
context: JsonDeserializationContext?,
): SessionRequest? {
json?.let {
return context?.deserialize(json, SessionRequest::class.java)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -23,5 +23,5 @@ data class WorkManagerFailureInputData(
val alfredEventId: String,
val latestScreenshotTimestamp: Long = 0L,
var retryCount: Int = 0,
var fileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION
var fileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION,
)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -12,7 +12,7 @@ import com.navi.alfred.AlfredManager
data class FailureRequest(
@SerializedName("failure_attributes") val failureAttributes: FailureAttributes? = null,
@SerializedName("failures") val events: List<Failure>? = null
@SerializedName("failures") val events: List<Failure>? = null,
)
data class Failure(
@@ -30,7 +30,7 @@ data class Failure(
val sessionId: String? = AlfredManager.config.getAlfredSessionId(),
@SerializedName("network_strength")
val networkStrength: Float? = AlfredManager.config.getNetworkStrength(),
@SerializedName("event_id_list") val eventIdList: List<String>? = null
@SerializedName("event_id_list") val eventIdList: List<String>? = null,
)
data class FailureAttributes(
@@ -43,5 +43,5 @@ data class FailureAttributes(
val appVersionCode: String? = AlfredManager.config.getAppVersionCode(),
@SerializedName("app_version_name")
val appVersionName: String? = AlfredManager.config.getAppVersionName(),
@SerializedName("session_id") val sessionId: String? = AlfredManager.config.getAlfredSessionId()
@SerializedName("session_id") val sessionId: String? = AlfredManager.config.getAlfredSessionId(),
)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -12,5 +12,5 @@ data class NaviMotionEvent(
var pointerPositionX: Float? = null,
var pointerPositionY: Float? = null,
var rawX: Float? = null,
var rawY: Float? = null
var rawY: Float? = null,
)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -15,7 +15,7 @@ import com.navi.alfred.utils.AlfredConstants.NETWORK_TYPE
data class AnalyticsRequest(
@SerializedName("base_attributes") val baseAttribute: BaseAttribute? = null,
@SerializedName("events") val events: List<EventAttribute>? = null
@SerializedName("events") val events: List<EventAttribute>? = null,
)
data class EventAttribute(
@@ -31,13 +31,13 @@ data class EventAttribute(
@SerializedName("zip_name") val zipName: String? = null,
@SerializedName("session_time_stamp")
val sessionTimeStamp: Long? = AlfredManager.config.getSessionStartRecordingTime(),
@SerializedName("screenshot_timestamp") val screenShotTimeStamp: Long? = null
@SerializedName("screenshot_timestamp") val screenShotTimeStamp: Long? = null,
)
data class SessionRequest(
@SerializedName("base_attributes") val base_attribute: BaseAttribute,
@SerializedName("session_upload_event_attributes")
val session_upload_event_attributes: SessionEventAttribute
val session_upload_event_attributes: SessionEventAttribute,
)
data class BaseAttribute(
@@ -74,14 +74,14 @@ data class BaseAttribute(
val phoneNumber: String? = AlfredManager.config.getPhoneNumber(),
@SerializedName("image_type") val imageType: String? = AlfredManager.config.imageType,
@SerializedName("file_type_extension")
val fileTypeExtension: String? = AlfredManager.config.zipFileTypeExtension
val fileTypeExtension: String? = AlfredManager.config.zipFileTypeExtension,
)
data class SessionEventAttribute(
@SerializedName("event_id") val eventId: String? = null,
@SerializedName("beginning_device_attributes")
val beginningDeviceAttributes: DeviceAttributes? = null,
@SerializedName("end_device_attributes") val endDeviceAttributes: DeviceAttributes? = null
@SerializedName("end_device_attributes") val endDeviceAttributes: DeviceAttributes? = null,
)
data class DeviceAttributes(
@@ -97,11 +97,11 @@ data class MetaData(
@SerializedName("agent_email_id")
val agentEmailId: String? = AlfredManager.config.getAgentEmailId(),
@SerializedName("code_push_version")
val codePushVersion: String? = AlfredManager.config.getCodePushVersion()
val codePushVersion: String? = AlfredManager.config.getCodePushVersion(),
)
data class CruiseAttributes(
@SerializedName(NETWORK_TYPE) val networkType: String? = null,
@SerializedName(NETWORK_STRENGTH) val networkStrength: Float? = null,
@SerializedName(DEVICE_ATTRIBUTES) val deviceAttributes: DeviceAttributes? = null
@SerializedName(DEVICE_ATTRIBUTES) val deviceAttributes: DeviceAttributes? = null,
)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -21,6 +21,6 @@ interface AlfredFailureRetrofitService {
@Header(CONTENT_TYPE) contentType: String,
@Header(X_TARGET) target: String,
@Header(X_API_KEY) apiKey: String,
@Body failureRequest: FailureRequest
@Body failureRequest: FailureRequest,
): Response<Unit>
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -21,69 +21,69 @@ class AlfredNetworkRepository {
suspend fun sendEvents(
url: String,
apiKey: String,
analyticsRequest: AnalyticsRequest
analyticsRequest: AnalyticsRequest,
): Response<Unit> {
return AlfredRetrofitProvider.apiService.sendEvents(
url,
"application/json",
ALFRED,
apiKey,
analyticsRequest
analyticsRequest,
)
}
suspend fun sendNegativeCase(
url: String,
apiKey: String,
analyticsRequest: AnalyticsRequest
analyticsRequest: AnalyticsRequest,
): Response<Unit> {
return AlfredRetrofitProvider.apiService.sendNegativeCase(
url,
"application/json",
ALFRED,
apiKey,
analyticsRequest
analyticsRequest,
)
}
suspend fun getPreSignedUrl(
sessionId: String,
apiKey: String,
fileTypeExtension: String
fileTypeExtension: String,
): Response<PreSignedUrlResponse> {
return AlfredRetrofitProvider.apiService.getPreSignedUrl(
sessionId,
ALFRED,
apiKey,
fileTypeExtension
fileTypeExtension,
)
}
suspend fun sendSession(
url: String,
apiKey: String,
sessionRequest: SessionRequest
sessionRequest: SessionRequest,
): Response<Unit> {
return AlfredRetrofitProvider.apiService.sendSession(
url,
"application/json",
apiKey,
ALFRED,
sessionRequest
sessionRequest,
)
}
suspend fun sendFailure(
url: String,
apiKey: String,
failureRequest: FailureRequest
failureRequest: FailureRequest,
): Response<Unit> {
return AlfredFailureRetrofitProvider.apiService.sendFailure(
url,
"application/json",
ALFRED,
apiKey,
failureRequest
failureRequest,
)
}
@@ -98,7 +98,7 @@ class AlfredNetworkRepository {
osVersionCode: String,
deviceId: String,
apiKey: String,
cruiseAttributes: CruiseAttributes
cruiseAttributes: CruiseAttributes,
): Response<CruiseResponse> {
return AlfredRetrofitProvider.apiService.getCruiseConfig(
url,

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -110,7 +110,7 @@ object AlfredRetrofitProvider {
GsonBuilder()
.registerTypeAdapter(
com.navi.alfred.model.AnalyticsRequest::class.java,
AnalyticsDataDeserializer()
AnalyticsDataDeserializer(),
)
.registerTypeAdapter(SessionRequest::class.java, SessionDataDeserializer())
.create()

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -35,7 +35,7 @@ interface AlfredRetrofitService {
@Header(CONTENT_TYPE) contentType: String,
@Header(X_TARGET) target: String,
@Header(X_API_KEY) apiKey: String,
@Body analyticsRequest: AnalyticsRequest
@Body analyticsRequest: AnalyticsRequest,
): Response<Unit>
@GET("v2/ingest/session/pre-sign/{sessionId}")
@@ -43,7 +43,7 @@ interface AlfredRetrofitService {
@Path(SESSION_ID) sessionId: String,
@Header(X_TARGET) target: String,
@Header(X_API_KEY) apiKey: String,
@Query("fileTypeExtension") fileTypeExtension: String
@Query("fileTypeExtension") fileTypeExtension: String,
): Response<PreSignedUrlResponse>
@PUT
@@ -59,7 +59,7 @@ interface AlfredRetrofitService {
@Header(CONTENT_TYPE) contentType: String,
@Header(X_API_KEY) apiKey: String,
@Header(X_TARGET) target: String,
@Body sessionRequest: SessionRequest
@Body sessionRequest: SessionRequest,
): Response<Unit>
@GET
@@ -75,7 +75,7 @@ interface AlfredRetrofitService {
@Header(NETWORK_TYPE) networkType: String?,
@Header(NETWORK_STRENGTH) networkStrength: String?,
@Header(MEMORY) memory: String?,
@Header(BATTERY) battery: String?
@Header(BATTERY) battery: String?,
): Response<CruiseResponse>
@POST
@@ -84,7 +84,7 @@ interface AlfredRetrofitService {
@Header(CONTENT_TYPE) contentType: String,
@Header(X_TARGET) target: String,
@Header(X_API_KEY) apiKey: String,
@Body failureRequest: FailureRequest
@Body failureRequest: FailureRequest,
): Response<Unit>
@POST
@@ -93,6 +93,6 @@ interface AlfredRetrofitService {
@Header(CONTENT_TYPE) contentType: String,
@Header(X_TARGET) target: String,
@Header(X_API_KEY) apiKey: String,
@Body analyticsRequest: AnalyticsRequest
@Body analyticsRequest: AnalyticsRequest,
): Response<Unit>
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -11,5 +11,5 @@ import com.google.gson.annotations.SerializedName
data class PreSignedUrlResponse(
@SerializedName("data") val data: String? = null,
@SerializedName("status") val status: Int? = null
@SerializedName("status") val status: Int? = null,
)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -11,12 +11,12 @@ import com.google.gson.annotations.SerializedName
data class CruiseResponse(
@SerializedName("data") val data: List<CruiseConfig>,
@SerializedName("status") val status: Int
@SerializedName("status") val status: Int,
)
data class CruiseConfig(
@SerializedName("_id") val id: String,
@SerializedName("_source") val source: Source
@SerializedName("_source") val source: Source,
)
data class Source(
@@ -27,7 +27,7 @@ data class Source(
@SerializedName("type") val type: String? = null,
@SerializedName("image_type") val imageType: String? = null,
@SerializedName("current_time") val currentTime: Long? = null,
@SerializedName("file_type_extension") val fileTypeExtension: String? = null
@SerializedName("file_type_extension") val fileTypeExtension: String? = null,
)
data class RecordingsConfig(
@@ -39,7 +39,7 @@ data class RecordingsConfig(
@SerializedName("video_recording_policy") val videoRecordingPolicy: String? = null,
@SerializedName("disable_screens") val disableScreens: List<String>? = null,
@SerializedName("disable_modules") val disableModules: List<String>? = null,
@SerializedName("masked_enabled_screens") val maskingEnabledScreens: List<String>? = null
@SerializedName("masked_enabled_screens") val maskingEnabledScreens: List<String>? = null,
)
data class OsConfig(
@@ -53,5 +53,5 @@ data class MetricsConfig(
@SerializedName("disable_cpu_monitoring") val disableCpuMonitoring: Boolean? = null,
@SerializedName("disable_memory_monitoring") val disableMemoryMonitoring: Boolean? = null,
@SerializedName("disable_remote_logging") val disableRemoteLogging: Boolean? = null,
@SerializedName("enable") val enable: Boolean? = null
@SerializedName("enable") val enable: Boolean? = null,
)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -14,5 +14,5 @@ import kotlinx.parcelize.Parcelize
data class RequestInfo(
val url: String? = "",
val xTarget: String? = "",
val appRequestId: String? = ""
val appRequestId: String? = "",
) : Parcelable

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -19,7 +19,7 @@ interface ComposeMaskingRepo {
top: Float?,
right: Float?,
bottom: Float?,
rootView: View?
rootView: View?,
)
fun removeSensitiveComposable(id: String)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023-2024 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -35,7 +35,7 @@ class ComposeMaskingRepoImpl : ComposeMaskingRepo {
top: Float?,
right: Float?,
bottom: Float?,
rootView: View?
rootView: View?,
) {
if (left == null || top == null || right == null || bottom == null) {
return

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2024 by Navi Technologies Limited
* * Copyright © 2024-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -19,7 +19,7 @@ internal suspend fun getScreenShotUsingCanvasDraw(
bitmap: Bitmap,
canvas: Canvas,
shouldMaskComposeScreen: Boolean? = false,
shouldMaskXmlScreen: Boolean? = false
shouldMaskXmlScreen: Boolean? = false,
) {
try {
withContext(Dispatchers.Main) { view.draw(canvas) }
@@ -28,7 +28,7 @@ internal suspend fun getScreenShotUsingCanvasDraw(
captureComposeViewWithMasking(
canvas = canvas,
rootView = view,
sensitiveCoordinates = sensitiveCoordinates
sensitiveCoordinates = sensitiveCoordinates,
)
}
if (shouldMaskXmlScreen == true) {
@@ -52,7 +52,7 @@ internal suspend fun getScreenShotUsingCanvasDraw(
moduleName = AlfredManager.currentModuleName,
screenName = AlfredManager.currentScreenName,
scope = AlfredManager.coroutineScope,
view = view
view = view,
)
}
} else {
@@ -60,7 +60,7 @@ internal suspend fun getScreenShotUsingCanvasDraw(
scope = AlfredManager.coroutineScope,
context = AlfredManager.applicationContext,
bitmap = bitmap,
bottomSheetFlow = false
bottomSheetFlow = false,
)
}
} catch (e: Exception) {

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -23,7 +23,7 @@ internal suspend fun getCruiseConfig(cruiseApiSuccessful: (response: CruiseRespo
AlfredManager.config.getOsVersion(),
AlfredManager.config.getDeviceId(),
AlfredManager.config.getApiKey(),
AlfredManager.config.getCruiseAttributes()
AlfredManager.config.getCruiseAttributes(),
)
if (response.isSuccessful && response.code() == AlfredConstants.CODE_API_SUCCESS) {
try {
@@ -44,7 +44,7 @@ internal suspend fun getCruiseConfig(cruiseApiSuccessful: (response: CruiseRespo
errorTimestamp = AlfredManager.config.getAlfredCurrentTimeMillis(),
errorName = AlfredConstants.GET_CRUISE_CONFIG_FAILURE,
errorStatusCode = response.code().toLong(),
errorMessage = response.message()
errorMessage = response.message(),
)
try {
AlfredManager.networkRepository.sendFailure(
@@ -53,8 +53,8 @@ internal suspend fun getCruiseConfig(cruiseApiSuccessful: (response: CruiseRespo
failureRequest =
FailureRequest(
failureAttributes = FailureAttributes(),
events = listOf(cruiseFailure)
)
events = listOf(cruiseFailure),
),
)
} catch (e: Exception) {
e.log()

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -46,7 +46,7 @@ import kotlinx.coroutines.sync.withLock
internal suspend fun sendEventsToServer(
clientTs: Long? = null,
snapshotPerSecond: Int? = null,
workManagerFlow: Boolean? = false
workManagerFlow: Boolean? = false,
): Boolean {
if (
workManagerFlow == true ||
@@ -77,7 +77,7 @@ internal suspend fun sendEventsToServer(
AlfredManager.networkRepository.sendEvents(
AlfredManager.config.getPostUrl(),
AlfredManager.config.getApiKey(),
request
request,
)
return if (
response.isSuccessful &&
@@ -110,12 +110,12 @@ internal suspend fun sendEventsToServer(
errorMessage = response.message(),
errorName = INGEST_EVENT_FAILURE,
clientTs = request.baseAttribute?.clientTs,
eventIdList = eventIdList
eventIdList = eventIdList,
)
AlfredDispatcher.addTaskToQueue(
AddFailureTask(
failureEvent,
context = AlfredManager.applicationContext
context = AlfredManager.applicationContext,
)
)
}
@@ -150,7 +150,7 @@ internal suspend fun sendEventsToServer(
internal suspend fun sendNegativeCaseToServer(
clientTs: Long? = null,
snapshotPerSecond: Int? = null,
workManagerFlow: Boolean? = false
workManagerFlow: Boolean? = false,
): Boolean {
if (
workManagerFlow == true ||
@@ -183,7 +183,7 @@ internal suspend fun sendNegativeCaseToServer(
AlfredManager.networkRepository.sendNegativeCase(
DEFAULT_SEND_CRASH_URL,
AlfredManager.config.getApiKey(),
request
request,
)
return if (
response.isSuccessful &&
@@ -205,12 +205,12 @@ internal suspend fun sendNegativeCaseToServer(
requestMethod = POST_METHOD,
errorStatusCode = response.code().toLong(),
errorMessage = response.message(),
errorName = INGEST_CRASH_FAILURE
errorName = INGEST_CRASH_FAILURE,
)
AlfredDispatcher.addTaskToQueue(
AddFailureTask(
failureEvent,
context = AlfredManager.applicationContext
context = AlfredManager.applicationContext,
)
)
}
@@ -270,13 +270,13 @@ internal suspend fun sendFailureEventsToServer(workManagerFlow: Boolean? = false
val request =
FailureRequest(
failureAttributes = failureAttributes,
events = events
events = events,
)
val response =
AlfredManager.networkRepository.sendFailure(
DEFAULT_SEND_FAILURE_POST_URL,
AlfredManager.config.getApiKey(),
request
request,
)
return if (
(response.isSuccessful &&
@@ -318,7 +318,7 @@ internal fun sendAlfredSessionEvent(zipFileDetails: ZipDetailsHelper, dumpFlow:
eventTimeStamp = AlfredManager.config.getEventTimeStamp(),
clientTs = zipFileDetails.eventStartRecordingTime,
latestScreenshotTimestamp = zipFileDetails.latestScreenshotTimestamp,
sessionTimeStamp = zipFileDetails.sessionStartRecordingTime
sessionTimeStamp = zipFileDetails.sessionStartRecordingTime,
),
session_upload_event_attributes =
SessionEventAttribute(
@@ -328,16 +328,16 @@ internal fun sendAlfredSessionEvent(zipFileDetails: ZipDetailsHelper, dumpFlow:
battery = AlfredManager.config.batteryPercentageBeforeEventStart,
cpu = AlfredManager.config.cpuUsageBeforeEventStart,
memory = AlfredManager.config.memoryUsageBeforeEventStart,
storage = AlfredManager.config.storageUsageBeforeEventStart
storage = AlfredManager.config.storageUsageBeforeEventStart,
),
endDeviceAttributes =
DeviceAttributes(
battery = AlfredManager.config.getBatteryPercentage(),
cpu = AlfredManager.config.getCpuUsage(),
memory = AlfredManager.config.getMemoryUsagePercentage(),
storage = AlfredManager.config.getStorageUsage()
)
)
storage = AlfredManager.config.getStorageUsage(),
),
),
)
AlfredManager.coroutineScope.launch {
@@ -345,7 +345,7 @@ internal fun sendAlfredSessionEvent(zipFileDetails: ZipDetailsHelper, dumpFlow:
AlfredManager.networkRepository.sendSession(
DEFAULT_SEND_SESSION_POST_URL,
AlfredManager.config.getApiKey(),
request
request,
)
if (response.isSuccessful && response.code() == AlfredConstants.CODE_API_SUCCESS) {
AlfredManager.zipDetailsDao.deleteZipFileDetail(zipFileDetails.alfredEventId)
@@ -376,7 +376,7 @@ internal fun sendAlfredSessionEvent(zipFileDetails: ZipDetailsHelper, dumpFlow:
errorStatusCode = response.code().toLong(),
errorMessage = response.message(),
errorName = INGEST_SESSION_FAILURE,
clientTs = request.base_attribute.clientTs
clientTs = request.base_attribute.clientTs,
)
AlfredDispatcher.addTaskToQueue(
AddFailureTask(failureEvent, context = AlfredManager.applicationContext)
@@ -393,7 +393,7 @@ internal fun startSyncEvents() {
AlfredConstants.TIMER_THREAD_NAME,
false,
AlfredConstants.DEFAULT_INITIAL_DELAY,
AlfredManager.config.getEventsDelayInMilliseconds()
AlfredManager.config.getEventsDelayInMilliseconds(),
) {
AlfredManager.coroutineScope.launch {
AddEventTask.resetEventCount()
@@ -411,7 +411,7 @@ internal fun buildEvent(
eventName: String,
properties: HashMap<String, String>? = null,
screenName: String? = null,
moduleName: String? = null
moduleName: String? = null,
): AnalyticsEvent {
val timeStamp = AlfredManager.config.getAlfredCurrentTimeMillis()
val eventData =
@@ -426,7 +426,7 @@ internal fun buildEvent(
moduleName = moduleName,
fragmentList = getFragmentList(),
zipName = AlfredManager.config.getAlfredEventId(),
screenShotTimeStamp = AlfredManager.config.getLatestScreenshotTimestamp()
screenShotTimeStamp = AlfredManager.config.getLatestScreenshotTimestamp(),
)
return AnalyticsEvent(timeStamp, Gson().toJson(eventData))
}
@@ -436,7 +436,7 @@ internal fun buildNegativeCaseEvent(
eventName: String,
properties: HashMap<String, String>? = null,
screenName: String? = null,
moduleName: String? = null
moduleName: String? = null,
): NegativeCase {
val timeStamp = AlfredManager.config.getAlfredCurrentTimeMillis()
val eventData =
@@ -450,7 +450,7 @@ internal fun buildNegativeCaseEvent(
screenName = screenName,
moduleName = moduleName,
fragmentList = getFragmentList(),
zipName = AlfredManager.config.getAlfredEventId()
zipName = AlfredManager.config.getAlfredEventId(),
)
return NegativeCase(timeStamp, Gson().toJson(eventData))
}
@@ -465,7 +465,7 @@ internal fun buildFailureEvent(
errorMessage: String? = "",
errorName: String? = null,
clientTs: Long? = null,
eventIdList: List<String>? = null
eventIdList: List<String>? = null,
): FailureEvent {
val timeStamp = AlfredManager.config.getAlfredCurrentTimeMillis()
val eventData =
@@ -478,7 +478,7 @@ internal fun buildFailureEvent(
errorMessage = errorMessage,
errorName = errorName,
clientTs = clientTs,
eventIdList = eventIdList
eventIdList = eventIdList,
)
return FailureEvent(timeStamp, Gson().toJson(eventData))
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2024 by Navi Technologies Limited
* * Copyright © 2024-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -31,7 +31,7 @@ fun getScreenShotUsingPixelCopy(
shouldMaskComposeScreen: Boolean? = false,
shouldMaskXmlScreen: Boolean? = false,
bitmapForBackground: Bitmap? = null,
canvas: Canvas
canvas: Canvas,
) {
if (!isViewCaptureReady(activity, view)) return
@@ -64,7 +64,7 @@ fun getScreenShotUsingPixelCopy(
locationOfViewInWindow[0],
locationOfViewInWindow[1],
locationOfViewInWindow[0] + view.width,
locationOfViewInWindow[1] + view.height
locationOfViewInWindow[1] + view.height,
),
bitmap,
{ copyResult ->
@@ -73,7 +73,7 @@ fun getScreenShotUsingPixelCopy(
captureComposeViewWithMasking(
canvas,
view,
sensitiveCoordinates
sensitiveCoordinates,
)
}
onPixelCopySuccess(
@@ -85,14 +85,14 @@ fun getScreenShotUsingPixelCopy(
shouldMaskComposeScreen = shouldMaskComposeScreen,
shouldMaskXmlScreen = shouldMaskXmlScreen,
canvas = canvas,
view = view
view = view,
)
} else {
onPixelCopyError()
}
handlerThread.quitSafely()
},
Handler(handlerThread.looper)
Handler(handlerThread.looper),
)
}
}
@@ -113,7 +113,7 @@ fun onPixelCopySuccess(
shouldMaskComposeScreen: Boolean? = false,
shouldMaskXmlScreen: Boolean? = false,
canvas: Canvas,
view: View
view: View,
) {
if (shouldMaskComposeScreen == true) {
val sensitiveCoordinates = AlfredManager.sensitiveComposeRepository.sensitiveCoordinates
@@ -132,7 +132,7 @@ fun onPixelCopySuccess(
moduleName = AlfredManager.currentModuleName,
screenName = AlfredManager.currentScreenName,
scope = scope,
view = view
view = view,
)
} else {
val bottomSheetView = AlfredManager.dialog?.window?.decorView?.rootView
@@ -146,14 +146,14 @@ fun onPixelCopySuccess(
bitmap = bitmap,
activity = activity,
bottomSheetView = bottomSheetView,
canvas = canvas
canvas = canvas,
)
} else {
insertScreenShotPathInDb(
scope = scope,
context = AlfredManager.applicationContext,
bitmap = bitmap,
bottomSheetFlow = false
bottomSheetFlow = false,
)
}
}
@@ -163,7 +163,7 @@ fun captureBottomSheetUsingPixelCopy(
bitmap: Bitmap?,
activity: Activity?,
bottomSheetView: View,
canvas: Canvas
canvas: Canvas,
) {
val bottomSheetCanvasForBitmap = createBitmapForView(bottomSheetView)
getScreenShotUsingPixelCopy(
@@ -172,7 +172,7 @@ fun captureBottomSheetUsingPixelCopy(
isBottomSheet = true,
activity = activity,
bitmapForBackground = bitmap,
canvas = canvas
canvas = canvas,
)
}
@@ -183,7 +183,7 @@ fun onPixelCopyError() {
internal fun captureComposeViewWithMasking(
canvas: Canvas,
rootView: View,
sensitiveCoordinates: Map<String, MaskingBounds>
sensitiveCoordinates: Map<String, MaskingBounds>,
) {
try {
val paint = Paint()
@@ -218,7 +218,7 @@ internal fun captureXmlViewWithMasking(view: View, canvas: Canvas) {
left = view.left.toFloat(),
top = view.top.toFloat(),
right = view.right.toFloat(),
bottom = view.bottom.toFloat()
bottom = view.bottom.toFloat(),
)
sensitiveCoordinatesList.add(bounds)
}
@@ -229,7 +229,7 @@ internal fun captureXmlViewWithMasking(view: View, canvas: Canvas) {
it.top,
it.right,
it.bottom,
Paint().apply { color = Color.BLACK }
Paint().apply { color = Color.BLACK },
)
}
} catch (e: Exception) {

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023-2024 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -49,7 +49,7 @@ internal fun combineScreenshots(
screenName: String? = null,
moduleName: String? = null,
scope: CoroutineScope,
view: View
view: View,
): Bitmap? {
if (
backgroundScreenshot == null ||
@@ -80,7 +80,7 @@ internal fun insertScreenShotPathInDb(
scope: CoroutineScope,
context: Context,
bitmap: Bitmap?,
bottomSheetFlow: Boolean? = false
bottomSheetFlow: Boolean? = false,
) {
scope.launch(Dispatchers.IO) {
try {
@@ -130,7 +130,7 @@ internal fun insertScreenShotPathInDb(
screenShotDao.insertScreenShotPath(
ScreenShotPathHelper(
AlfredManager.config.getAlfredCurrentTimeMillis(),
path
path,
)
)
ScreenShotStorageHelper.addImage(path)
@@ -200,7 +200,7 @@ internal fun clearScreenShot(path: List<ScreenShotPathHelper>) {
enum class VideoQuality {
LOW,
HIGH,
MEDIUM
MEDIUM,
}
internal suspend fun captureScreen(
@@ -209,7 +209,7 @@ internal suspend fun captureScreen(
canvas: Canvas? = null,
bmp: Bitmap? = null,
moduleName: String? = null,
activity: Activity? = null
activity: Activity? = null,
): Bitmap? {
if (
isScreenDisabled(screenName, moduleName) ||
@@ -234,7 +234,7 @@ internal suspend fun captureScreen(
bitmap = bmp,
canvas = canvas,
shouldMaskComposeScreen = true,
activity = activity
activity = activity,
)
}
} else {
@@ -244,14 +244,14 @@ internal suspend fun captureScreen(
bitmap = bmp,
canvas = canvas,
shouldMaskXmlScreen = true,
activity = activity
activity = activity,
)
} else {
captureScreenManager(
view = v,
bitmap = bmp,
canvas = canvas,
activity = activity
activity = activity,
)
}
}
@@ -271,7 +271,7 @@ internal suspend fun captureScreenManager(
canvas: Canvas,
shouldMaskComposeScreen: Boolean? = false,
shouldMaskXmlScreen: Boolean? = false,
activity: Activity?
activity: Activity?,
) {
try {
if (
@@ -284,7 +284,7 @@ internal suspend fun captureScreenManager(
activity = activity,
canvas = canvas,
shouldMaskComposeScreen = shouldMaskComposeScreen,
shouldMaskXmlScreen = shouldMaskXmlScreen
shouldMaskXmlScreen = shouldMaskXmlScreen,
)
} else {
getScreenShotUsingCanvasDraw(
@@ -292,7 +292,7 @@ internal suspend fun captureScreenManager(
bitmap = bitmap,
canvas = canvas,
shouldMaskComposeScreen = shouldMaskComposeScreen,
shouldMaskXmlScreen = shouldMaskXmlScreen
shouldMaskXmlScreen = shouldMaskXmlScreen,
)
}
} catch (e: Exception) {
@@ -309,7 +309,7 @@ internal fun blurScreen(canvas: Canvas, rootView: View) {
rootView.top.toFloat(),
rootView.right.toFloat(),
rootView.bottom.toFloat(),
paint
paint,
)
}
@@ -318,7 +318,7 @@ internal fun measureInflatedView(view: View, width: Int = 1080, height: Int = 19
view.layoutParams = ViewGroup.LayoutParams(width, height)
view.measure(
View.MeasureSpec.makeMeasureSpec(view.layoutParams.width, View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(view.layoutParams.height, View.MeasureSpec.EXACTLY)
View.MeasureSpec.makeMeasureSpec(view.layoutParams.height, View.MeasureSpec.EXACTLY),
)
view.layout(0, 0, view.measuredWidth, view.measuredHeight)
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -35,7 +35,7 @@ import retrofit2.Response
internal suspend fun getPreSignedUrl(
zipFileDetail: ZipDetailsHelper,
dumpFlow: Boolean = false,
workManagerFlow: Boolean? = false
workManagerFlow: Boolean? = false,
) {
val currentZipName = zipFileDetail.alfredEventId
val bucketKey = currentZipName.plus(zipFileDetail.fileTypeExtension)
@@ -46,7 +46,7 @@ internal suspend fun getPreSignedUrl(
AlfredManager.networkRepository.getPreSignedUrl(
bucketKey,
AlfredManager.config.getApiKey(),
zipFileDetail.fileTypeExtension
zipFileDetail.fileTypeExtension,
)
} else {
Response.error(AlfredConstants.CODE_API_BAD_REQUEST, null)
@@ -60,7 +60,7 @@ internal suspend fun getPreSignedUrl(
uploadFile = file,
url = it,
dumpFlow = dumpFlow,
workManagerFlow = workManagerFlow
workManagerFlow = workManagerFlow,
)
}
}
@@ -74,7 +74,7 @@ internal suspend fun getPreSignedUrl(
zipName = listOf(currentZipName),
errorStatusCode = response.code().toLong(),
errorMessage = response.message(),
errorName = GET_PRE_SIGNED_URL_FAILURE
errorName = GET_PRE_SIGNED_URL_FAILURE,
)
AlfredDispatcher.addTaskToQueue(
AddFailureTask(failureEvent, context = AlfredManager.applicationContext)
@@ -216,7 +216,7 @@ internal suspend fun uploadFile(
zipName = listOf(currentZipName),
errorStatusCode = uploadResponse.code().toLong(),
errorMessage = uploadResponse.message(),
errorName = UPLOAD_TO_S3_FAILURE
errorName = UPLOAD_TO_S3_FAILURE,
)
AlfredDispatcher.addTaskToQueue(
AddFailureTask(failureEvent, context = AlfredManager.applicationContext)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -17,7 +17,7 @@ import kotlin.math.abs
internal fun getTouchEvent(
currentTouchEvent: MotionEvent?,
previousTouchEvent: NaviMotionEvent?
previousTouchEvent: NaviMotionEvent?,
): Pair<String, HashMap<String, String>> {
val properties = HashMap<String, String>()
val pointerIndex = currentTouchEvent?.actionIndex ?: 0
@@ -27,11 +27,11 @@ internal fun getTouchEvent(
if (
(difference(
currentTouchEvent?.getX(pointerIndex),
previousTouchEvent?.pointerPositionX
previousTouchEvent?.pointerPositionX,
) &&
difference(
currentTouchEvent?.getY(pointerIndex),
previousTouchEvent?.pointerPositionY
previousTouchEvent?.pointerPositionY,
)) ||
(difference(currentTouchEvent?.rawX, previousTouchEvent?.rawX) &&
difference(currentTouchEvent?.rawY, previousTouchEvent?.rawY))

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -48,7 +48,7 @@ internal fun toZip(imagePathList: List<ScreenShotPathHelper>) {
latestScreenshotTimestamp = latestScreenshotTimestamp,
eventStartRecordingTime = AlfredManager.config.getEventStartRecordingTime() ?: 0L,
alfredEventId = AlfredManager.config.getAlfredEventId(),
fileTypeExtension = AlfredManager.config.zipFileTypeExtension
fileTypeExtension = AlfredManager.config.zipFileTypeExtension,
)
AlfredManager.config.setNextEventStartRecordingTime()
AlfredManager.config.setAlfredEventId()
@@ -58,7 +58,7 @@ internal fun toZip(imagePathList: List<ScreenShotPathHelper>) {
internal fun zip(
files: java.util.ArrayList<String>,
zipFilePath: String?,
fileTypeExtension: String
fileTypeExtension: String,
): Boolean? {
if (zipFilePath == null) {
return false
@@ -149,7 +149,7 @@ internal fun checkDbToUploadFailedZips() {
if (
checkFileExists(
fileName = dumpZipDetailsHelper.alfredEventId,
AlfredManager.applicationContext
AlfredManager.applicationContext,
) != null
) {
getPreSignedUrl(zipFileDetail = dumpZipDetailsHelper, dumpFlow = true)
@@ -185,7 +185,7 @@ internal suspend fun toZipForWorkManager(
eventStartRecordingTime: Long,
alfredEventId: String,
latestScreenshotTimestamp: Long,
fileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION
fileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION,
) {
AlfredManager.sessionIdForCrash = alfredSessionId
AlfredManager.sessionStartRecordingTimeForCrash = sessionStartRecordingTime
@@ -206,7 +206,7 @@ internal suspend fun toZipForWorkManager(
latestScreenshotTimestamp = latestScreenshotTimestamp,
eventStartRecordingTime = eventStartRecordingTime,
alfredEventId = alfredEventId,
fileTypeExtension = fileTypeExtension
fileTypeExtension = fileTypeExtension,
)
AlfredManager.screenShotDao.deleteAllScreenShot()
ScreenShotStorageHelper.clearAll()
@@ -225,7 +225,7 @@ internal fun insertZipDetailsToDbForUpload(
alfredEventId: String,
latestScreenshotTimestamp: Long,
zipUploadStatus: Boolean = false,
fileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION
fileTypeExtension: String = AlfredConstants.ZIP_FILE_EXTENSION,
) {
if (!AlfredManager.zipDetailsDao.zipDetailExists(alfredEventId)) {
AlfredManager.zipDetailsDao.insert(
@@ -237,7 +237,7 @@ internal fun insertZipDetailsToDbForUpload(
alfredEventId = alfredEventId,
latestScreenshotTimestamp = latestScreenshotTimestamp,
zipUploadStatus = zipUploadStatus,
fileTypeExtension = fileTypeExtension
fileTypeExtension = fileTypeExtension,
)
)
}
@@ -265,7 +265,7 @@ internal fun startAnrCrashZipUpload(view: View) {
internal fun uploadWorkManagerFailedZip(
alfredEventId: String? = null,
latestScreenshotTimestamp: Long? = null
latestScreenshotTimestamp: Long? = null,
) {
val failedZipDetails = AlfredManager.workFailureData.find { it.alfredEventId == alfredEventId }
if (failedZipDetails != null) {
@@ -277,20 +277,20 @@ internal fun uploadWorkManagerFailedZip(
.putString(AlfredConstants.ALFRED_SESSION_ID, failedZipDetails.alfredSessionId)
.putLong(
AlfredConstants.SESSION_START_RECORDING_TIME,
failedZipDetails.sessionStartRecordingTime
failedZipDetails.sessionStartRecordingTime,
)
.putLong(
AlfredConstants.EVENT_START_RECORDING_TIME,
failedZipDetails.eventStartRecordingTime
failedZipDetails.eventStartRecordingTime,
)
.putString(AlfredConstants.ALFRED_EVENT_ID, failedZipDetails.alfredEventId)
.putLong(
AlfredConstants.LATEST_SCREENSHOT_TIMESTAMP,
latestScreenshotTimestamp ?: 0L
latestScreenshotTimestamp ?: 0L,
)
.putString(
AlfredConstants.FILE_TYPE_EXTENSION,
failedZipDetails.fileTypeExtension
failedZipDetails.fileTypeExtension,
)
.build()
buildWorkManagerForZip(requestData)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -36,12 +36,12 @@ class UploadEventsWorker(context: Context, workerParams: WorkerParameters) :
sendEventsToServer(
clientTs = clientTs,
snapshotPerSecond = snapshotPerSecond,
workManagerFlow = true
workManagerFlow = true,
)
sendNegativeCaseToServer(
clientTs = clientTs,
snapshotPerSecond = snapshotPerSecond,
workManagerFlow = true
workManagerFlow = true,
)
sendFailureEventsToServer(workManagerFlow = true)
Result.success()

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -69,7 +69,7 @@ class UploadFileWorker(context: Context, workerParams: WorkerParameters) :
id,
alfredEventId,
latestScreenshotTimestamp,
fileTypeExtension = fileTypeExtension
fileTypeExtension = fileTypeExtension,
)
)
}
@@ -82,7 +82,7 @@ class UploadFileWorker(context: Context, workerParams: WorkerParameters) :
eventStartRecordingTime = eventStartRecordingTime,
alfredEventId = alfredEventId,
latestScreenshotTimestamp = latestScreenshotTimestamp,
fileTypeExtension = fileTypeExtension
fileTypeExtension = fileTypeExtension,
)
} else {
val zipFileDetail =
@@ -94,7 +94,7 @@ class UploadFileWorker(context: Context, workerParams: WorkerParameters) :
getPreSignedUrl(
zipFileDetail = zipFileDetail,
workManagerFlow = true,
dumpFlow = true
dumpFlow = true,
)
}
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -41,20 +41,20 @@ class ZipUploadRetryWorker(context: Context, workerParams: WorkerParameters) :
.putString(AlfredConstants.ALFRED_SESSION_ID, it.alfredSessionId)
.putLong(
AlfredConstants.SESSION_START_RECORDING_TIME,
it.sessionStartRecordingTime
it.sessionStartRecordingTime,
)
.putLong(
AlfredConstants.EVENT_START_RECORDING_TIME,
it.sessionStartRecordingTime
it.sessionStartRecordingTime,
)
.putString(AlfredConstants.ALFRED_EVENT_ID, it.alfredEventId)
.putLong(
AlfredConstants.LATEST_SCREENSHOT_TIMESTAMP,
it.latestScreenshotTimestamp
it.latestScreenshotTimestamp,
)
.putString(
AlfredConstants.FILE_TYPE_EXTENSION,
it.fileTypeExtension
it.fileTypeExtension,
)
.build()
buildWorkManagerForZip(requestDataForZip)

View File

@@ -1,9 +1,11 @@
spotless {
ratchetFrom 'origin/master'
format 'misc', {
target '**/*.gradle', '**/*.md', '**/.gitignore'
trimTrailingWhitespace()
indentWithSpaces()
leadingTabsToSpaces()
endWithNewline()
}
@@ -12,7 +14,7 @@ spotless {
licenseHeaderFile rootProject.file('spotless.license')
trimTrailingWhitespace()
indentWithSpaces()
leadingTabsToSpaces()
endWithNewline()
ktfmt().kotlinlangStyle()
}
@@ -22,7 +24,7 @@ spotless {
licenseHeaderFile rootProject.file('spotless.license')
trimTrailingWhitespace()
indentWithSpaces()
leadingTabsToSpaces()
endWithNewline()
removeUnusedImports()
googleJavaFormat().aosp()