From 6c319d78edc52cd4a6d2f53277d2e1cef1afc5bc Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 3 Sep 2012 18:58:24 -0700 Subject: [PATCH] Initialize mDatabase on provider startup * Try to prevent startup-related races Bug: 6969684 Change-Id: I58ac16381bb71b8e21e01cb3ead0ba99f70c9873 --- src/com/android/email/provider/EmailProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 7cc62141a..d72311576 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -1046,6 +1046,7 @@ public class EmailProvider extends ContentProvider { @Override public boolean onCreate() { Context context = getContext(); + // Initialize Uri's used throughout the app EmailContent.init(context); if (INTEGRITY_CHECK_URI == null) { INTEGRITY_CHECK_URI = Uri.parse("content://" + EmailContent.AUTHORITY + @@ -1184,6 +1185,8 @@ public class EmailProvider extends ContentProvider { matcher.addURI(EmailContent.AUTHORITY, "pickTrashFolder/#", ACCOUNT_PICK_TRASH_FOLDER); matcher.addURI(EmailContent.AUTHORITY, "pickSentFolder/#", ACCOUNT_PICK_SENT_FOLDER); } + // Open our database(s) + getDatabase(context); return false; }