diff options
author | Jeff Tinker <jtinker@google.com> | 2014-11-06 02:33:37 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-06 02:33:37 +0000 |
commit | 19a3f69d9d5398db62ee7b15f2c13052d7ee9f07 (patch) | |
tree | cf8ab0afd5e431df089fb7a45499fd1981ba4fc4 /media | |
parent | 74adca9ad30b7f8a70d40c5237bade0d16c4ea58 (diff) | |
parent | 3c1285e8f86bd497e14c14fb6df7b42072ef52bd (diff) | |
download | frameworks_av-19a3f69d9d5398db62ee7b15f2c13052d7ee9f07.zip frameworks_av-19a3f69d9d5398db62ee7b15f2c13052d7ee9f07.tar.gz frameworks_av-19a3f69d9d5398db62ee7b15f2c13052d7ee9f07.tar.bz2 |
Merge "Add missing secure stop methods" into lmp-mr1-dev
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, |