Merge pull request #3535 from kiwix/search_not_working_in_dwds_app

Fixed, the search is not working in dwds app.
This commit is contained in:
Kelson 2023-11-17 17:41:22 +01:00 committed by GitHub
commit e6b76a5327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -320,7 +320,6 @@ class ZimFileReader constructor(
fun dispose() {
jniKiwixReader.dispose()
searcher.dispose()
assetFileDescriptor?.parcelFileDescriptor?.detachFd()
}
@Suppress("TooGenericExceptionCaught")

View File

@ -84,9 +84,12 @@ class ZimReaderContainer @Inject constructor(private val zimFileReaderFactory: F
}
fun copyReader(): ZimFileReader? = zimFile?.let(zimFileReaderFactory::create)
?: assetFileDescriptor?.let(zimFileReaderFactory::create)
val zimFile get() = zimFileReader?.zimFile
val assetFileDescriptor get() = zimFileReader?.assetFileDescriptor
/**
* Return the zimFile path if opened from file else return the filePath of assetFileDescriptor
*/