File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/src/main/kotlin/org/fossify/messages/extensions Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -989,11 +989,13 @@ fun Context.deleteSmsDraft(threadId: Long) {
989989}
990990
991991fun Context.updateLastConversationMessage (threadId : Long ) {
992+ // update the date and the snippet of the thread, by triggering the
993+ // following Android code (which runs even if no messages are deleted):
994+ // https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/android14-release/src/com/android/providers/telephony/MmsSmsProvider.java#1409
992995 val uri = Threads .CONTENT_URI
993- val selection = " ${Threads ._ID } = ?"
994- val selectionArgs = arrayOf(threadId.toString())
996+ val selection = " 1 = 0" // always-false condition, because we don't actually want to delete any messages
995997 try {
996- contentResolver.delete(uri, selection, selectionArgs )
998+ contentResolver.delete(uri, selection, null )
997999 val newConversation = getConversations(threadId)[0 ]
9981000 insertOrUpdateConversation(newConversation)
9991001 } catch (e: Exception ) {
You can’t perform that action at this time.
0 commit comments