File tree Expand file tree Collapse file tree
domain/src/main/java/com/androidvip/sysctlgui/domain/usecase Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ class ImportParamsUseCase(
1717 fileExtension : String
1818 ): Result <List <DomainKernelParam >> {
1919 return runCatching {
20+ val isBackup = fileExtension.endsWith(" .conf" )
2021 val importResult = when {
2122 fileExtension.endsWith(" .json" ) -> repository.importParamsFromJson(stream)
22- fileExtension.endsWith( " .conf " ) -> repository.importParamsFromConf(stream)
23+ isBackup -> repository.importParamsFromConf(stream)
2324 else -> throw InvalidFileExtensionException ()
2425 }
2526
@@ -36,7 +37,11 @@ class ImportParamsUseCase(
3637 }
3738
3839 clearUserParamUseCase.execute()
39- addUserParamsUseCase.execute(successfulParams)
40+
41+ // Prevent adding full backups to the apply-on-boot list
42+ if (! isBackup) {
43+ addUserParamsUseCase.execute(successfulParams)
44+ }
4045
4146 successfulParams
4247 }
You can’t perform that action at this time.
0 commit comments