summaryrefslogtreecommitdiffstats
path: root/drm/libmediadrm/IDrm.cpp
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2019-01-25 22:56:56 -0800
committerJeff Tinker <jtinker@google.com>2019-01-30 07:09:41 +0000
commitdb3fa5f9ff069697b70f2a702177f1db83a6d5b7 (patch)
tree5ac815ae62bcb6e6fea949385afe2c53508db0f7 /drm/libmediadrm/IDrm.cpp
parent8ce16d8609ee14dfbfafeecfb3cb5d1ebb94f1f2 (diff)
downloadframeworks_av-db3fa5f9ff069697b70f2a702177f1db83a6d5b7.tar.gz
frameworks_av-db3fa5f9ff069697b70f2a702177f1db83a6d5b7.tar.bz2
frameworks_av-db3fa5f9ff069697b70f2a702177f1db83a6d5b7.zip
Throw exception on mismatched system vs vendor
When the system partition is a later version than vendor, new MediaDrm APIs will not have HAL implementations. In this case throw java.lang.UnsupportedOperationException. bug:110701831 bug:123375769 test: cts media test cases, gts media tests Change-Id: Ib631bf4d4d245d857e61bd3fe0e5808e430a034d
Diffstat (limited to 'drm/libmediadrm/IDrm.cpp')
-rw-r--r--drm/libmediadrm/IDrm.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/drm/libmediadrm/IDrm.cpp b/drm/libmediadrm/IDrm.cpp
index 0f343151c8..51274d16c1 100644
--- a/drm/libmediadrm/IDrm.cpp
+++ b/drm/libmediadrm/IDrm.cpp
@@ -83,8 +83,8 @@ struct BpDrm : public BpInterface<IDrm> {
return reply.readInt32();
}
- virtual bool isCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType,
- DrmPlugin::SecurityLevel level) {
+ virtual status_t isCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType,
+ DrmPlugin::SecurityLevel level, bool *isSupported) {
Parcel data, reply;
data.writeInterfaceToken(IDrm::getInterfaceDescriptor());
data.write(uuid, 16);
@@ -94,10 +94,11 @@ struct BpDrm : public BpInterface<IDrm> {
status_t status = remote()->transact(IS_CRYPTO_SUPPORTED, data, &reply);
if (status != OK) {
ALOGE("isCryptoSchemeSupported: binder call failed: %d", status);
- return false;
+ return status;
}
+ *isSupported = static_cast<bool>(reply.readInt32());
- return reply.readInt32() != 0;
+ return reply.readInt32();
}
virtual status_t createPlugin(const uint8_t uuid[16],
@@ -773,7 +774,10 @@ status_t BnDrm::onTransact(
String8 mimeType = data.readString8();
DrmPlugin::SecurityLevel level =
static_cast<DrmPlugin::SecurityLevel>(data.readInt32());
- reply->writeInt32(isCryptoSchemeSupported(uuid, mimeType, level));
+ bool isSupported = false;
+ status_t result = isCryptoSchemeSupported(uuid, mimeType, level, &isSupported);
+ reply->writeInt32(isSupported);
+ reply->writeInt32(result);
return OK;
}