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

Commit 318b26e7 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge changes Idf19827e,Ifcada098

* changes:
  MediaMetrics: Add unit tests
  MediaMetrics: Update to use STL containers
parents 71124db6 c89c8dc5
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -234,10 +234,6 @@ MediaAnalyticsItem &MediaAnalyticsItem::setKey(MediaAnalyticsItem::Key key) {
    return *this;
}

MediaAnalyticsItem::Key MediaAnalyticsItem::getKey() {
    return mKey;
}

// number of attributes we have in this record
int32_t MediaAnalyticsItem::count() const {
    return mPropCount;
@@ -795,11 +791,11 @@ const char * MediaAnalyticsItem::toCString(int version) {
    return strdup(val.c_str());
}

std::string MediaAnalyticsItem::toString() {
std::string MediaAnalyticsItem::toString() const {
   return toString(PROTO_LAST);
}

std::string MediaAnalyticsItem::toString(int version) {
std::string MediaAnalyticsItem::toString(int version) const {

    // v0 : released with 'o'
    // v1 : bug fix (missing pid/finalized separator),
+20 −14
Original line number Diff line number Diff line
@@ -39,19 +39,25 @@ class IMediaAnalyticsService: public IInterface
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 @@ public:
class BnMediaAnalyticsService: public BnInterface<IMediaAnalyticsService>
{
public:
    virtual status_t    onTransact( uint32_t code,
    status_t onTransact(uint32_t code,
                        const Parcel& data,
                        Parcel* reply,
                                    uint32_t flags = 0);
                        uint32_t flags = 0) override;
};

}; // namespace android
+3 −3
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ class MediaAnalyticsItem {
        // set the key discriminator for the record.
        // most often initialized as part of the constructor
        MediaAnalyticsItem &setKey(MediaAnalyticsItem::Key);
        MediaAnalyticsItem::Key getKey();
        const MediaAnalyticsItem::Key& getKey() const { return mKey; }

        // # of attributes in the record
        int32_t count() const;
@@ -191,8 +191,8 @@ class MediaAnalyticsItem {
        // supports the stable interface
        bool dumpAttributes(char **pbuffer, size_t *plength);

        std::string toString();
        std::string toString(int version);
        std::string toString() const;
        std::string toString(int version) const;
        const char *toCString();
        const char *toCString(int version);

+30 −26
Original line number Diff line number Diff line
@@ -6,8 +6,32 @@ cc_binary {

    srcs: [
        "main_mediametrics.cpp",
        "MediaAnalyticsService.cpp",
    ],

    shared_libs: [
        "libbinder",
        "liblog",
        "libmediaanalyticsservice",
        "libutils",
    ],

    init_rc: [
        "mediametrics.rc",
    ],

    cflags: [
        "-Wall",
        "-Werror",
        "-Wextra",
    ],
}

cc_library_shared {
    name: "libmediaanalyticsservice",

    srcs: [
        "iface_statsd.cpp",
        "MediaAnalyticsService.cpp",
        "statsd_audiopolicy.cpp",
        "statsd_audiorecord.cpp",
        "statsd_audiothread.cpp",
@@ -24,45 +48,25 @@ cc_binary {
    },

    shared_libs: [
        "libcutils",
        "liblog",
        "libmedia",
        "libutils",
        "libbinder",
        "libdl",
        "libgui",
        "libmedia",
        "libmediautils",
        "liblog",
        "libmediametrics",
        "libstagefright_foundation",
        "libprotobuf-cpp-lite",
        "libstatslog",
        "libutils",
        "libprotobuf-cpp-lite",
    ],

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

    include_dirs: [
        "frameworks/av/media/libstagefright/include",
        "frameworks/av/media/libstagefright/rtsp",
        "frameworks/av/media/libstagefright/webm",
        "frameworks/av/include/media",
        "frameworks/av/camera/include/camera",
        "frameworks/native/include/media/openmax",
        "frameworks/native/include/media/hardware",
        "external/tremolo/Tremolo",
        "system/media/audio_utils/include",
    ],

    init_rc: ["mediametrics.rc"],

    cflags: [
        "-Werror",
        "-Wall",
        "-Wno-error=deprecated-declarations",
        "-Werror",
        "-Wextra",
    ],
    clang: true,

}
+272 −445

File changed.

Preview size limit exceeded, changes collapsed.

Loading