Loading app/detekt-baseline.xml +0 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ <ID>ChainWrapping:ValidateAppAgeLimitUseCase.kt$ValidateAppAgeLimitUseCase$&&</ID> <ID>CommentSpacing:ParentalControlAuthenticator.kt$ParentalControlAuthenticator$//Parental Control Key</ID> <ID>CommentSpacing:ParentalControlAuthenticator.kt$ParentalControlAuthenticator$//Parental Control intent</ID> <ID>CyclomaticComplexMethod:AppInstallProcessor.kt$AppInstallProcessor$suspend fun enqueueFusedDownload( appInstall: AppInstall, isAnUpdate: Boolean = false, isSystemApp: Boolean = false )</ID> <ID>EmptyCatchBlock:NativeDeviceInfoProviderModule.kt$NativeDeviceInfoProviderModule${ }</ID> <ID>EmptyFunctionBlock:CleanApkAuthenticator.kt$CleanApkAuthenticator${}</ID> <ID>FinalNewline:ContentRatingValidity.kt$foundation.e.apps.domain.model.ContentRatingValidity.kt</ID> Loading Loading @@ -233,7 +232,6 @@ <ID>MultiLineIfElse:SearchViewModel.kt$SearchViewModel$searchRepository.getSearchSuggestions(it)</ID> <ID>MultiLineIfElse:SettingsFragment.kt$SettingsFragment$true</ID> <ID>MultiLineIfElse:ValidateAppAgeLimitUseCase.kt$ValidateAppAgeLimitUseCase$fetchedContentRating</ID> <ID>NestedBlockDepth:AppInstallProcessor.kt$AppInstallProcessor$suspend fun enqueueFusedDownload( appInstall: AppInstall, isAnUpdate: Boolean = false, isSystemApp: Boolean = false )</ID> <ID>NewLineAtEndOfFile:ContentRatingValidity.kt$foundation.e.apps.domain.model.ContentRatingValidity.kt</ID> <ID>NewLineAtEndOfFile:SystemAppsUpdatesRepository.kt$foundation.e.apps.data.gitlab.SystemAppsUpdatesRepository.kt</ID> <ID>NoBlankLineBeforeRbrace:AgeGroupApi.kt$AgeGroupApi$ </ID> Loading app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt +26 −19 Original line number Diff line number Diff line Loading @@ -139,25 +139,7 @@ class AppInstallProcessor @Inject constructor( return } val ageLimitValidationResult = validateAppAgeLimitUseCase.invoke(appInstall) if (ageLimitValidationResult.data?.isValid != true) { if (ageLimitValidationResult.isSuccess()) { awaitInvokeAgeLimitEvent(appInstall.name) if (ageLimitValidationResult.data?.requestPin == true){ val isAuthenticated = ParentalControlAuthenticator.awaitAuthentication() if (isAuthenticated) { ageLimitValidationResult.setData(ContentRatingValidity(true)) } } } else { EventBus.invokeEvent(AppEvent.ErrorMessageDialogEvent(R.string.data_load_error_desc)) } if (ageLimitValidationResult.data?.isValid != true) { appInstallComponents.appManagerWrapper.cancelDownload(appInstall) return } } if (!validateAgeLimit(appInstall)) return if (!context.isNetworkAvailable()) { appInstallComponents.appManagerWrapper.installationIssue(appInstall) Loading @@ -184,6 +166,31 @@ class AppInstallProcessor @Inject constructor( } } private suspend fun validateAgeLimit(appInstall: AppInstall): Boolean { val ageLimitValidationResult = validateAppAgeLimitUseCase.invoke(appInstall) if (ageLimitValidationResult.data?.isValid == true) { return true } if (ageLimitValidationResult.isSuccess()) { awaitInvokeAgeLimitEvent(appInstall.name) if (ageLimitValidationResult.data?.requestPin == true) { val isAuthenticated = ParentalControlAuthenticator.awaitAuthentication() if (isAuthenticated) { ageLimitValidationResult.setData(ContentRatingValidity(true)) } } } else { EventBus.invokeEvent(AppEvent.ErrorMessageDialogEvent(R.string.data_load_error_desc)) } var ageIsValid = true if (ageLimitValidationResult.data?.isValid != true) { appInstallComponents.appManagerWrapper.cancelDownload(appInstall) ageIsValid = false } return ageIsValid } suspend fun awaitInvokeAgeLimitEvent(type: String) { val deferred = CompletableDeferred<Unit>() EventBus.invokeEvent(AppEvent.AgeLimitRestrictionEvent(type, deferred)) Loading Loading
app/detekt-baseline.xml +0 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ <ID>ChainWrapping:ValidateAppAgeLimitUseCase.kt$ValidateAppAgeLimitUseCase$&&</ID> <ID>CommentSpacing:ParentalControlAuthenticator.kt$ParentalControlAuthenticator$//Parental Control Key</ID> <ID>CommentSpacing:ParentalControlAuthenticator.kt$ParentalControlAuthenticator$//Parental Control intent</ID> <ID>CyclomaticComplexMethod:AppInstallProcessor.kt$AppInstallProcessor$suspend fun enqueueFusedDownload( appInstall: AppInstall, isAnUpdate: Boolean = false, isSystemApp: Boolean = false )</ID> <ID>EmptyCatchBlock:NativeDeviceInfoProviderModule.kt$NativeDeviceInfoProviderModule${ }</ID> <ID>EmptyFunctionBlock:CleanApkAuthenticator.kt$CleanApkAuthenticator${}</ID> <ID>FinalNewline:ContentRatingValidity.kt$foundation.e.apps.domain.model.ContentRatingValidity.kt</ID> Loading Loading @@ -233,7 +232,6 @@ <ID>MultiLineIfElse:SearchViewModel.kt$SearchViewModel$searchRepository.getSearchSuggestions(it)</ID> <ID>MultiLineIfElse:SettingsFragment.kt$SettingsFragment$true</ID> <ID>MultiLineIfElse:ValidateAppAgeLimitUseCase.kt$ValidateAppAgeLimitUseCase$fetchedContentRating</ID> <ID>NestedBlockDepth:AppInstallProcessor.kt$AppInstallProcessor$suspend fun enqueueFusedDownload( appInstall: AppInstall, isAnUpdate: Boolean = false, isSystemApp: Boolean = false )</ID> <ID>NewLineAtEndOfFile:ContentRatingValidity.kt$foundation.e.apps.domain.model.ContentRatingValidity.kt</ID> <ID>NewLineAtEndOfFile:SystemAppsUpdatesRepository.kt$foundation.e.apps.data.gitlab.SystemAppsUpdatesRepository.kt</ID> <ID>NoBlankLineBeforeRbrace:AgeGroupApi.kt$AgeGroupApi$ </ID> Loading
app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt +26 −19 Original line number Diff line number Diff line Loading @@ -139,25 +139,7 @@ class AppInstallProcessor @Inject constructor( return } val ageLimitValidationResult = validateAppAgeLimitUseCase.invoke(appInstall) if (ageLimitValidationResult.data?.isValid != true) { if (ageLimitValidationResult.isSuccess()) { awaitInvokeAgeLimitEvent(appInstall.name) if (ageLimitValidationResult.data?.requestPin == true){ val isAuthenticated = ParentalControlAuthenticator.awaitAuthentication() if (isAuthenticated) { ageLimitValidationResult.setData(ContentRatingValidity(true)) } } } else { EventBus.invokeEvent(AppEvent.ErrorMessageDialogEvent(R.string.data_load_error_desc)) } if (ageLimitValidationResult.data?.isValid != true) { appInstallComponents.appManagerWrapper.cancelDownload(appInstall) return } } if (!validateAgeLimit(appInstall)) return if (!context.isNetworkAvailable()) { appInstallComponents.appManagerWrapper.installationIssue(appInstall) Loading @@ -184,6 +166,31 @@ class AppInstallProcessor @Inject constructor( } } private suspend fun validateAgeLimit(appInstall: AppInstall): Boolean { val ageLimitValidationResult = validateAppAgeLimitUseCase.invoke(appInstall) if (ageLimitValidationResult.data?.isValid == true) { return true } if (ageLimitValidationResult.isSuccess()) { awaitInvokeAgeLimitEvent(appInstall.name) if (ageLimitValidationResult.data?.requestPin == true) { val isAuthenticated = ParentalControlAuthenticator.awaitAuthentication() if (isAuthenticated) { ageLimitValidationResult.setData(ContentRatingValidity(true)) } } } else { EventBus.invokeEvent(AppEvent.ErrorMessageDialogEvent(R.string.data_load_error_desc)) } var ageIsValid = true if (ageLimitValidationResult.data?.isValid != true) { appInstallComponents.appManagerWrapper.cancelDownload(appInstall) ageIsValid = false } return ageIsValid } suspend fun awaitInvokeAgeLimitEvent(type: String) { val deferred = CompletableDeferred<Unit>() EventBus.invokeEvent(AppEvent.AgeLimitRestrictionEvent(type, deferred)) Loading