Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conversation dates on import #265

Merged
merged 3 commits into from
Dec 27, 2024

Conversation

tom93
Copy link
Contributor

@tom93 tom93 commented Dec 27, 2024

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

  • Fix conversation dates on import (see commit message for details)
  • Add bulk version of updateLastConversationMessage() for use by the above fix

Fixes the following issue(s)

Acknowledgement

Tested in emulator on Android 8 and 14 using the steps from #146.

In situations where we want to update multiple conversations (e.g.
during import), we can make it faster by only calling
contentResolver.delete() once.

(We still make separate calls to getConversations() because it doesn't
support multiple IDs, and likewise insertOrUpdateConversation()
doesn't support bulk insert.)
When we insert a message, Android's Telephony provider sets the
conversation date to the current time rather than the time of the
message that was inserted.[1] This commit implements a workaround that
fixes the conversation timestamps.

Fixes FossifyOrg#146, FossifyOrg#42.

[1] https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/android14-release/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java#134
@tom93 tom93 changed the title Pr/import fix timestamps Fix conversation dates on import Dec 27, 2024
@naveensingh
Copy link
Member

It works™

@naveensingh naveensingh merged commit 32b2069 into FossifyOrg:master Dec 27, 2024
2 of 4 checks passed
@tom93 tom93 mentioned this pull request Dec 27, 2024
7 tasks
@tom93 tom93 deleted the pr/import-fix-timestamps branch December 27, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imported conversations have incorrect timestamps SMSs are not imported in chronological order
2 participants