Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[android] 修复eagle在Framework尚未init时遇到的platformBridge缺失的问题 #2715

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion weex_core/Source/android/utils/jni_load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/

#include <jni.h>
#include "core/bridge/platform_bridge.h"
#include "android/bridge/platform/android_bridge.h"
#include "core/manager/weex_core_manager.h"
#include "android/utils/so_utils.h"
#include "android/wrap/content_box_measurement_impl_android.h"
#include "android/wrap/hash_set.h"
Expand Down Expand Up @@ -51,7 +54,8 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
WeexCore::SoUtils::Init(env);
WeexCore::WMLBridge::RegisterJNIUtils(env);
}

PlatformBridge* bridge = new AndroidBridgeInSimple;
WeexCoreManager::Instance()->set_platform_bridge(bridge);
hpop1994 marked this conversation as resolved.
Show resolved Hide resolved
return result ? JNI_VERSION_1_4 : JNI_FALSE;
}

Expand Down
4 changes: 1 addition & 3 deletions weex_core/Source/android/wrap/wx_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ static jint InitFramework(JNIEnv* env, jobject object, jstring script,
->platform_side()
->ReportNativeInitStatus(status_code, error_msg);
});
// Init platform bridge
PlatformBridge* bridge = new AndroidBridgeInSimple;
WeexCoreManager::Instance()->set_platform_bridge(bridge);
PlatformBridge* bridge = WeexCoreManager::Instance()->getPlatformBridge();
// Init params
std::vector<INIT_FRAMEWORK_PARAMS*> params_vector = initFromParam(
env, params, [](const char* status_code, const char* error_msg) {
Expand Down