media.extractor pass client uid for attribution

media.extractor runs as as a centralized service, have it use the
client's uid for attribution of who requested the extraction.

Bug: 129191926
Test: boot, dumpsys media.metrics
gugelfrei
Ray Essick 5 years ago
parent b893fcd997
commit 74300e0e5b

@ -18,6 +18,7 @@
#define LOG_TAG "RemoteMediaExtractor"
#include <utils/Log.h>
#include <binder/IPCThreadState.h>
#include <media/stagefright/InterfaceUtils.h>
#include <media/MediaAnalyticsItem.h>
#include <media/MediaSource.h>
@ -51,6 +52,11 @@ RemoteMediaExtractor::RemoteMediaExtractor(
if (MEDIA_LOG) {
mAnalyticsItem = MediaAnalyticsItem::create(kKeyExtractor);
// we're in the extractor service, we want to attribute to the app
// that invoked us.
int uid = IPCThreadState::self()->getCallingUid();
mAnalyticsItem->setUid(uid);
// track the container format (mpeg, aac, wvm, etc)
size_t ntracks = extractor->countTracks();
mAnalyticsItem->setCString(kExtractorFormat, extractor->name());

Loading…
Cancel
Save