diff options
| author | Martin Hibdon <mhibdon@google.com> | 2013-10-11 11:28:32 -0700 |
|---|---|---|
| committer | Martin Hibdon <mhibdon@google.com> | 2013-10-11 15:18:41 -0700 |
| commit | f7078466c3a5ac9eefc388787aa5fcf187dfe4ee (patch) | |
| tree | e800871c8e9cf6a7f361eab6093ac826ffaea04d /emailcommon | |
| parent | a5312d5b977064eaa6d683d338effa9e859858ed (diff) | |
| download | android_packages_apps_Email-f7078466c3a5ac9eefc388787aa5fcf187dfe4ee.tar.gz android_packages_apps_Email-f7078466c3a5ac9eefc388787aa5fcf187dfe4ee.tar.bz2 android_packages_apps_Email-f7078466c3a5ac9eefc388787aa5fcf187dfe4ee.zip | |
Always fix parent keys on startup of email
b/11174975
There are already several database fixing steps that
occur when the database is opened, add another one
to correct uninitialzed mailbox parent keys.
This is because we use a two pass system for adding
mailbox rows, first to insert the rows, and second to
assign parentKeys to child rows. We need two passes
because we may insert a child row before its parent,
so the parent's rowId is unavailble. But if the process
dies before the second step is complete we'll be in
an inconsistent state.
Change-Id: Ifaeeaca7e82c1e99656033bc1a9f25d7acb67517
Diffstat (limited to 'emailcommon')
| -rw-r--r-- | emailcommon/src/com/android/emailcommon/provider/MailboxUtilities.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/emailcommon/src/com/android/emailcommon/provider/MailboxUtilities.java b/emailcommon/src/com/android/emailcommon/provider/MailboxUtilities.java index c18676a72..f88cee827 100644 --- a/emailcommon/src/com/android/emailcommon/provider/MailboxUtilities.java +++ b/emailcommon/src/com/android/emailcommon/provider/MailboxUtilities.java @@ -30,6 +30,9 @@ import com.android.mail.utils.LogUtils; import java.util.HashMap; public class MailboxUtilities { + + public static final String FIX_PARENT_KEYS_METHOD = "fix_parent_keys"; + public static final String WHERE_PARENT_KEY_UNINITIALIZED = "(" + MailboxColumns.PARENT_KEY + " isnull OR " + MailboxColumns.PARENT_KEY + "=" + Mailbox.PARENT_KEY_UNINITIALIZED + ")"; |
