Don't allow KEEP_LONGER logs to get too large.

This commit is contained in:
Greyson Parrelli
2022-03-25 14:57:08 -04:00
parent 50d5658add
commit b9ce38b85b
2 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
package org.signal.core.util
import androidx.sqlite.db.SupportSQLiteDatabase
fun SupportSQLiteDatabase.getTableRowCount(table: String): Int {
return this.query("SELECT COUNT(*) FROM $table").use {
if (it.moveToFirst()) {
it.getInt(0)
} else {
0
}
}
}