Add API to get path to OBBs.
Also hide the bitmap thumbnail stuff, we can't support it in its
current form.
And fix some bugs with propagating paths to native code. Yikes!
Change-Id: I13ab37ddbdba5c073489cba5eab035117d3c1574
diff --git a/core/jni/android_app_NativeActivity.cpp b/core/jni/android_app_NativeActivity.cpp
index b033878..0430a81 100644
--- a/core/jni/android_app_NativeActivity.cpp
+++ b/core/jni/android_app_NativeActivity.cpp
@@ -500,8 +500,9 @@
void* dlhandle;
ANativeActivity_createFunc* createActivityFunc;
- String8 internalDataPath;
- String8 externalDataPath;
+ String8 internalDataPathObj;
+ String8 externalDataPathObj;
+ String8 obbPathObj;
sp<ANativeWindow> nativeWindow;
int32_t lastWindowWidth;
@@ -641,8 +642,8 @@
static jint
loadNativeCode_native(JNIEnv* env, jobject clazz, jstring path, jstring funcName,
- jobject messageQueue,
- jstring internalDataDir, jstring externalDataDir, int sdkVersion,
+ jobject messageQueue, jstring internalDataDir, jstring obbDir,
+ jstring externalDataDir, int sdkVersion,
jobject jAssetMgr, jbyteArray savedState)
{
LOG_TRACE("loadNativeCode_native");
@@ -699,19 +700,24 @@
code->clazz = env->NewGlobalRef(clazz);
const char* dirStr = env->GetStringUTFChars(internalDataDir, NULL);
- code->internalDataPath = dirStr;
- code->internalDataPath = code->internalDataPath.string();
- env->ReleaseStringUTFChars(path, dirStr);
+ code->internalDataPathObj = dirStr;
+ code->internalDataPath = code->internalDataPathObj.string();
+ env->ReleaseStringUTFChars(internalDataDir, dirStr);
dirStr = env->GetStringUTFChars(externalDataDir, NULL);
- code->externalDataPath = dirStr;
- code->externalDataPath = code->externalDataPath.string();
- env->ReleaseStringUTFChars(path, dirStr);
+ code->externalDataPathObj = dirStr;
+ code->externalDataPath = code->externalDataPathObj.string();
+ env->ReleaseStringUTFChars(externalDataDir, dirStr);
code->sdkVersion = sdkVersion;
code->assetManager = assetManagerForJavaObject(env, jAssetMgr);
+ dirStr = env->GetStringUTFChars(obbDir, NULL);
+ code->obbPathObj = dirStr;
+ code->obbPath = code->obbPathObj.string();
+ env->ReleaseStringUTFChars(obbDir, dirStr);
+
jbyte* rawSavedState = NULL;
jsize rawSavedSize = 0;
if (savedState != NULL) {
@@ -1022,7 +1028,7 @@
}
static const JNINativeMethod g_methods[] = {
- { "loadNativeCode", "(Ljava/lang/String;Ljava/lang/String;Landroid/os/MessageQueue;Ljava/lang/String;Ljava/lang/String;ILandroid/content/res/AssetManager;[B)I",
+ { "loadNativeCode", "(Ljava/lang/String;Ljava/lang/String;Landroid/os/MessageQueue;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILandroid/content/res/AssetManager;[B)I",
(void*)loadNativeCode_native },
{ "unloadNativeCode", "(I)V", (void*)unloadNativeCode_native },
{ "onStartNative", "(I)V", (void*)onStart_native },