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

Commit c7822ef9 authored by Praveen Chavan's avatar Praveen Chavan Committed by Jeff Tinker
Browse files

Fix AMediaDrm_setPropertyByteArray

Also extend clearkey plugin to allow testing
of this change.

Author: Lubin Yin <lubiny@codeaurora.org>

Change-Id: Ie9b9fcd8920a6c843845700e7bba01ffc20a9507
parent 5e0659c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -346,6 +346,9 @@ Return<Status> DrmPlugin::setPropertyByteArray(
   if (name == kDeviceIdKey) {
   if (name == kDeviceIdKey) {
      ALOGD("Cannot set immutable property: %s", name.c_str());
      ALOGD("Cannot set immutable property: %s", name.c_str());
      return Status::BAD_VALUE;
      return Status::BAD_VALUE;
   } else if (name == kClientIdKey) {
       mByteArrayProperties[kClientIdKey] = toVector(value);
       return Status::OK;
   }
   }


   // Setting of undefined properties is not supported
   // Setting of undefined properties is not supported
+4 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,10 @@ static const std::string kDeviceIdKey("deviceId");
static const uint8_t kTestDeviceIdData[] =
static const uint8_t kTestDeviceIdData[] =
        {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
        {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
         0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
         0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};

// settable byte array property
static const std::string kClientIdKey("clientId");

// TODO stub out metrics for nw
// TODO stub out metrics for nw
static const std::string kMetricsKey("metrics");
static const std::string kMetricsKey("metrics");
static const uint8_t kMetricsData[] = { 0 };
static const uint8_t kMetricsData[] = { 0 };
+1 −1
Original line number Original line Diff line number Diff line
@@ -698,7 +698,7 @@ media_status_t AMediaDrm_setPropertyByteArray(AMediaDrm *mObj,
    Vector<uint8_t> byteArray;
    Vector<uint8_t> byteArray;
    byteArray.appendArray(value, valueSize);
    byteArray.appendArray(value, valueSize);


    return translateStatus(mObj->mDrm->getPropertyByteArray(String8(propertyName),
    return translateStatus(mObj->mDrm->setPropertyByteArray(String8(propertyName),
                    byteArray));
                    byteArray));
}
}