Initialize mDatabase on provider startup
* Try to prevent startup-related races Bug: 6969684 Change-Id: I58ac16381bb71b8e21e01cb3ead0ba99f70c9873
This commit is contained in:
parent
9e4556ae1c
commit
6c319d78ed
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user