summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-01-29 12:50:09 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-01-29 12:50:09 +0000
commit38885b63fc41e664681b6fd12159c7ce04e3addc (patch)
tree59d8a105b130b57df521d4f171f7043a14c3f42a
parentef099b71838e15758c8e859af21748a123bb4a99 (diff)
parent38638b2fcc4aba428889d521d83762d716e32332 (diff)
downloadframeworks_base-38885b63fc41e664681b6fd12159c7ce04e3addc.zip
frameworks_base-38885b63fc41e664681b6fd12159c7ce04e3addc.tar.gz
frameworks_base-38885b63fc41e664681b6fd12159c7ce04e3addc.tar.bz2
am 38638b2f: am eaae9906: am 672f3ee3: am 95ba1eb6: am dd6de16a: Merge "AArch64: Use long for pointers in DRM classes"
* commit '38638b2fcc4aba428889d521d83762d716e32332': AArch64: Use long for pointers in DRM classes
-rw-r--r--drm/java/android/drm/DrmManagerClient.java2
-rw-r--r--drm/jni/android_drm_DrmManagerClient.cpp31
2 files changed, 18 insertions, 15 deletions
diff --git a/drm/java/android/drm/DrmManagerClient.java b/drm/java/android/drm/DrmManagerClient.java
index 10cdab0..c05ea2e 100644
--- a/drm/java/android/drm/DrmManagerClient.java
+++ b/drm/java/android/drm/DrmManagerClient.java
@@ -116,7 +116,7 @@ public class DrmManagerClient {
private static final int ACTION_PROCESS_DRM_INFO = 1002;
private int mUniqueId;
- private int mNativeContext;
+ private long mNativeContext;
private volatile boolean mReleased;
private Context mContext;
private InfoHandler mInfoHandler;
diff --git a/drm/jni/android_drm_DrmManagerClient.cpp b/drm/jni/android_drm_DrmManagerClient.cpp
index baddf62..de8531b 100644
--- a/drm/jni/android_drm_DrmManagerClient.cpp
+++ b/drm/jni/android_drm_DrmManagerClient.cpp
@@ -182,25 +182,27 @@ static sp<DrmManagerClientImpl> setDrmManagerClientImpl(
JNIEnv* env, jobject thiz, const sp<DrmManagerClientImpl>& client) {
Mutex::Autolock l(sLock);
jclass clazz = env->FindClass("android/drm/DrmManagerClient");
- jfieldID fieldId = env->GetFieldID(clazz, "mNativeContext", "I");
+ jfieldID fieldId = env->GetFieldID(clazz, "mNativeContext", "J");
- sp<DrmManagerClientImpl> old = (DrmManagerClientImpl*)env->GetIntField(thiz, fieldId);
+ jlong oldHandle = env->GetLongField(thiz, fieldId);
+ sp<DrmManagerClientImpl> old = reinterpret_cast<DrmManagerClientImpl*>(oldHandle);
if (client.get()) {
client->incStrong(thiz);
}
if (old != 0) {
old->decStrong(thiz);
}
- env->SetIntField(thiz, fieldId, (int)client.get());
+ env->SetLongField(thiz, fieldId, reinterpret_cast<jlong>(client.get()));
return old;
}
static sp<DrmManagerClientImpl> getDrmManagerClientImpl(JNIEnv* env, jobject thiz) {
Mutex::Autolock l(sLock);
jclass clazz = env->FindClass("android/drm/DrmManagerClient");
- jfieldID fieldId = env->GetFieldID(clazz, "mNativeContext", "I");
+ jfieldID fieldId = env->GetFieldID(clazz, "mNativeContext", "J");
- DrmManagerClientImpl* const client = (DrmManagerClientImpl*)env->GetIntField(thiz, fieldId);
+ jlong clientHandle = env->GetLongField(thiz, fieldId);
+ DrmManagerClientImpl* const client = reinterpret_cast<DrmManagerClientImpl*>(clientHandle);
return sp<DrmManagerClientImpl>(client);
}
@@ -214,7 +216,7 @@ static jint android_drm_DrmManagerClient_initialize(
setDrmManagerClientImpl(env, thiz, drmManager);
ALOGV("initialize - Exit");
- return uniqueId;
+ return static_cast<jint>(uniqueId);
}
static void android_drm_DrmManagerClient_setListeners(
@@ -406,7 +408,7 @@ static jint android_drm_DrmManagerClient_saveRights(
delete[] mData; mData = NULL;
ALOGV("saveRights - Exit");
- return result;
+ return static_cast<jint>(result);
}
static jboolean android_drm_DrmManagerClient_canHandle(
@@ -583,7 +585,7 @@ static jint android_drm_DrmManagerClient_getDrmObjectType(
->getDrmObjectType(uniqueId, Utility::getStringValue(env, path),
Utility::getStringValue(env, mimeType));
ALOGV("getDrmObjectType Exit");
- return drmObjectType;
+ return static_cast<jint>(drmObjectType);
}
static jstring android_drm_DrmManagerClient_getOriginalMimeType(
@@ -609,20 +611,21 @@ static jint android_drm_DrmManagerClient_checkRightsStatus(
= getDrmManagerClientImpl(env, thiz)
->checkRightsStatus(uniqueId, Utility::getStringValue(env, path), action);
ALOGV("checkRightsStatus Exit");
- return rightsStatus;
+ return static_cast<jint>(rightsStatus);
}
static jint android_drm_DrmManagerClient_removeRights(
JNIEnv* env, jobject thiz, jint uniqueId, jstring path) {
ALOGV("removeRights");
- return getDrmManagerClientImpl(env, thiz)
- ->removeRights(uniqueId, Utility::getStringValue(env, path));
+ return static_cast<jint>(getDrmManagerClientImpl(env, thiz)
+ ->removeRights(uniqueId, Utility::getStringValue(env, path)));
}
static jint android_drm_DrmManagerClient_removeAllRights(
JNIEnv* env, jobject thiz, jint uniqueId) {
ALOGV("removeAllRights");
- return getDrmManagerClientImpl(env, thiz)->removeAllRights(uniqueId);
+ return static_cast<jint>(getDrmManagerClientImpl(env, thiz)
+ ->removeAllRights(uniqueId));
}
static jint android_drm_DrmManagerClient_openConvertSession(
@@ -632,7 +635,7 @@ static jint android_drm_DrmManagerClient_openConvertSession(
= getDrmManagerClientImpl(env, thiz)
->openConvertSession(uniqueId, Utility::getStringValue(env, mimeType));
ALOGV("openConvertSession Exit");
- return convertId;
+ return static_cast<jint>(convertId);
}
static jobject GetConvertedStatus(JNIEnv* env, DrmConvertedStatus* pDrmConvertedStatus) {
@@ -686,7 +689,7 @@ static jobject android_drm_DrmManagerClient_convertData(
}
static jobject android_drm_DrmManagerClient_closeConvertSession(
- JNIEnv* env, jobject thiz, int uniqueId, jint convertId) {
+ JNIEnv* env, jobject thiz, jint uniqueId, jint convertId) {
ALOGV("closeConvertSession Enter");