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

Commit 2b87d141 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Implement clearkey hidl `lshal debug` hook" into rvc-dev am: 2ddee51c

Change-Id: I533e43f33b1787c78a7af1a9517a91dab856ffef
parents 164ceef8 2ddee51c
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -91,6 +91,19 @@ Return<void> DrmFactory::getSupportedCryptoSchemes(
    return Void();
}

Return<void> DrmFactory::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /*args*/) {
    if (fd.getNativeHandle() == nullptr || fd->numFds < 1) {
        ALOGE("%s: missing fd for writing", __FUNCTION__);
        return Void();
    }

    FILE* out = fdopen(dup(fd->data[0]), "w");
    uint32_t currentSessions = SessionLibrary::get()->numOpenSessions();
    fprintf(out, "current open sessions: %u\n", currentSessions);
    fclose(out);
    return Void();
}

} // namespace clearkey
} // namespace V1_3
} // namespace drm
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ namespace clearkey {

using ::android::hardware::drm::V1_1::SecurityLevel;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_handle;
using ::android::hardware::hidl_string;
using ::android::hardware::Return;

@@ -55,6 +56,8 @@ struct DrmFactory : public IDrmFactory {
    Return<void> getSupportedCryptoSchemes(
            getSupportedCryptoSchemes_cb _hidl_cb) override;

    Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& args);

private:
    CLEARKEY_DISALLOW_COPY_AND_ASSIGN(DrmFactory);
};