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

Commit 929642ee authored by James Dong's avatar James Dong
Browse files

Add runtime dumpsys support for media recorder client

Change-Id: I4c8a81720f3be2db54678a7e84fe12849255046b
parent fd84f97a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct MediaRecorderBase {
    virtual status_t close() = 0;
    virtual status_t reset() = 0;
    virtual status_t getMaxAmplitude(int *max) = 0;
    virtual status_t dump(int fd, const Vector<String16>& args) const = 0;

private:
    MediaRecorderBase(const MediaRecorderBase &);
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public:
    virtual status_t close();
    virtual status_t reset();
    virtual status_t getMaxAmplitude(int *max);
    virtual status_t dump(int fd, const Vector<String16>& args) const;

private:
    status_t doStop();
+11 −5
Original line number Diff line number Diff line
@@ -511,11 +511,17 @@ status_t MediaPlayerService::dump(int fd, const Vector<String16>& args)
            sp<Client> c = mClients[i].promote();
            if (c != 0) c->dump(fd, args);
        }
        if (mMediaRecorderClients.size() == 0) {
                result.append(" No media recorder client\n\n");
        } else {
            for (int i = 0, n = mMediaRecorderClients.size(); i < n; ++i) {
            result.append(" MediaRecorderClient\n");
                sp<MediaRecorderClient> c = mMediaRecorderClients[i].promote();
            snprintf(buffer, 255, "  pid(%d)\n\n", c->mPid);
                snprintf(buffer, 255, " MediaRecorderClient pid(%d)\n", c->mPid);
                result.append(buffer);
                write(fd, result.string(), result.size());
                result = "\n";
                c->dump(fd, args);
            }
        }

        result.append(" Files opened and/or mapped:\n");
+7 −0
Original line number Diff line number Diff line
@@ -329,5 +329,12 @@ status_t MediaRecorderClient::setListener(const sp<IMediaRecorderClient>& listen
    return mRecorder->setListener(listener);
}

status_t MediaRecorderClient::dump(int fd, const Vector<String16>& args) const {
    if (mRecorder != NULL) {
        return mRecorder->dump(fd, args);
    }
    return OK;
}

}; // namespace android
+10 −9
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ public:
    virtual     status_t        close();
    virtual     status_t        release();

    virtual     status_t        dump(int fd, const Vector<String16>& args) const;
private:
    friend class                MediaPlayerService;  // for accessing private constructor

Loading