@@ -867,6 +867,14 @@ public int callRefreshFinish(String instanceId, String callback) {
867
867
868
868
}
869
869
870
+ public void restartWeexCoreThread (){
871
+ WXLogUtils .e ("weex" ,"restartWeexCoreThread" );
872
+ WXThread oldThread = mJSThread ;
873
+ mJSThread = new WXThread ("WeexJSBridgeThread" , this );
874
+ mJSHandler = mJSThread .getHandler ();
875
+ oldThread .quit ();
876
+ }
877
+
870
878
public int callReportCrashReloadPage (String instanceId , String crashFile ) {
871
879
boolean isCrashFileEmpty = TextUtils .isEmpty (crashFile );
872
880
try {
@@ -914,6 +922,17 @@ public int callReportCrashReloadPage(String instanceId, String crashFile) {
914
922
if (WXSDKManager .getInstance ().getSDKInstance (instanceId ) != null ) {
915
923
boolean reloadThisInstance = shouldReloadCurrentInstance (
916
924
WXSDKManager .getInstance ().getSDKInstance (instanceId ).getBundleUrl ());
925
+ boolean restartCoreThread = true ;
926
+ IWXConfigAdapter adapter = WXSDKManager .getInstance ().getWxConfigAdapter ();
927
+ if (null != adapter ){
928
+ String config = adapter .getConfig ("wxapm" ,"restartCoreThread" ,"true" );
929
+ restartCoreThread = Boolean .valueOf (config );
930
+ }
931
+ if (restartCoreThread ){
932
+ WXBridgeManager .getInstance ().restartWeexCoreThread ();
933
+ }
934
+ WXSDKManager .getInstance ().getSDKInstance (instanceId ).getContainerInfo ()
935
+ .put ("restartWeexCoreThread" ,String .valueOf (restartCoreThread ));
917
936
new ActionReloadPage (instanceId , reloadThisInstance ).executeAction ();
918
937
}
919
938
0 commit comments