Native fix

This commit is contained in:
Alexey Pelykh 2012-04-23 18:43:59 +03:00
parent 37bfd39b0e
commit 514f2aedeb
2 changed files with 724 additions and 719 deletions

View file

@ -730,10 +730,15 @@ extern "C" JNIEXPORT jobject JNICALL Java_net_osmand_plus_render_NativeOsmandLib
if(!module_libjnigraphics)
{
// module_libjnigraphics = dlopen("jnigraphics", RTLD_NOW | RTLD_NOLOAD);
// if(!module_libjnigraphics) {
module_libjnigraphics = dlopen("jnigraphics", /*RTLD_NOLOAD*/0x0004);
if(!module_libjnigraphics) {
__android_log_print(ANDROID_LOG_WARN, LOG_TAG, "jnigraphics was not found in loaded libraries");
module_libjnigraphics = dlopen("jnigraphics", RTLD_NOW);
// }
}
if(!module_libjnigraphics) {
__android_log_print(ANDROID_LOG_WARN, LOG_TAG, "jnigraphics was not loaded in default location");
module_libjnigraphics = dlopen("/system/lib/libjnigraphics.so", RTLD_NOW);
}
if(!module_libjnigraphics)
{
__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "Failed to load jnigraphics via dlopen, will going to crash");

View file

@ -78,7 +78,7 @@ public class NativeOsmandLibrary {
}
// Android 2.2+
if(android.os.Build.VERSION.SDK_INT >= 8 && false) {
if(android.os.Build.VERSION.SDK_INT >= 8) {
return generateRendering_Direct(rc, searchResultHandler.nativeHandler, bitmap, useEnglishNames, render, defaultColor);
} else {
return generateRendering_Indirect(rc, searchResultHandler.nativeHandler, requestedBitmapWidth, requestedBitmapHeight, rowBytes, isTransparent, useEnglishNames, render, defaultColor);