You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by "codefurture (JIRA)" <ji...@apache.org> on 2018/01/22 04:00:00 UTC

[jira] [Created] (WEEX-199) Add Global Switch Control Wson on or off

codefurture created WEEX-199:
--------------------------------

             Summary: Add Global Switch Control Wson on or off
                 Key: WEEX-199
                 URL: https://issues.apache.org/jira/browse/WEEX-199
             Project: Weex
          Issue Type: Improvement
            Reporter: codefurture
            Assignee: Adam Feng


Add Global Switch Control Wson on or off

 

public static void updateGlobalConfig(String config){
 if(TextUtils.isEmpty(config)){
 config = "none";
 }
 if(!TextUtils.equals(config, globalConfig)){
 globalConfig = config;
 WXEnvironment.getCustomOptions().put(GLOBAL_CONFIG_KEY, globalConfig);
 Runnable runnable = new Runnable() {
 @Override
 public void run() {
 if(mBridgeManager != null){
 if(mBridgeManager.isJSFrameworkInit()){
 if(mBridgeManager.mWXBridge instanceof WXBridge) {
 final WXBridge bridge = (WXBridge) mBridgeManager.mWXBridge;
 bridge.updateGlobalConfig(globalConfig);
 }
 }
 }
 if(globalConfig.contains("wson_off")){
 WXJsonUtils.USE_WSON = false;
 }else{
 WXJsonUtils.USE_WSON = true;
 }
 }
 };
 if(mBridgeManager != null && mBridgeManager.isJSFrameworkInit()){
 mBridgeManager.post(runnable);
 }else{
 runnable.run();
 }
 }
}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)