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

Commit d300ca33 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add Recorder Session ID"

parents 6642b4d1 2aebc81c
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ static const char *kKeyRecorder = "recorder";
// NB: these are matched with public Java API constants defined
// in frameworks/base/media/java/android/media/MediaRecorder.java
// These must be kept synchronized with the constants there.
static const char *kRecorderLogSessionId = "android.media.mediarecorder.log-session-id";
static const char *kRecorderAudioBitrate = "android.media.mediarecorder.audio-bitrate";
static const char *kRecorderAudioChannels = "android.media.mediarecorder.audio-channels";
static const char *kRecorderAudioSampleRate = "android.media.mediarecorder.audio-samplerate";
@@ -159,6 +160,8 @@ void StagefrightRecorder::updateMetrics() {
    // know is the app which requested the recording.
    mMetricsItem->setUid(mClientUid);

    mMetricsItem->setCString(kRecorderLogSessionId, mLogSessionId.c_str());

    // populate the values from the raw fields.

    // TBD mOutputFormat  = OUTPUT_FORMAT_THREE_GPP;
@@ -913,6 +916,14 @@ status_t StagefrightRecorder::requestIDRFrame() {
    return ret;
}

status_t StagefrightRecorder::setLogSessionId(const String8 &log_session_id) {
    ALOGV("setLogSessionId: %s", log_session_id.string());

    // TODO: validity check that log_session_id is a 32-byte hex digit.
    mLogSessionId.setTo(log_session_id.string());
    return OK;
}

status_t StagefrightRecorder::setParameter(
        const String8 &key, const String8 &value) {
    ALOGV("setParameter: key (%s) => value (%s)", key.string(), value.string());
@@ -1081,6 +1092,8 @@ status_t StagefrightRecorder::setParameter(
        if (safe_strtoi64(value.string(), &networkHandle)) {
            return setSocketNetwork(networkHandle);
        }
    } else if (key == "log-session-id") {
        return setLogSessionId(value);
    } else {
        ALOGE("setParameter: failed to find key %s", key.string());
    }
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ struct StagefrightRecorder : public MediaRecorderBase {
    explicit StagefrightRecorder(const String16 &opPackageName);
    virtual ~StagefrightRecorder();
    virtual status_t init();
    virtual status_t setLogSessionId(const String8 &id);
    virtual status_t setAudioSource(audio_source_t as);
            status_t setPrivacySensitive(bool privacySensitive) override;
            status_t isPrivacySensitive(bool *privacySensitive) const override;
@@ -109,6 +110,7 @@ private:
    void flushAndResetMetrics(bool reinitialize);
    void updateMetrics();

    AString mLogSessionId;
    audio_source_t mAudioSource;
    privacy_sensitive_t mPrivacySensitive;
    video_source mVideoSource;
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@ bool statsd_recorder(const mediametrics::Item *item)
    // flesh out the protobuf we'll hand off with our data
    //

    // string kRecorderLogSessionId = "android.media.mediarecorder.log-session-id";
    std::string log_session_id;
    if (item->getString("android.media.mediarecorder.log_session_id", &log_session_id)) {
        metrics_proto.set_log_session_id(std::move(log_session_id));
    }
    // string kRecorderAudioMime = "android.media.mediarecorder.audio.mime";
    std::string audio_mime;
    if (item->getString("android.media.mediarecorder.audio.mime", &audio_mime)) {