Don't log error when finding if we can use subId

This commit is contained in:
Moez Bhatti
2018-07-25 14:34:18 -04:00
parent 66a41841c4
commit 99f115d06b
2 changed files with 6 additions and 3 deletions
@@ -130,7 +130,7 @@ class CursorToMessageImpl @Inject constructor(
// column. In this case, we need to check if we do, before trying to sync messages
if (!preferences.canUseSubId.isSet) {
val canUseSubId = tryOrNull {
SqliteWrapper.query(context, uri, arrayOf(Mms.SUBSCRIPTION_ID))?.use { true }
SqliteWrapper.query(context, uri, arrayOf(Mms.SUBSCRIPTION_ID), logError = false)?.use { true }
}
preferences.canUseSubId.set(canUseSubId ?: false)
@@ -35,12 +35,15 @@ object SqliteWrapper {
projection: Array<String>? = null,
selection: String? = null,
selectionArgs: Array<String>? = null,
sortOrder: String? = null
sortOrder: String? = null,
logError: Boolean = true
): Cursor? {
return try {
context.contentResolver.query(uri, projection, selection, selectionArgs, sortOrder)
} catch (e: SQLiteException) {
Timber.e(e)
if (logError) {
Timber.e(e)
}
null
}