Dereference cached Bitmaps in EventLogger

In Telecom, we cache the last 10 calls that have been placed in
order to provide detailed event logs during a call for bugreports.
We were also mistakenly keeping around the cached contact photo/
icon, causing unnecessarily high memory usage.

This change dereferences the Bitmaps when the calls are destroyed
so that the Bitmaps are not hanging around when the calls are
cached for Logging.

Bug: 62038439
Test: Ensure Bitmaps are not still in memory by looking at memory dump
Merged-In: I7370880b59e3096bc95e7a5b127bd355d9c96b4f
Change-Id: Iba265a10145f2db6f57b27adee59d812ccb7ca5c
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 1cc4887..ec330ec 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -570,6 +570,13 @@
     }
 
     public void destroy() {
+        // We should not keep these bitmaps around because the Call objects may be held for logging
+        // purposes.
+        // TODO: Make a container object that only stores the information we care about for Logging.
+        if (mCallerInfo != null) {
+            mCallerInfo.cachedPhotoIcon = null;
+            mCallerInfo.cachedPhoto = null;
+        }
         Log.addEvent(this, LogUtils.Events.DESTROYED);
     }