mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-15 18:48:52 +01:00
Return nullable cursors when mapping from native contentprovider
This commit is contained in:
@@ -47,7 +47,7 @@ class CursorToContactImpl @Inject constructor(private val context: Context) : Cu
|
||||
lastUpdate = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
override fun getContactsCursor(): Cursor {
|
||||
override fun getContactsCursor(): Cursor? {
|
||||
return context.contentResolver.query(URI, PROJECTION, null, null, null)
|
||||
}
|
||||
|
||||
|
||||
@@ -61,13 +61,13 @@ class CursorToConversationImpl @Inject constructor(private val context: Context)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getConversationsCursor(lastSync: Long): Cursor {
|
||||
override fun getConversationsCursor(lastSync: Long): Cursor? {
|
||||
return context.contentResolver.query(URI, PROJECTION,
|
||||
"date > $lastSync", null,
|
||||
"date desc")
|
||||
}
|
||||
|
||||
override fun getConversationCursor(threadId: Long): Cursor {
|
||||
override fun getConversationCursor(threadId: Long): Cursor? {
|
||||
return context.contentResolver.query(URI, PROJECTION,
|
||||
"_id = ?", arrayOf(threadId.toString()), null)
|
||||
}
|
||||
|
||||
@@ -119,11 +119,11 @@ class CursorToMessageImpl @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun getMessagesCursor(): Cursor {
|
||||
override fun getMessagesCursor(): Cursor? {
|
||||
return context.contentResolver.query(URI, PROJECTION, null, null, "normalized_date desc")
|
||||
}
|
||||
|
||||
override fun getMessageCursor(id: Long): Cursor {
|
||||
override fun getMessageCursor(id: Long): Cursor? {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ class CursorToRecipienImpl @Inject constructor(private val context: Context) : C
|
||||
lastUpdate = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
override fun getRecipientCursor(): Cursor {
|
||||
override fun getRecipientCursor(): Cursor? {
|
||||
return context.contentResolver.query(URI, null, null, null, null)
|
||||
}
|
||||
|
||||
override fun getRecipientCursor(id: Long): Cursor {
|
||||
override fun getRecipientCursor(id: Long): Cursor? {
|
||||
return context.contentResolver.query(URI, null, "_id = ?", arrayOf(id.toString()), null)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user