diff options
author | Jeff Tinker <jtinker@google.com> | 2013-04-08 15:23:17 -0700 |
---|---|---|
committer | Jeff Tinker <jtinker@google.com> | 2013-04-16 23:01:17 -0700 |
commit | 423e33ce6569cb14ecf772e9670208517f7b30c4 (patch) | |
tree | aa34178c7ba71151b4cb1a462da0679afcd37323 | |
parent | f4c873a64db2d5d2d74ca596e7482627dd6b4238 (diff) | |
download | frameworks_av-423e33ce6569cb14ecf772e9670208517f7b30c4.zip frameworks_av-423e33ce6569cb14ecf772e9670208517f7b30c4.tar.gz frameworks_av-423e33ce6569cb14ecf772e9670208517f7b30c4.tar.bz2 |
Added CTS test for secure stop APIs
bug: 8604418
Change-Id: I173fa1ec904ba11dc4cff0343462b3f4bac0d365
-rw-r--r-- | drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp | 35 | ||||
-rw-r--r-- | media/libmedia/IDrm.cpp | 1 |
2 files changed, 28 insertions, 8 deletions
diff --git a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp index 00f6de3..06fc29d 100644 --- a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp +++ b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp @@ -291,16 +291,30 @@ namespace android { { Mutex::Autolock lock(mLock); ALOGD("MockDrmPlugin::getSecureStops()"); - const uint8_t ss1[] = {0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89}; - const uint8_t ss2[] = {0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99}; - Vector<uint8_t> vec; - vec.appendArray(ss1, sizeof(ss1)); - secureStops.push_back(vec); + // Properties used in mock test, set by cts test app returned from mock plugin + // byte[] mock-secure-stop1 -> first secure stop in list + // byte[] mock-secure-stop2 -> second secure stop in list + + Vector<uint8_t> ss1, ss2; + ssize_t index = mByteArrayProperties.indexOfKey(String8("mock-secure-stop1")); + if (index < 0) { + ALOGD("Missing 'mock-secure-stop1' parameter for mock"); + return BAD_VALUE; + } else { + ss1 = mByteArrayProperties.valueAt(index); + } + + index = mByteArrayProperties.indexOfKey(String8("mock-secure-stop2")); + if (index < 0) { + ALOGD("Missing 'mock-secure-stop2' parameter for mock"); + return BAD_VALUE; + } else { + ss2 = mByteArrayProperties.valueAt(index); + } - vec.clear(); - vec.appendArray(ss2, sizeof(ss2)); - secureStops.push_back(vec); + secureStops.push_back(ss1); + secureStops.push_back(ss2); return OK; } @@ -309,6 +323,11 @@ namespace android { Mutex::Autolock lock(mLock); ALOGD("MockDrmPlugin::releaseSecureStops(%s)", vectorToString(ssRelease).string()); + + // Properties used in mock test, set by mock plugin and verifed cts test app + // byte[] secure-stop-release -> mock-ssrelease + mByteArrayProperties.add(String8("mock-ssrelease"), ssRelease); + return OK; } diff --git a/media/libmedia/IDrm.cpp b/media/libmedia/IDrm.cpp index 1578846..902aeb2 100644 --- a/media/libmedia/IDrm.cpp +++ b/media/libmedia/IDrm.cpp @@ -590,6 +590,7 @@ status_t BnDrm::onTransact( size_t size = iter->size(); reply->writeInt32(size); reply->write(iter->array(), iter->size()); + iter++; } reply->writeInt32(result); return OK; |