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

Commit f470bf3f authored by Wei Jia's avatar Wei Jia Committed by Android Git Automerger
Browse files

am 031e841e: am 8656914f: am b90b8291: am cb70fdbe: Merge "OMX: allow only...

am 031e841e: am 8656914f: am b90b8291: am cb70fdbe: Merge "OMX: allow only secure codec to remotely call allocateBuffer." into mnc-dev

* commit '031e841e':
  OMX: allow only secure codec to remotely call allocateBuffer.
parents 280ac6b1 031e841e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -249,6 +249,12 @@ public:
    virtual status_t onTransact(
            uint32_t code, const Parcel &data, Parcel *reply,
            uint32_t flags = 0);

protected:
    // check if the codec is secure.
    virtual bool isSecure(IOMX::node_id node) {
        return false;
    }
};

class BnOMXObserver : public BnInterface<IOMXObserver> {
+6 −0
Original line number Diff line number Diff line
@@ -963,6 +963,12 @@ status_t BnOMX::onTransact(

            node_id node = (node_id)data.readInt32();
            OMX_U32 port_index = data.readInt32();
            if (!isSecure(node) || port_index != 0 /* kPortIndexInput */) {
                ALOGE("b/24310423");
                reply->writeInt32(INVALID_OPERATION);
                return NO_ERROR;
            }

            size_t size = data.readInt64();

            buffer_id buffer;
+2 −0
Original line number Diff line number Diff line
@@ -140,6 +140,8 @@ public:

    virtual void binderDied(const wp<IBinder> &the_late_who);

    virtual bool isSecure(IOMX::node_id node);

    OMX_ERRORTYPE OnEvent(
            node_id node,
            OMX_IN OMX_EVENTTYPE eEvent,
+5 −0
Original line number Diff line number Diff line
@@ -125,6 +125,10 @@ struct OMXNodeInstance {
            const void *data,
            size_t size);

    bool isSecure() const {
        return mIsSecure;
    }

    // handles messages and removes them from the list
    void onMessages(std::list<omx_message> &messages);
    void onMessage(const omx_message &msg);
@@ -142,6 +146,7 @@ private:
    OMX_HANDLETYPE mHandle;
    sp<IOMXObserver> mObserver;
    bool mDying;
    bool mIsSecure;

    // Lock only covers mGraphicBufferSource.  We can't always use mLock
    // because of rare instances where we'd end up locking it recursively.
+5 −0
Original line number Diff line number Diff line
@@ -194,6 +194,11 @@ void OMX::binderDied(const wp<IBinder> &the_late_who) {
    instance->onObserverDied(mMaster);
}

bool OMX::isSecure(node_id node) {
    OMXNodeInstance *instance = findInstance(node);
    return (instance == NULL ? false : instance->isSecure());
}

bool OMX::livesLocally(node_id /* node */, pid_t pid) {
    return pid == getpid();
}
Loading