diff options
author | Gloria Wang <gwang@google.com> | 2011-07-21 15:10:22 -0700 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-07-25 16:09:58 -0700 |
commit | a17d454fd0d20d14cf1fbc09f0f296cb6cbb870b (patch) | |
tree | e7ecaa5d516248aee80cf5887f50c5b75e91a0f4 /drm/libdrmframework/DrmManagerClientImpl.cpp | |
parent | ae5df05f2246515a652f0c935c6deb85a0bdee01 (diff) |
Fix for bug 4371230.
- Generate unique ID for each DrmManagerClient in native side
- Fix the bug where multiple clients could use the same ID
- Return the correct unique ID back to Java
- Add a flag in the unique ID to separate native client and Java client
Change-Id: Ia4574b6b0a526f2335a65380975dc62f9a6e7f9b
Diffstat (limited to 'drm/libdrmframework/DrmManagerClientImpl.cpp')
-rw-r--r-- | drm/libdrmframework/DrmManagerClientImpl.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp index a36bd4ae4023..67f58ca8fe20 100644 --- a/drm/libdrmframework/DrmManagerClientImpl.cpp +++ b/drm/libdrmframework/DrmManagerClientImpl.cpp @@ -33,13 +33,10 @@ sp<IDrmManagerService> DrmManagerClientImpl::sDrmManagerService; sp<DrmManagerClientImpl::DeathNotifier> DrmManagerClientImpl::sDeathNotifier; const String8 DrmManagerClientImpl::EMPTY_STRING(""); -DrmManagerClientImpl* DrmManagerClientImpl::create(int* pUniqueId) { - if (0 == *pUniqueId) { - int uniqueId = getDrmManagerService()->addUniqueId(*pUniqueId); - *pUniqueId = uniqueId; - } else { - getDrmManagerService()->addUniqueId(*pUniqueId); - } +DrmManagerClientImpl* DrmManagerClientImpl::create( + int* pUniqueId, bool isNative) { + *pUniqueId = getDrmManagerService()->addUniqueId(isNative); + return new DrmManagerClientImpl(); } |