Turning contact photo loader into an application-wide service.
It will no longer need to reload everything on orientation change
and other similar events.
Change-Id: Ibd4c823673d6b380df96a91a2829d24f910bcfbd
diff --git a/src/com/android/contacts/ContactsApplication.java b/src/com/android/contacts/ContactsApplication.java
index 8346c04..42ea641 100644
--- a/src/com/android/contacts/ContactsApplication.java
+++ b/src/com/android/contacts/ContactsApplication.java
@@ -31,6 +31,7 @@
private static InjectedServices sInjectedServices;
private AccountTypeManager mAccountTypeManager;
+ private ContactPhotoManager mContactPhotoManager;
/**
* Overrides the system services with mocks for testing.
@@ -82,6 +83,13 @@
return mAccountTypeManager;
}
+ if (ContactPhotoManager.CONTACT_PHOTO_SERVICE.equals(name)) {
+ if (mContactPhotoManager == null) {
+ mContactPhotoManager = ContactPhotoManager.createContactPhotoManager(this);
+ }
+ return mContactPhotoManager;
+ }
+
return super.getSystemService(name);
}