diff options
author | Jeff Tinker <jtinker@google.com> | 2014-10-31 00:55:16 -0700 |
---|---|---|
committer | Jeff Tinker <jtinker@google.com> | 2014-10-31 00:55:16 -0700 |
commit | 3c1285e8f86bd497e14c14fb6df7b42072ef52bd (patch) | |
tree | 82c107d9b3001bf4f9d375b7d655968abe20c2c3 /media | |
parent | 6e8212b2a02685e50d0c093a6f44d9af636261d9 (diff) | |
download | frameworks_av-3c1285e8f86bd497e14c14fb6df7b42072ef52bd.zip frameworks_av-3c1285e8f86bd497e14c14fb6df7b42072ef52bd.tar.gz frameworks_av-3c1285e8f86bd497e14c14fb6df7b42072ef52bd.tar.bz2 |
Add missing secure stop methods
b/18053197
b/18076411
Change-Id: I923dc893d48c70bf17980007b32f0ac5dfd22896
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/IDrm.cpp | 43 | ||||
-rw-r--r-- | media/libmediaplayerservice/Drm.cpp | 28 | ||||
-rw-r--r-- | media/libmediaplayerservice/Drm.h | 2 |
3 files changed, 71 insertions, 2 deletions
diff --git a/media/libmedia/IDrm.cpp b/media/libmedia/IDrm.cpp index 1904839..7e74de9 100644 --- a/media/libmedia/IDrm.cpp +++ b/media/libmedia/IDrm.cpp @@ -54,7 +54,9 @@ enum { SIGN_RSA, VERIFY, SET_LISTENER, - UNPROVISION_DEVICE + UNPROVISION_DEVICE, + GET_SECURE_STOP, + RELEASE_ALL_SECURE_STOPS }; struct BpDrm : public BpInterface<IDrm> { @@ -255,6 +257,17 @@ struct BpDrm : public BpInterface<IDrm> { return reply.readInt32(); } + virtual status_t getSecureStop(Vector<uint8_t> const &ssid, Vector<uint8_t> &secureStop) { + Parcel data, reply; + data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); + + writeVector(data, ssid); + remote()->transact(GET_SECURE_STOP, data, &reply); + + readVector(reply, secureStop); + return reply.readInt32(); + } + virtual status_t releaseSecureStops(Vector<uint8_t> const &ssRelease) { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); @@ -265,6 +278,15 @@ struct BpDrm : public BpInterface<IDrm> { return reply.readInt32(); } + virtual status_t releaseAllSecureStops() { + Parcel data, reply; + data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); + + remote()->transact(RELEASE_ALL_SECURE_STOPS, data, &reply); + + return reply.readInt32(); + } + virtual status_t getPropertyString(String8 const &name, String8 &value) const { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); @@ -655,6 +677,17 @@ status_t BnDrm::onTransact( return OK; } + case GET_SECURE_STOP: + { + CHECK_INTERFACE(IDrm, data, reply); + Vector<uint8_t> ssid, secureStop; + readVector(data, ssid); + status_t result = getSecureStop(ssid, secureStop); + writeVector(reply, secureStop); + reply->writeInt32(result); + return OK; + } + case RELEASE_SECURE_STOPS: { CHECK_INTERFACE(IDrm, data, reply); @@ -664,6 +697,13 @@ status_t BnDrm::onTransact( return OK; } + case RELEASE_ALL_SECURE_STOPS: + { + CHECK_INTERFACE(IDrm, data, reply); + reply->writeInt32(releaseAllSecureStops()); + return OK; + } + case GET_PROPERTY_STRING: { CHECK_INTERFACE(IDrm, data, reply); @@ -809,4 +849,3 @@ status_t BnDrm::onTransact( } } // namespace android - diff --git a/media/libmediaplayerservice/Drm.cpp b/media/libmediaplayerservice/Drm.cpp index d222316..2a8b2c6 100644 --- a/media/libmediaplayerservice/Drm.cpp +++ b/media/libmediaplayerservice/Drm.cpp @@ -449,6 +449,20 @@ status_t Drm::getSecureStops(List<Vector<uint8_t> > &secureStops) { return mPlugin->getSecureStops(secureStops); } +status_t Drm::getSecureStop(Vector<uint8_t> const &ssid, Vector<uint8_t> &secureStop) { + Mutex::Autolock autoLock(mLock); + + if (mInitCheck != OK) { + return mInitCheck; + } + + if (mPlugin == NULL) { + return -EINVAL; + } + + return mPlugin->getSecureStop(ssid, secureStop); +} + status_t Drm::releaseSecureStops(Vector<uint8_t> const &ssRelease) { Mutex::Autolock autoLock(mLock); @@ -463,6 +477,20 @@ status_t Drm::releaseSecureStops(Vector<uint8_t> const &ssRelease) { return mPlugin->releaseSecureStops(ssRelease); } +status_t Drm::releaseAllSecureStops() { + Mutex::Autolock autoLock(mLock); + + if (mInitCheck != OK) { + return mInitCheck; + } + + if (mPlugin == NULL) { + return -EINVAL; + } + + return mPlugin->releaseAllSecureStops(); +} + status_t Drm::getPropertyString(String8 const &name, String8 &value ) const { Mutex::Autolock autoLock(mLock); diff --git a/media/libmediaplayerservice/Drm.h b/media/libmediaplayerservice/Drm.h index 9e23e2e..0e1eb2c 100644 --- a/media/libmediaplayerservice/Drm.h +++ b/media/libmediaplayerservice/Drm.h @@ -78,8 +78,10 @@ struct Drm : public BnDrm, virtual status_t unprovisionDevice(); virtual status_t getSecureStops(List<Vector<uint8_t> > &secureStops); + virtual status_t getSecureStop(Vector<uint8_t> const &ssid, Vector<uint8_t> &secureStop); virtual status_t releaseSecureStops(Vector<uint8_t> const &ssRelease); + virtual status_t releaseAllSecureStops(); virtual status_t getPropertyString(String8 const &name, String8 &value ) const; virtual status_t getPropertyByteArray(String8 const &name, |