Monitor binder status to media.metrics service

Add code to use binder's linkToDeath() so that our clients learn when
(infrequently, we hope) the media.metrics service dies for some
reason. When this happens, arrange for the client to re-establish
its connection to the service.

Bug: 66948389
Test: kill media.metrics, watch logcat for reestablishment messages
Change-Id: Ic518b955ce6816698b21e6a9c844587cef2e2712
diff --git a/media/libmediametrics/include/MediaAnalyticsItem.h b/media/libmediametrics/include/MediaAnalyticsItem.h
index 41b9658..dd7452f 100644
--- a/media/libmediametrics/include/MediaAnalyticsItem.h
+++ b/media/libmediametrics/include/MediaAnalyticsItem.h
@@ -42,6 +42,7 @@
     friend class IMediaAnalyticsService;
     friend class MediaMetricsJNI;
     friend class MetricsSummarizer;
+    friend class MediaMetricsDeathNotifier;
 
     public:
 
@@ -209,6 +210,7 @@
         // let's reuse a binder connection
         static sp<IMediaAnalyticsService> sAnalyticsService;
         static sp<IMediaAnalyticsService> getInstance();
+        static void dropInstance();
 
         // tracking information
         SessionID_t mSessionID;         // grouping similar records