Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dccfa943 authored by Walter Jang's avatar Walter Jang
Browse files

Delay AccountTypeManager init until we have the Contacts permission 1/2

Bug 22690336

Change-Id: Ibaaea466183ebbc361c40c55185b4409ff17d423
parent 03debc68
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -130,10 +130,12 @@ public final class ContactsApplication extends Application {
        protected Void doInBackground(Void... params) {
        protected Void doInBackground(Void... params) {
            final Context context = ContactsApplication.this;
            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);
            PreferenceManager.getDefaultSharedPreferences(context);
            AccountTypeManager.getInstance(context);
            getContentResolver().getType(ContentUris.withAppendedId(Contacts.CONTENT_URI, 1));
            getContentResolver().getType(ContentUris.withAppendedId(Contacts.CONTENT_URI, 1));

            return null;
            return null;
        }
        }