Fetch the contact manager from the application.

Currently, the ContactsApplication provides a singleton
ContactPhotoManager to whoever requests one. However, if one uses
something other then the application context to fetch the
ContactPhotoManager, nothing will be returned, which means that there
will be multiple ContactPhotoManagers, one per activity.

Change-Id: Ic6f6e5f592e8707862cb39c1dce9c0db8cbf4686
diff --git a/src/com/android/contacts/ContactPhotoManager.java b/src/com/android/contacts/ContactPhotoManager.java
index e61d379..fe73fbe 100644
--- a/src/com/android/contacts/ContactPhotoManager.java
+++ b/src/com/android/contacts/ContactPhotoManager.java
@@ -66,11 +66,12 @@
      * the available authenticators. This method can safely be called from the UI thread.
      */
     public static ContactPhotoManager getInstance(Context context) {
+        Context applicationContext = context.getApplicationContext();
         ContactPhotoManager service =
-                (ContactPhotoManager) context.getSystemService(CONTACT_PHOTO_SERVICE);
+                (ContactPhotoManager) applicationContext.getSystemService(CONTACT_PHOTO_SERVICE);
         if (service == null) {
-            service = createContactPhotoManager(context);
-            Log.e(TAG, "No contact photo service in context: " + context);
+            service = createContactPhotoManager(applicationContext);
+            Log.e(TAG, "No contact photo service in context: " + applicationContext);
         }
         return service;
     }