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

Commit 1d043f13 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7329867 from 8f470e26 to sc-release

Change-Id: Ieda13e6954e267cade905cec46803314a2917382
parents f8b68d3a 8f470e26
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -326,6 +326,9 @@ char logPriorityToChar(::V1_4::LogPriority priority) {

std::string GetExceptionMessage(status_t err, const char *msg,
                                const Vector<::V1_4::LogMessage> &logs) {
    std::string ruler("==============================");
    std::string header("Beginning of DRM Plugin Log");
    std::string footer("End of DRM Plugin Log");
    String8 msg8;
    if (msg) {
        msg8 += msg;
@@ -333,6 +336,7 @@ std::string GetExceptionMessage(status_t err, const char *msg,
    }
    auto errStr = StrCryptoError(err);
    msg8 += errStr.c_str();
    msg8 += String8::format("\n%s %s %s", ruler.c_str(), header.c_str(), ruler.c_str());

    for (auto log : logs) {
        time_t seconds = log.timeMs / 1000;
@@ -347,6 +351,7 @@ std::string GetExceptionMessage(status_t err, const char *msg,
        msg8 += String8::format("\n  %s.%03d %c %s", timeStr.c_str(), ms, p, log.message.c_str());
    }

    msg8 += String8::format("\n%s %s %s", ruler.c_str(), footer.c_str(), ruler.c_str());
    return msg8.c_str();
}

+2 −1
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ SharedMemoryParcelable SharedMemoryParcelable::dup() const {
}

void SharedMemoryParcelable::setup(const unique_fd& fd, int32_t sizeInBytes) {
    mFd.reset(::dup(fd.get())); // store a duplicate fd
    constexpr int minFd = 3; // skip over stdout, stdin and stderr
    mFd.reset(fcntl(fd.get(), F_DUPFD_CLOEXEC, minFd)); // store a duplicate FD
    ALOGV("setup(fd = %d -> %d, size = %d) this = %p\n", fd.get(), mFd.get(), sizeInBytes, this);
    mSizeInBytes = sizeInBytes;
}
+19 −1
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@ enum {
    SETMEDIACAS,
    NAME,
    GETMETRICS,
    SETENTRYPOINT
    SETENTRYPOINT,
    SETLOGSESSIONID
};

class BpMediaExtractor : public BpInterface<IMediaExtractor> {
@@ -150,6 +151,13 @@ public:
        data.writeInt32(static_cast<int32_t>(entryPoint));
        return remote()->transact(SETENTRYPOINT, data, &reply);
    }

    virtual status_t setLogSessionId(const String8& logSessionId) {
        Parcel data, reply;
        data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor());
        data.writeString8(logSessionId);
        return remote()->transact(SETLOGSESSIONID, data, &reply);
    }
};

IMPLEMENT_META_INTERFACE(MediaExtractor, "android.media.IMediaExtractor");
@@ -250,6 +258,16 @@ status_t BnMediaExtractor::onTransact(
            }
            return err;
        }
        case SETLOGSESSIONID: {
            ALOGV("setLogSessionId");
            CHECK_INTERFACE(IMediaExtractor, data, reply);
            String8 logSessionId;
            status_t status = data.readString8(&logSessionId);
            if (status == OK) {
              setLogSessionId(logSessionId);
            }
            return status;
        }
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
+2 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ public:
    };

    virtual status_t setEntryPoint(EntryPoint entryPoint) = 0;

    virtual status_t setLogSessionId(const String8& logSessionId) = 0;
};


+11 −0
Original line number Diff line number Diff line
@@ -885,4 +885,15 @@ status_t NuMediaExtractor::getAudioPresentations(
    return ERROR_UNSUPPORTED;
}

status_t NuMediaExtractor::setLogSessionId(const String8& logSessionId) {
    if (mImpl == nullptr) {
        return ERROR_UNSUPPORTED;
    }
    status_t status = mImpl->setLogSessionId(logSessionId);
    if (status != OK) {
        ALOGW("Failed to set log session id: %d.", status);
    }
    return status;
}

}  // namespace android
Loading