Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b7127f4 authored by Ray Essick's avatar Ray Essick Committed by Android (Google) Code Review
Browse files

Merge "connect mediametrics service to statsd" into qt-dev

parents ceb7cc1f 6ce27e5f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -635,7 +635,7 @@ void NuPlayerDriver::logMetrics(const char *where) {

        // re-init in case we prepare() and start() again.
        delete mAnalyticsItem ;
        mAnalyticsItem = MediaAnalyticsItem::create("nuplayer");
        mAnalyticsItem = MediaAnalyticsItem::create(kKeyPlayer);
        if (mAnalyticsItem) {
            mAnalyticsItem->setUid(mClientUid);
        }
+4 −0
Original line number Diff line number Diff line
@@ -511,6 +511,7 @@ status_t AudioPolicyService::startInput(audio_port_handle_t portId)
    }

    // including successes gets very verbose
    // but once we cut over to westworld, log them all.
    if (status != NO_ERROR) {

        static constexpr char kAudioPolicy[] = "audiopolicy";
@@ -571,6 +572,9 @@ status_t AudioPolicyService::startInput(audio_port_handle_t portId)
            delete item;
            item = NULL;
        }
    }

    if (status != NO_ERROR) {
        client->active = false;
        client->startTimeNs = 0;
        updateUidStates_l();
+20 −1
Original line number Diff line number Diff line
@@ -7,8 +7,22 @@ cc_binary {
    srcs: [
        "main_mediametrics.cpp",
        "MediaAnalyticsService.cpp",
        "iface_statsd.cpp",
        "statsd_audiopolicy.cpp",
        "statsd_audiorecord.cpp",
        "statsd_audiothread.cpp",
        "statsd_audiotrack.cpp",
        "statsd_codec.cpp",
        "statsd_drm.cpp",
        "statsd_extractor.cpp",
        "statsd_nuplayer.cpp",
        "statsd_recorder.cpp",
    ],

    proto: {
        type: "lite",
    },

    shared_libs: [
        "libcutils",
        "liblog",
@@ -21,10 +35,15 @@ cc_binary {
        "libmediautils",
        "libmediametrics",
        "libstagefright_foundation",
        "libstatslog",
        "libutils",
        "libprotobuf-cpp-lite",
    ],

    static_libs: ["libregistermsext"],
    static_libs: [
        "libplatformprotos",
        "libregistermsext",
    ],

    include_dirs: [
        "frameworks/av/media/libstagefright/include",
+7 −4
Original line number Diff line number Diff line
@@ -210,21 +210,24 @@ MediaAnalyticsItem::SessionID_t MediaAnalyticsService::submit(MediaAnalyticsItem

    // XXX: if we have a sessionid in the new record, look to make
    // sure it doesn't appear in the finalized list.
    // XXX: this is for security / DOS prevention.
    // may also require that we persist the unique sessionIDs
    // across boots [instead of within a single boot]

    if (item->count() == 0) {
        // drop empty records
        ALOGV("dropping empty record...");
        delete item;
        item = NULL;
        return MediaAnalyticsItem::SessionIDInvalid;
    }

    // save the new record
    //
    // send a copy to statsd
    dump2Statsd(item);

    // and keep our copy for dumpsys
    MediaAnalyticsItem::SessionID_t id = item->getSessionID();
    saveItem(item);
    mItemsFinalized++;

    return id;
}

+3 −0
Original line number Diff line number Diff line
@@ -112,6 +112,9 @@ class MediaAnalyticsService : public BnMediaAnalyticsService

};

// hook to send things off to the statsd subsystem
extern bool dump2Statsd(MediaAnalyticsItem *item);

// ----------------------------------------------------------------------------

}; // namespace android
Loading