Delay AccountTypeManager init until we have the Contacts permission 1/2
Bug 22690336
Change-Id: Ibaaea466183ebbc361c40c55185b4409ff17d423
diff --git a/src/com/android/contacts/ContactsApplication.java b/src/com/android/contacts/ContactsApplication.java
index eae078e..798614c 100644
--- a/src/com/android/contacts/ContactsApplication.java
+++ b/src/com/android/contacts/ContactsApplication.java
@@ -130,10 +130,12 @@
protected Void doInBackground(Void... params) {
final Context context = ContactsApplication.this;
- // Warm up the preferences, the account type manager and the contacts provider.
+ // Warm up the preferences and the contacts provider. We delay initialization
+ // of the account type manager because we may not have the contacts group permission
+ // (and thus not have the get accounts permission).
PreferenceManager.getDefaultSharedPreferences(context);
- AccountTypeManager.getInstance(context);
getContentResolver().getType(ContentUris.withAppendedId(Contacts.CONTENT_URI, 1));
+
return null;
}