mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 18:45:45 +00:00
android: FileUtil: Add option to suppress log for native exists() calls
We often check for the existence of files that only exist in ExeFS so this can spam logcat with useless messages when scanning for games.
This commit is contained in:
parent
df17162f9c
commit
366f5b80d6
2 changed files with 5 additions and 3 deletions
|
@ -92,7 +92,7 @@ object NativeLibrary {
|
|||
return if (DocumentsTree.isNativePath(path!!)) {
|
||||
YuzuApplication.documentsTree!!.exists(path)
|
||||
} else {
|
||||
FileUtil.exists(path)
|
||||
FileUtil.exists(path, suppressLog = true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ object FileUtil {
|
|||
* @param path Native content uri path
|
||||
* @return bool
|
||||
*/
|
||||
fun exists(path: String?): Boolean {
|
||||
fun exists(path: String?, suppressLog: Boolean = false): Boolean {
|
||||
var c: Cursor? = null
|
||||
try {
|
||||
val mUri = Uri.parse(path)
|
||||
|
@ -152,7 +152,9 @@ object FileUtil {
|
|||
c = context.contentResolver.query(mUri, columns, null, null, null)
|
||||
return c!!.count > 0
|
||||
} catch (e: Exception) {
|
||||
if (!suppressLog) {
|
||||
Log.info("[FileUtil] Cannot find file from given path, error: " + e.message)
|
||||
}
|
||||
} finally {
|
||||
closeQuietly(c)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue