[new downloader][android] refactor: Removed excessive MethodRef class, refactored platform initialization a bit.

This commit is contained in:
Alexander Marchuk 2016-02-05 16:12:36 +03:00 committed by Sergey Yershov
parent 5a9bb5c83c
commit cc39077a2d

View file

@ -7,37 +7,33 @@
extern "C"
{
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MwmApplication_nativeInitPlatform(
JNIEnv * env, jobject thiz,
jstring apkPath, jstring storagePath, jstring tmpPath, jstring obbGooglePath,
jstring flavorName, jstring buildType, jboolean isYota, jboolean isTablet)
Java_com_mapswithme_maps_MwmApplication_nativeInitPlatform(JNIEnv * env, jobject thiz, jstring apkPath, jstring storagePath, jstring tmpPath,
jstring obbGooglePath, jstring flavorName, jstring buildType, jboolean isYota, jboolean isTablet)
{
android::Platform::Instance().InitAppMethodRefs(thiz);
android::Platform::Instance().Initialize(
env, apkPath, storagePath, tmpPath, obbGooglePath, flavorName, buildType, isYota, isTablet);
android::Platform::Instance().Initialize(env, thiz, apkPath, storagePath, tmpPath, obbGooglePath, flavorName, buildType, isYota, isTablet);
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MwmApplication_nativeInitFramework(JNIEnv * env, jobject thiz)
Java_com_mapswithme_maps_MwmApplication_nativeInitFramework(JNIEnv * env, jclass clazz)
{
if (!g_framework)
g_framework = new android::Framework();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MwmApplication_runNativeFunctor(JNIEnv * env, jobject thiz, jlong functorPointer)
Java_com_mapswithme_maps_MwmApplication_nativeProcessFunctor(JNIEnv * env, jclass clazz, jlong functorPointer)
{
android::Platform::Instance().CallNativeFunctor(functorPointer);
android::Platform::Instance().ProcessFunctor(functorPointer);
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_MwmApplication_nativeHasFreeSpace(JNIEnv * env, jobject thiz, jlong size)
Java_com_mapswithme_maps_MwmApplication_nativeHasFreeSpace(JNIEnv * env, jclass clazz, jlong size)
{
return android::Platform::Instance().HasAvailableSpaceForWriting(size);
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MwmApplication_nativeAddLocalization(JNIEnv * env, jobject thiz, jstring name, jstring value)
Java_com_mapswithme_maps_MwmApplication_nativeAddLocalization(JNIEnv * env, jclass clazz, jstring name, jstring value)
{
g_framework->AddString(jni::ToNativeString(env, name),
jni::ToNativeString(env, value));