diff options
| author | 2010-11-02 14:59:51 -0700 | |
|---|---|---|
| committer | 2010-11-02 14:59:51 -0700 | |
| commit | a8d7b7477d99dd2671e6232e157da9954bf4699f (patch) | |
| tree | 1d7dc40888d00b25724c1b82e63ea26521737fab /drm/drmserver/DrmManagerService.cpp | |
| parent | 6fb9316f6bd72b406bbfc61bd210281744eea9c1 (diff) | |
| parent | ef8a810b3b11d177a64111125eaa44bb76624414 (diff) | |
am ef8a810b: Merge "Update of DRM framework"
* commit 'ef8a810b3b11d177a64111125eaa44bb76624414':
Update of DRM framework
Diffstat (limited to 'drm/drmserver/DrmManagerService.cpp')
| -rw-r--r-- | drm/drmserver/DrmManagerService.cpp | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/drm/drmserver/DrmManagerService.cpp b/drm/drmserver/DrmManagerService.cpp index 843dddb8aa18..8cf510d19622 100644 --- a/drm/drmserver/DrmManagerService.cpp +++ b/drm/drmserver/DrmManagerService.cpp @@ -27,36 +27,21 @@ using namespace android; -#define SUCCESS 0 -#define DRM_DIRECTORY_PERMISSION 0700 -#define DRM_PLUGINS_ROOT "/data/drm/plugins" -#define DRM_PLUGINS_NATIVE "/data/drm/plugins/native" -#define DRM_PLUGINS_NATIVE_DATABASES "/data/drm/plugins/native/databases" - void DrmManagerService::instantiate() { LOGV("instantiate"); - - int res = mkdir(DRM_PLUGINS_ROOT, DRM_DIRECTORY_PERMISSION); - if (SUCCESS == res || EEXIST == errno) { - res = mkdir(DRM_PLUGINS_NATIVE, DRM_DIRECTORY_PERMISSION); - if (SUCCESS == res || EEXIST == errno) { - res = mkdir(DRM_PLUGINS_NATIVE_DATABASES, DRM_DIRECTORY_PERMISSION); - if (SUCCESS == res || EEXIST == errno) { - defaultServiceManager() - ->addService(String16("drm.drmManager"), new DrmManagerService()); - } - } - } + defaultServiceManager()->addService(String16("drm.drmManager"), new DrmManagerService()); } -DrmManagerService::DrmManagerService() { +DrmManagerService::DrmManagerService() : + mDrmManager(NULL) { LOGV("created"); - mDrmManager = NULL; mDrmManager = new DrmManager(); + mDrmManager->loadPlugIns(); } DrmManagerService::~DrmManagerService() { LOGV("Destroyed"); + mDrmManager->unloadPlugIns(); delete mDrmManager; mDrmManager = NULL; } @@ -68,14 +53,12 @@ void DrmManagerService::removeUniqueId(int uniqueId) { mDrmManager->removeUniqueId(uniqueId); } -status_t DrmManagerService::loadPlugIns(int uniqueId) { - LOGV("Entering load plugins"); - return mDrmManager->loadPlugIns(uniqueId); +void DrmManagerService::addClient(int uniqueId) { + mDrmManager->addClient(uniqueId); } -status_t DrmManagerService::loadPlugIns(int uniqueId, const String8& plugInDirPath) { - LOGV("Entering load plugins from path"); - return mDrmManager->loadPlugIns(uniqueId, plugInDirPath); +void DrmManagerService::removeClient(int uniqueId) { + mDrmManager->removeClient(uniqueId); } status_t DrmManagerService::setDrmServiceListener( @@ -85,11 +68,6 @@ status_t DrmManagerService::setDrmServiceListener( return DRM_NO_ERROR; } -status_t DrmManagerService::unloadPlugIns(int uniqueId) { - LOGV("Entering unload plugins"); - return mDrmManager->unloadPlugIns(uniqueId); -} - status_t DrmManagerService::installDrmEngine(int uniqueId, const String8& drmEngineFile) { LOGV("Entering installDrmEngine"); return mDrmManager->installDrmEngine(uniqueId, drmEngineFile); @@ -197,6 +175,12 @@ DecryptHandle* DrmManagerService::openDecryptSession( return mDrmManager->openDecryptSession(uniqueId, fd, offset, length); } +DecryptHandle* DrmManagerService::openDecryptSession( + int uniqueId, const char* uri) { + LOGV("Entering DrmManagerService::openDecryptSession with uri"); + return mDrmManager->openDecryptSession(uniqueId, uri); +} + status_t DrmManagerService::closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) { LOGV("Entering closeDecryptSession"); return mDrmManager->closeDecryptSession(uniqueId, decryptHandle); |