MediaMetrics: Add unit tests
Document some interface differences.
Test: mediametrics_tests
Change-Id: Idf19827e79136dcca6522e6df53e28e3ea4a2231
diff --git a/media/libmediametrics/include/IMediaAnalyticsService.h b/media/libmediametrics/include/IMediaAnalyticsService.h
index f635e94..f2e7710 100644
--- a/media/libmediametrics/include/IMediaAnalyticsService.h
+++ b/media/libmediametrics/include/IMediaAnalyticsService.h
@@ -39,19 +39,25 @@
public:
DECLARE_META_INTERFACE(MediaAnalyticsService);
- // generate a unique sessionID to use across multiple requests
- // 'unique' is within this device, since last reboot
+ /**
+ * Returns a unique sessionID to use across multiple requests;
+ * 'unique' is within this device, since last reboot.
+ */
virtual MediaAnalyticsItem::SessionID_t generateUniqueSessionID() = 0;
- // submit the indicated record to the mediaanalytics service, where
- // it will be merged (if appropriate) with incomplete records that
- // share the same key and sessionid.
- // 'forcenew' marks any matching incomplete record as complete before
- // inserting this new record.
- // returns the sessionID associated with that item.
- // caller continues to own the passed item
+ /**
+ * Submits the indicated record to the mediaanalytics service, where
+ * it will be merged (if appropriate) with incomplete records that
+ * share the same key and sessionID.
+ *
+ * \param item the item to submit.
+ * \param forcenew marks any matching incomplete record as complete before
+ * inserting this new record.
+ *
+ * \return the sessionID associated with that item or
+ * MediaAnalyticsItem::SessionIDInvalid on failure.
+ */
virtual MediaAnalyticsItem::SessionID_t submit(MediaAnalyticsItem *item, bool forcenew) = 0;
-
};
// ----------------------------------------------------------------------------
@@ -59,10 +65,10 @@
class BnMediaAnalyticsService: public BnInterface<IMediaAnalyticsService>
{
public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
+ status_t onTransact(uint32_t code,
+ const Parcel& data,
+ Parcel* reply,
+ uint32_t flags = 0) override;
};
}; // namespace android