Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal class FaceCaptureViewModel @Inject constructor(
private val resolveFaceBioSdk: ResolveFaceBioSdkUseCase,
private val saveLicenseCheckEvent: SaveLicenseCheckEventUseCase,
private val shouldShowInstructions: ShouldShowInstructionsScreenUseCase,
@DeviceID private val deviceID: String,
@param:DeviceID private val deviceID: String,
) : ViewModel() {
// Updated in live feedback screen
var attemptNumber: Int = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import javax.inject.Inject
import kotlin.math.max

internal class BitmapToByteArrayUseCase @Inject constructor(
@ApplicationContext private val context: Context,
@param:ApplicationContext private val context: Context,
) {
companion object {
const val IMAGE_QUALITY = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class SimpleCaptureEventReporter @Inject constructor(
private val timeHelper: TimeHelper,
private val eventRepository: SessionEventRepository,
private val encodingUtils: EncodingUtils,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
fun addOnboardingCompleteEvent(startTime: Timestamp) = sessionCoroutineScope.launch {
eventRepository.addOrUpdateEvent(FaceOnboardingCompleteEvent(startTime, timeHelper.now()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import javax.inject.Inject

@HiltViewModel
internal class AlertViewModel @Inject constructor(
@DeviceID private val deviceId: String,
@param:DeviceID private val deviceId: String,
private val timeHelper: TimeHelper,
private val eventRepository: SessionEventRepository,
private val authStore: AuthStore,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) : ViewModel() {
private lateinit var cachedAlertEvent: AlertScreenEvent

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import com.simprints.libsimprints.Identification as LegacyIdentification
import com.simprints.libsimprints.Tier as LegacyTier

internal class CommCareResponseMapper @Inject constructor(
@DeviceID private val deviceId: String,
@PackageVersionName private val appVersionName: String,
@param:DeviceID private val deviceId: String,
@param:PackageVersionName private val appVersionName: String,
) {
operator fun invoke(response: ActionResponse): Bundle = when (response) {
is ActionResponse.EnrolActionResponse -> bundleOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import com.simprints.libsimprints.Tier as LegacyTier
import com.simprints.libsimprints.Verification as LegacyVerification

internal class LibSimprintsResponseMapper @Inject constructor(
@DeviceID private val deviceId: String,
@PackageVersionName private val appVersionName: String,
@param:DeviceID private val deviceId: String,
@param:PackageVersionName private val appVersionName: String,
) {
operator fun invoke(response: ActionResponse): Bundle = when (response) {
is ActionResponse.EnrolActionResponse -> bundleOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javax.inject.Inject
internal class DeleteSessionEventsIfNeededUseCase @Inject constructor(
private val configManager: ConfigManager,
private val eventRepository: EventRepository,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
operator fun invoke(sessionId: String) = sessionCoroutineScope.launch {
val projectNotRunning = configManager.getProject()?.state != ProjectState.RUNNING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javax.inject.Inject
internal class SimpleEventReporter @Inject constructor(
private val coreEventRepository: SessionEventRepository,
private val timeHelper: TimeHelper,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
fun addInvalidIntentEvent(
action: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class ConsentViewModel @Inject constructor(
private val timeHelper: TimeHelper,
private val configManager: ConfigManager,
private val eventRepository: SessionEventRepository,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) : ViewModel() {
private val startConsentEventTime = timeHelper.now()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class LogoutUseCase @Inject constructor(
private val authManager: AuthManager,
private val flagsStore: RealmToRoomMigrationFlagsStore,
private val enrolmentRecordRepository: EnrolmentRecordRepository,
@DispatcherIO private val ioDispatcher: CoroutineDispatcher,
@param:DispatcherIO private val ioDispatcher: CoroutineDispatcher,
) {
// To prevent a race between wiping data and navigation, this use case must block the executing thread
operator fun invoke() = runBlocking(ioDispatcher) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ internal class SyncInfoViewModel @Inject constructor(
private val timeHelper: TimeHelper,
observeSyncInfo: ObserveSyncInfoUseCase,
private val logoutUseCase: LogoutUseCase,
@DispatcherIO private val ioDispatcher: CoroutineDispatcher,
@param:DispatcherIO private val ioDispatcher: CoroutineDispatcher,
) : ViewModel() {
var isPreLogoutUpSync = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class ModuleSelectionViewModel @Inject constructor(
private val syncOrchestrator: SyncOrchestrator,
private val configManager: ConfigManager,
private val tokenizationProcessor: TokenizationProcessor,
@ExternalScope private val externalScope: CoroutineScope,
@param:ExternalScope private val externalScope: CoroutineScope,
) : ViewModel() {
val modulesList: LiveData<List<Module>>
get() = _modulesList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal class ExternalCredentialScanOcrViewModel @AssistedInject constructor(
private val zoomOntoCredentialUseCase: ZoomOntoCredentialUseCase,
private val tokenizationProcessor: TokenizationProcessor,
private val configManager: ConfigManager,
@DispatcherBG private val bgDispatcher: CoroutineDispatcher,
@param:DispatcherBG private val bgDispatcher: CoroutineDispatcher,
) : ViewModel() {
@AssistedFactory
fun interface Factory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ResetExternalCredentialsInSessionUseCase @Inject() constructor(
private val enrolmentRecordRepository: EnrolmentRecordRepository,
private val configManager: ConfigManager,
private val eventRepository: SessionEventRepository,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
suspend operator fun invoke(
scannedCredential: ScannedCredential? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.simprints.infra.orchestration.data.ActionRequest
import javax.inject.Inject

internal class ExtractParametersForAnalyticsUseCase @Inject constructor(
@DeviceID private val deviceId: String,
@param:DeviceID private val deviceId: String,
) {
suspend operator fun invoke(action: ActionRequest) = with(action) {
ignoreException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class ReportActionRequestEventsUseCase @Inject constructor(
private val timeHelper: TimeHelper,
private val simNetworkUtils: SimNetworkUtils,
private val recentUserActivityManager: RecentUserActivityManager,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
suspend operator fun invoke(actionRequest: ActionRequest) {
reportUnknownExtras(actionRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import javax.inject.Inject

@HiltViewModel
internal class LoginFormViewModel @Inject constructor(
@DeviceID private val deviceId: String,
@param:DeviceID private val deviceId: String,
private val simNetwork: SimNetwork,
private val authManager: AuthManager,
private val jsonHelper: JsonHelper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import javax.inject.Inject
internal class AddCallbackEventUseCase @Inject constructor(
private val eventRepository: SessionEventRepository,
private val timeHelper: TimeHelper,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
operator fun invoke(result: AppResponse) {
val callbackEvent = when (result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal class SelectSubjectAgeGroupViewModel @Inject constructor(
private val timeHelper: TimeHelper,
private val eventRepository: SessionEventRepository,
private val buildAgeGroups: BuildAgeGroupsUseCase,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) : ViewModel() {
val finish: LiveData<LiveDataEventWithContent<AgeGroup>>
get() = _finish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal class SelectSubjectViewModel @AssistedInject constructor(
private val resetExternalCredentialsUseCase: ResetExternalCredentialsInSessionUseCase,
private val enrolmentRecordRepository: EnrolmentRecordRepository,
private val tokenizationProcessor: TokenizationProcessor,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) : ViewModel() {
@AssistedFactory
interface Factory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import kotlinx.coroutines.flow.channelFlow
import javax.inject.Inject

internal class LocationManager @Inject constructor(
@ApplicationContext val ctx: Context,
@param:ApplicationContext val ctx: Context,
) {
private val locationClient = LocationServices.getFusedLocationProviderClient(ctx)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject

internal class LocationStoreWorkerScheduler @Inject constructor(
@ApplicationContext private val appContext: Context,
@param:ApplicationContext private val appContext: Context,
) : LocationStore {
override fun collectLocationInBackground() {
val request = OneTimeWorkRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class StoreUserLocationIntoCurrentSessionWorker @AssistedInject constru
@Assisted params: WorkerParameters,
private val eventRepository: SessionEventRepository,
private val locationManager: LocationManager,
@DispatcherMain private val dispatcher: CoroutineDispatcher,
@param:DispatcherMain private val dispatcher: CoroutineDispatcher,
) : SimCoroutineWorker(context, params) {
override val tag: String = "StoreUserLocationWorker"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class SetupViewModel @Inject constructor(
private val locationStore: LocationStore,
private val configManager: ConfigManager,
private val licenseRepository: LicenseRepository,
@DeviceID private val deviceID: String,
@param:DeviceID private val deviceID: String,
private val authStore: AuthStore,
private val saveLicenseCheckEvent: SaveLicenseCheckEventUseCase,
) : ViewModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.simprints.infra.authstore.AuthStore
import javax.inject.Inject

internal class CollectIdsUseCase @Inject constructor(
@DeviceID private val deviceID: String,
@param:DeviceID private val deviceID: String,
private val authStore: AuthStore,
) {
operator fun invoke() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import javax.inject.Inject

@ExcludedFromGeneratedTestCoverageReports("Mostly system calls")
internal class CollectNetworkInformationUseCase @Inject constructor(
@ApplicationContext private val context: Context,
@param:ApplicationContext private val context: Context,
) {
operator fun invoke(): String {
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import java.util.Date
import javax.inject.Inject

internal class ExportLogsUseCase @Inject constructor(
@DeviceID private val deviceId: String,
@ApplicationContext private val context: Context,
@param:DeviceID private val deviceId: String,
@param:ApplicationContext private val context: Context,
private val logDirectoryProvider: LogDirectoryProvider,
private val configManager: ConfigManager,
@FileNameDateTimeFormatter private val dateFormatter: SimpleDateFormat,
@param:FileNameDateTimeFormatter private val dateFormatter: SimpleDateFormat,
) {
operator fun invoke(): Flow<LogsExportResult> = flow {
emit(LogsExportResult.InProgress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import javax.inject.Inject
import kotlin.time.measureTimedValue

internal class PingServerUseCase @Inject constructor(
@DispatcherIO private val dispatcherIO: CoroutineDispatcher,
@param:DispatcherIO private val dispatcherIO: CoroutineDispatcher,
private val baseUrlProvider: BaseUrlProvider,
private val urlFactory: UrlFactory,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal class FingerprintCaptureViewModel @Inject constructor(
private val addBiometricReferenceCreationEvents: AddBiometricReferenceCreationEventUseCase,
private val tracker: FingerprintScanningStatusTracker,
private val isNoFingerDetectedLimitReachedUseCase: IsNoFingerDetectedLimitReachedUseCase,
@ExternalScope private val externalScope: CoroutineScope,
@param:ExternalScope private val externalScope: CoroutineScope,
) : ViewModel() {
lateinit var configuration: FingerprintConfiguration
private lateinit var bioSdkConfiguration: FingerprintConfiguration.FingerprintSdkConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import javax.inject.Inject
internal class AddBiometricReferenceCreationEventUseCase @Inject constructor(
private val timeHelper: TimeHelper,
private val eventRepository: SessionEventRepository,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
operator fun invoke(
referenceId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javax.inject.Inject
internal class ReportAlertScreenEventUseCase @Inject constructor(
private val timeHelper: TimeHelper,
private val eventRepository: SessionEventRepository,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
operator fun invoke(eventType: AlertScreenEventType) {
sessionCoroutineScope.launch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import javax.inject.Inject
internal class ReportFirmwareUpdateEventUseCase @Inject constructor(
private val timeHelper: TimeHelper,
private val eventRepository: SessionEventRepository,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
operator fun invoke(
startTime: Timestamp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class SaveScannerConnectionEventsUseCase @Inject constructor(
private val scannerManager: ScannerManager,
private val timeHelper: TimeHelper,
private val eventRepository: SessionEventRepository,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
@param:SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
) {
operator fun invoke() {
sessionCoroutineScope.launch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import com.simprints.infra.config.store.models.FingerprintConfiguration
import javax.inject.Inject

class ResolveBioSdkWrapperUseCase @Inject constructor(
@SimprintsSdk private val simprintsWrapper: BioSdkWrapper,
@NecSdk private val necWrapper: BioSdkWrapper,
@param:SimprintsSdk private val simprintsWrapper: BioSdkWrapper,
@param:NecSdk private val necWrapper: BioSdkWrapper,
) {
operator fun invoke(fingerprintSdk: FingerprintConfiguration.BioSdk): BioSdkWrapper = when (fingerprintSdk) {
FingerprintConfiguration.BioSdk.SECUGEN_SIM_MATCHER -> simprintsWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import javax.inject.Inject

internal class CalculateNecImageQualityUseCase @Inject constructor(
private val necInstant: NEC,
@DispatcherBG private val dispatcher: CoroutineDispatcher,
@param:DispatcherBG private val dispatcher: CoroutineDispatcher,
) {
suspend operator fun invoke(image: FingerprintImage): Int = withContext(dispatcher) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import javax.inject.Inject

internal class ExtractNecTemplateUseCase @Inject constructor(
private val nec: NEC,
@DispatcherBG private val dispatcher: CoroutineDispatcher,
@param:DispatcherBG private val dispatcher: CoroutineDispatcher,
) {
suspend operator fun invoke(
fingerprintImage: FingerprintImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class ProcessRawImageUseCase @Inject constructor(
private val secugenImageCorrection: SecugenImageCorrection,
private val acquireImageDistortionConfigurationUseCase: AcquireImageDistortionConfigurationUseCase,
private val wsqConverter: WSQConverter,
@DispatcherBG private val dispatcher: CoroutineDispatcher,
@param:DispatcherBG private val dispatcher: CoroutineDispatcher,
) {
suspend operator fun invoke(
settings: FingerprintTemplateAcquisitionSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.simprints.fingerprint.infra.scanner.v2.scanner.Scanner as ScannerV2

@Singleton
class FingerprintCaptureWrapperFactory @Inject constructor(
@DispatcherIO private val ioDispatcher: CoroutineDispatcher,
@param:DispatcherIO private val ioDispatcher: CoroutineDispatcher,
private val scanningStatusTracker: FingerprintScanningStatusTracker,
) {
private var _captureWrapper: FingerprintCaptureWrapper? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import javax.inject.Singleton

@Singleton
class FingerprintScanningStatusTracker @Inject constructor(
@DispatcherBG private val dispatcherBG: CoroutineDispatcher,
@param:DispatcherBG private val dispatcherBG: CoroutineDispatcher,
) {
private val coroutineScope = CoroutineScope(dispatcherBG)
private val _state =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import javax.inject.Inject
internal class FingerprintFileDownloader @Inject constructor(
private val fingerprintApiClientFactory: FingerprintApiClientFactory,
private val authStore: AuthStore,
@DispatcherIO private val dispatcher: CoroutineDispatcher,
@param:DispatcherIO private val dispatcher: CoroutineDispatcher,
) {
private val projectId by lazy {
authStore.signedInProjectId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import javax.inject.Inject
*/
internal class ConnectionHelper @Inject constructor(
private val bluetoothAdapter: ComponentBluetoothAdapter,
@DispatcherIO private val dispatcher: CoroutineDispatcher,
@param:DispatcherIO private val dispatcher: CoroutineDispatcher,
) {
private var socket: ComponentBluetoothSocket? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PacketRouter @Inject constructor(
routes: List<Route>,
private val packetRouteDesignator: Packet.() -> Byte,
private val byteArrayToPacketAccumulator: ByteArrayToPacketAccumulator,
@DispatcherIO private val dispatcher: CoroutineDispatcher,
@param:DispatcherIO private val dispatcher: CoroutineDispatcher,
) : IncomingConnectable {
private val routeIdMap = routes.associateBy { it.id.value }
private val internalPacketRoutes = routes.associateWith { MutableSharedFlow<Packet>() }
Expand Down
Loading