Update the Android `fileLastModified` method to return values in seconds instead of milliseconds

(cherry picked from commit cde873b406)
This commit is contained in:
Fredia Huya-Kouadio 2024-08-15 12:24:58 -07:00 committed by Rémi Verschelde
parent 2eb2052cb9
commit 26b151a945
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ internal class FileData(filePath: String, accessFlag: FileAccessFlags) : DataAcc
fun fileLastModified(filepath: String): Long {
return try {
File(filepath).lastModified()
File(filepath).lastModified() / 1000L
} catch (e: SecurityException) {
0L
}

View File

@ -203,7 +203,7 @@ internal class MediaStoreData(context: Context, filePath: String, accessFlag: Fi
}
val dataItem = result[0]
return dataItem.dateModified.toLong()
return dataItem.dateModified.toLong() / 1000L
}
fun rename(context: Context, from: String, to: String): Boolean {