File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
app/src/main/kotlin/com/androidvip/sysctlgui/ui Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -138,10 +138,9 @@ class ExportOptionsViewModel(
138138 context : Context
139139 ): Result <Unit > = withContext(ioDispatcher) {
140140 return @withContext runCatching {
141- val descriptor = context.contentResolver.openFileDescriptor(target, " w" )
142- ? : throw IOException ()
143-
144- exportParamsUseCase(descriptor.fileDescriptor)
141+ context.contentResolver.openFileDescriptor(target, " w" ).use {
142+ exportParamsUseCase(it!! .fileDescriptor)
143+ }
145144 }
146145 }
147146
@@ -150,10 +149,9 @@ class ExportOptionsViewModel(
150149 context : Context
151150 ): Result <Unit > = withContext(ioDispatcher) {
152151 return @withContext runCatching {
153- val descriptor = context.contentResolver.openFileDescriptor(target, " w" )
154- ? : throw IOException ()
155-
156- backupParamsUseCase(descriptor.fileDescriptor)
152+ context.contentResolver.openFileDescriptor(target, " w" ).use {
153+ backupParamsUseCase(it!! .fileDescriptor)
154+ }
157155 }
158156 }
159157
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ class UserParamsViewModel(
6161
6262 fun setBaseFilterPredicate (predicate : ParamFilterPredicate ) {
6363 baseFilterPredicate = predicate
64+ currentFilterPredicate = baseFilterPredicate
6465 }
6566
6667 private fun delete (kernelParam : KernelParam ) {
You can’t perform that action at this time.
0 commit comments