mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-06-05 21:59:31 +02:00
Prevent running recycle bin check on Q+ devices
This commit is contained in:
@ -159,11 +159,19 @@ fun BaseSimpleActivity.moveRecordingsToRecycleBin(recordingsToMove: Collection<R
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun BaseSimpleActivity.checkRecycleBinItems() {
|
fun BaseSimpleActivity.checkRecycleBinItems() {
|
||||||
|
if (isQPlus()) {
|
||||||
|
// System is handling recycle bin on Q+ devices
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (config.useRecycleBin && config.lastRecycleBinCheck < System.currentTimeMillis() - DAY_SECONDS * 1000) {
|
if (config.useRecycleBin && config.lastRecycleBinCheck < System.currentTimeMillis() - DAY_SECONDS * 1000) {
|
||||||
config.lastRecycleBinCheck = System.currentTimeMillis()
|
config.lastRecycleBinCheck = System.currentTimeMillis()
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
try {
|
try {
|
||||||
deleteRecordings(getLegacyRecordings(trashed = true).filter { it.timestamp < System.currentTimeMillis() - MONTH_SECONDS * 1000L }) {}
|
val recordingsToRemove = getLegacyRecordings(trashed = true).filter { it.timestamp < System.currentTimeMillis() - MONTH_SECONDS * 1000L }
|
||||||
|
if (recordingsToRemove.isNotEmpty()) {
|
||||||
|
deleteRecordings(recordingsToRemove) {}
|
||||||
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user