[2.15.0_merge_3.2.0]
This commit is contained in:
@@ -92,6 +92,22 @@ object DataManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun delMsgTable(context: Context) {
|
||||
if (Thread.currentThread() == Looper.getMainLooper().thread) {
|
||||
scope.launch {
|
||||
withContext(Dispatchers.Default) {
|
||||
MsgBoxDb.getDb(context)
|
||||
.monitorDao()
|
||||
.deleteMsgTable()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MsgBoxDb.getDb(context)
|
||||
.monitorDao()
|
||||
.deleteMsgTable()
|
||||
}
|
||||
}
|
||||
|
||||
private fun realSaveMsg(msg: MsgBoxBean) {
|
||||
val type = msg.type
|
||||
msg.timestamp = System.currentTimeMillis()
|
||||
|
||||
@@ -34,6 +34,10 @@ class MsgBoxProvider : IMsgBoxProvider {
|
||||
DataManager.saveMsg(bean)
|
||||
}
|
||||
|
||||
override fun delMsgTable(context: Context) {
|
||||
DataManager.delMsgTable(context)
|
||||
}
|
||||
|
||||
override fun getCachedNotifyData(): List<MsgBoxBean> {
|
||||
return DataManager.getNotifyData()
|
||||
}
|
||||
|
||||
@@ -15,4 +15,7 @@ interface MsgBoxDao {
|
||||
|
||||
@Query("SELECT * FROM t_msg_box")
|
||||
fun getAllCachedMessages(): List<MsgBoxInfo>
|
||||
|
||||
@Query("DELETE FROM t_msg_box")
|
||||
fun deleteMsgTable()
|
||||
}
|
||||
Reference in New Issue
Block a user