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/jni | |
parent | ae5df05f2246515a652f0c935c6deb85a0bdee01 (diff) | |
download | frameworks_base-a17d454fd0d20d14cf1fbc09f0f296cb6cbb870b.zip frameworks_base-a17d454fd0d20d14cf1fbc09f0f296cb6cbb870b.tar.gz frameworks_base-a17d454fd0d20d14cf1fbc09f0f296cb6cbb870b.tar.bz2 |
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/jni')
-rw-r--r-- | drm/jni/android_drm_DrmManagerClient.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drm/jni/android_drm_DrmManagerClient.cpp b/drm/jni/android_drm_DrmManagerClient.cpp index e131839..80a8447 100644 --- a/drm/jni/android_drm_DrmManagerClient.cpp +++ b/drm/jni/android_drm_DrmManagerClient.cpp @@ -224,11 +224,12 @@ static sp<DrmManagerClientImpl> getDrmManagerClientImpl(JNIEnv* env, jobject thi return sp<DrmManagerClientImpl>(client); } -static void android_drm_DrmManagerClient_initialize( - JNIEnv* env, jobject thiz, jint uniqueId, jobject weak_thiz) { +static jint android_drm_DrmManagerClient_initialize( + JNIEnv* env, jobject thiz, jobject weak_thiz) { LOGV("initialize - Enter"); - sp<DrmManagerClientImpl> drmManager = DrmManagerClientImpl::create(&uniqueId); + int uniqueId = 0; + sp<DrmManagerClientImpl> drmManager = DrmManagerClientImpl::create(&uniqueId, false); drmManager->addClient(uniqueId); // Set the listener to DrmManager @@ -237,6 +238,8 @@ static void android_drm_DrmManagerClient_initialize( setDrmManagerClientImpl(env, thiz, drmManager); LOGV("initialize - Exit"); + + return uniqueId; } static void android_drm_DrmManagerClient_finalize(JNIEnv* env, jobject thiz, jint uniqueId) { @@ -711,7 +714,7 @@ static jobject android_drm_DrmManagerClient_closeConvertSession( static JNINativeMethod nativeMethods[] = { - {"_initialize", "(ILjava/lang/Object;)V", + {"_initialize", "(Ljava/lang/Object;)I", (void*)android_drm_DrmManagerClient_initialize}, {"_finalize", "(I)V", |