mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-17 04:00:35 +01:00
delete db after latest update
This commit is contained in:
parent
2fed3885cd
commit
9265946d64
@ -80,6 +80,13 @@ class MainActivity : SimpleActivity() {
|
||||
startActivityForResult(intent, MAKE_DEFAULT_APP_REQUEST)
|
||||
}
|
||||
}
|
||||
|
||||
if (!config.wasDbCleared) {
|
||||
ensureBackgroundThread {
|
||||
messagesDB.deleteAll()
|
||||
}
|
||||
config.wasDbCleared
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
@ -75,4 +75,8 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
var importMms: Boolean
|
||||
get() = prefs.getBoolean(IMPORT_MMS, true)
|
||||
set(importMms) = prefs.edit().putBoolean(IMPORT_MMS, importMms).apply()
|
||||
|
||||
var wasDbCleared: Boolean
|
||||
get() = prefs.getBoolean(WAS_DB_CLEARED, false)
|
||||
set(wasDbCleared) = prefs.edit().putBoolean(WAS_DB_CLEARED, wasDbCleared).apply()
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ const val EXPORT_MIME_TYPE = "application/json"
|
||||
const val EXPORT_FILE_EXT = ".json"
|
||||
const val IMPORT_SMS = "import_sms"
|
||||
const val IMPORT_MMS = "import_mms"
|
||||
const val WAS_DB_CLEARED = "was_db_cleared"
|
||||
|
||||
private const val PATH = "com.simplemobiletools.smsmessenger.action."
|
||||
const val MARK_AS_READ = PATH + "mark_as_read"
|
||||
|
@ -43,4 +43,7 @@ interface MessagesDao {
|
||||
|
||||
@Query("DELETE FROM messages WHERE thread_id = :threadId")
|
||||
fun deleteThreadMessages(threadId: Long)
|
||||
|
||||
@Query("DELETE FROM messages")
|
||||
fun deleteAll()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user