Skip to content

Do not backup the messages db - #347

Open
RankoR wants to merge 1 commit into
GrapheneOS:mainfrom
RankoR-GOS:dont-backup-messages-db
Open

RankoR wants to merge 1 commit into
GrapheneOS:mainfrom
RankoR-GOS:dont-backup-messages-db

Conversation

@RankoR

@RankoR RankoR commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

bugle_db ties each conversation to an SMS thread ID from the phone's SMS database. When SMS are restored, that database gives the threads new IDs, and this causes wrong thread/contact linking.

@RankoR
RankoR marked this pull request as ready for review September 27, 2026 20:01
Comment thread res/xml/backup_rules.xml
Comment on lines -3 to +12
<cloud-backup disableIfNoEncryptionCapabilities="true" />
<device-transfer/>
<cloud-backup disableIfNoEncryptionCapabilities="true">
<exclude
domain="database"
path="bugle_db" />
</cloud-backup>
<device-transfer>
<exclude
domain="database"
path="bugle_db" />
</device-transfer>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are likely other places that use bugle_db specific IDs that are being backed up

e.g. https://github.com/GrapheneOS/Messaging/blob/main/src/com/android/messaging/widget/WidgetConversationPrefs.kt uses the conversations._id autoincrementing key as a string in bugle_widgets.xml shared preferences, so if bugle_db is no longer backed up, the internal autoincrement id wouldn't make sense on new installs

Notification channels in https://github.com/GrapheneOS/Messaging/blob/main/src/com/android/messaging/util/NotificationChannelUtil.kt also use the internal autoincrement id, and Android backs up those notification settings + channels separately from the app backup (https://github.com/GrapheneOS/platform_frameworks_base/blob/17/services/core/java/com/android/server/notification/PreferencesHelper.java#L830)

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.

2 participants