Make photo loader low-memory device friendly
- Now the L2 bitmap cache counts the actual bitmap size in bytes,
instead if just the number of bitmaps. We started to deal with
various different dimensions of bitmaps, so it's more appropriate.
- Half the cache on low-memory devices.
- Clear the caches on onTrimMemory() with TRIM_MEMORY_MODERATE.
- Moved cache size values from resources to contacts.
- Added a bunch of debug logs.
Bug 5587258
Change-Id: Ib86512293be3af06b5dac58aae13f9596f56334a
diff --git a/src/com/android/contacts/ContactsApplication.java b/src/com/android/contacts/ContactsApplication.java
index 16f9e57..b23dde1 100644
--- a/src/com/android/contacts/ContactsApplication.java
+++ b/src/com/android/contacts/ContactsApplication.java
@@ -95,6 +95,7 @@
if (ContactPhotoManager.CONTACT_PHOTO_SERVICE.equals(name)) {
if (mContactPhotoManager == null) {
mContactPhotoManager = ContactPhotoManager.createContactPhotoManager(this);
+ registerComponentCallbacks(mContactPhotoManager);
mContactPhotoManager.preloadPhotosInBackground();
}
return mContactPhotoManager;