summaryrefslogtreecommitdiffstats
path: root/drm/mediadrm/plugins/clearkey/CryptoFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drm/mediadrm/plugins/clearkey/CryptoFactory.cpp')
-rw-r--r--drm/mediadrm/plugins/clearkey/CryptoFactory.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/drm/mediadrm/plugins/clearkey/CryptoFactory.cpp b/drm/mediadrm/plugins/clearkey/CryptoFactory.cpp
index ee3189b..eeb64c3 100644
--- a/drm/mediadrm/plugins/clearkey/CryptoFactory.cpp
+++ b/drm/mediadrm/plugins/clearkey/CryptoFactory.cpp
@@ -43,10 +43,18 @@ android::status_t CryptoFactory::createPlugin(
return android::BAD_VALUE;
}
- android::sp<Session> session = SessionLibrary::get()->findSession(
- data, size);
- *plugin = new CryptoPlugin(session);
- return android::OK;
+ android::Vector<uint8_t> sessionId;
+ sessionId.appendArray(reinterpret_cast<const uint8_t*>(data), size);
+
+ CryptoPlugin *clearKeyPlugin = new CryptoPlugin(sessionId);
+ android::status_t result = clearKeyPlugin->getInitStatus();
+ if (result == android::OK) {
+ *plugin = clearKeyPlugin;
+ } else {
+ delete clearKeyPlugin;
+ *plugin = NULL;
+ }
+ return result;
}
} // namespace clearkeydrm