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

Commit fd6f6143 authored by Jooyung Han's avatar Jooyung Han Committed by Automerger Merge Worker
Browse files

use vector<uint8_t> for byte[] in AIDL am: 3d564ffd

Change-Id: Ic0ef32c677a9de3f2e9493b25b2baa04a91e049c
parents e19e43b3 3d564ffd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ static std::vector<MediaResourceParcel> toResourceVec(
    std::vector<MediaResourceParcel> resources;
    MediaResourceParcel resource{
            Type::kDrmSession, SubType::kUnspecifiedSubType,
            toStdVec<int8_t>(sessionId), value};
            toStdVec<>(sessionId), value};
    resources.push_back(resource);
    return resources;
}
+3 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ MediaResource::MediaResource(Type type, SubType subType, int64_t value) {
    this->value = value;
}

MediaResource::MediaResource(Type type, const std::vector<int8_t> &id, int64_t value) {
MediaResource::MediaResource(Type type, const std::vector<uint8_t> &id, int64_t value) {
    this->type = type;
    this->subType = SubType::kUnspecifiedSubType;
    this->id = id;
@@ -66,11 +66,11 @@ MediaResource MediaResource::VideoBatteryResource() {
}

//static
MediaResource MediaResource::DrmSessionResource(const std::vector<int8_t> &id, int64_t value) {
MediaResource MediaResource::DrmSessionResource(const std::vector<uint8_t> &id, int64_t value) {
    return MediaResource(Type::kDrmSession, id, value);
}

static String8 bytesToHexString(const std::vector<int8_t> &bytes) {
static String8 bytesToHexString(const std::vector<uint8_t> &bytes) {
    String8 str;
    for (auto &b : bytes) {
        str.appendFormat("%02x", b);
+2 −2
Original line number Diff line number Diff line
@@ -35,13 +35,13 @@ public:
    MediaResource() = delete;
    MediaResource(Type type, int64_t value);
    MediaResource(Type type, SubType subType, int64_t value);
    MediaResource(Type type, const std::vector<int8_t> &id, int64_t value);
    MediaResource(Type type, const std::vector<uint8_t> &id, int64_t value);

    static MediaResource CodecResource(bool secure, bool video);
    static MediaResource GraphicMemoryResource(int64_t value);
    static MediaResource CpuBoostResource();
    static MediaResource VideoBatteryResource();
    static MediaResource DrmSessionResource(const std::vector<int8_t> &id, int64_t value);
    static MediaResource DrmSessionResource(const std::vector<uint8_t> &id, int64_t value);
};

inline static const char *asString(MediaResource::Type i, const char *def = "??") {
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ using ::aidl::android::media::MediaResourceParcel;
using ::aidl::android::media::MediaResourcePolicyParcel;

typedef std::map<std::tuple<
        MediaResource::Type, MediaResource::SubType, std::vector<int8_t>>,
        MediaResource::Type, MediaResource::SubType, std::vector<uint8_t>>,
        MediaResourceParcel> ResourceList;

struct ResourceInfo {