summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorAshok Bhat <ashok.bhat@arm.com>2014-01-17 16:02:38 +0000
committerNarayan Kamath <narayan@google.com>2014-01-31 14:14:29 +0000
commit896043d67d3ac75760bd99db8a1561e31ebee1e1 (patch)
tree8f2ca459558ed89495990bf51d967b4f05363b3e /native
parent1cadc07dd1e3711fb1e57548038e3026682c5ef8 (diff)
downloadframeworks_base-896043d67d3ac75760bd99db8a1561e31ebee1e1.zip
frameworks_base-896043d67d3ac75760bd99db8a1561e31ebee1e1.tar.gz
frameworks_base-896043d67d3ac75760bd99db8a1561e31ebee1e1.tar.bz2
AArch64: Make AssetManager and related classes 64-bit compatible
Following changes have been done: [x] Long is used to store native pointers as pointers can be 64-bit. [x] AssetManager openAsset native function returned -1 if file name was empty and java function considered any non-zero value as success. This has been fixed by native function throwing Illegal Argument Exception as well. [x] AssetManager incRefsLocked and decRefsLocked now accept long as input to support 64-bit native references. [x] AssetManager incRefsLocked method incorrecly used 'this.hashCode()' instead of the passed parameter id. This has been fixed. [x] Some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Change-Id: I095b9f900d49e51f43ad6afc47cbc23116a6a64a Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Diffstat (limited to 'native')
-rw-r--r--native/android/asset_manager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/native/android/asset_manager.cpp b/native/android/asset_manager.cpp
index 01db1d3..dee3f8c 100644
--- a/native/android/asset_manager.cpp
+++ b/native/android/asset_manager.cpp
@@ -76,12 +76,12 @@ AAssetManager* AAssetManager_fromJava(JNIEnv* env, jobject assetManager)
if (gJNIConfigured == false) {
jclass amClass = env->FindClass("android/content/res/AssetManager");
- gAssetManagerOffsets.mObject = env->GetFieldID(amClass, "mObject", "I");
+ gAssetManagerOffsets.mObject = env->GetFieldID(amClass, "mObject", "J");
gJNIConfigured = true;
}
}
- return (AAssetManager*) env->GetIntField(assetManager, gAssetManagerOffsets.mObject);
+ return (AAssetManager*) env->GetLongField(assetManager, gAssetManagerOffsets.mObject);
}
AAsset* AAssetManager_open(AAssetManager* amgr, const char* filename, int mode)