You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/11/29 07:33:36 UTC

[GitHub] YorkShen closed pull request #1844: *[Android] weex performance optimization

YorkShen closed pull request #1844: *[Android] weex performance optimization
URL: https://github.com/apache/incubator-weex/pull/1844
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java
index e96803270c..53eb456397 100644
--- a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java
+++ b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java
@@ -85,7 +85,6 @@ public static Bitmap blur(@NonNull Bitmap originalImage, int radius) {
                 }
 
                 Bitmap result = stackBlur(sampledImage,radius);
-                WXLogUtils.d(TAG, "elapsed time on blurring image(radius:"+ radius + ",sampling: " + sampling + "): " + (System.currentTimeMillis() - start) + "ms");
                 return result;
             }catch (Exception e) {
                 WXLogUtils.e(TAG, "thrown exception when blurred image(times = " + i + "),"+ e.getMessage());
diff --git a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java
index bf0c5e3d34..3c6c2ff050 100644
--- a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java
+++ b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java
@@ -18,6 +18,7 @@
  */
 package com.alibaba.weex.commons.adapter;
 
+import com.taobao.weex.WXEnvironment;
 import com.taobao.weex.adapter.IWXJSExceptionAdapter;
 import com.taobao.weex.common.WXJSExceptionInfo;
 import com.taobao.weex.utils.WXLogUtils;
@@ -29,7 +30,7 @@
 
   @Override
   public void onJSException(WXJSExceptionInfo exception) {
-    if (exception != null) {
+    if (exception != null && WXEnvironment.isApkDebugable()) {
       WXLogUtils.d(exception.toString());
     }
   }
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java
index a2df53dca3..5b24defde4 100644
--- a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java
+++ b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java
@@ -33,6 +33,7 @@
 import android.support.v4.app.ActivityCompat;
 import android.text.TextUtils;
 
+import com.taobao.weex.WXEnvironment;
 import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.bridge.SimpleJSCallback;
 import com.taobao.weex.utils.WXLogUtils;
@@ -128,7 +129,9 @@ private WXLocationListener findLocation(String watchId, String sucCallback, Stri
 
   @Override
   public void watchPosition(final String successCallback, final String errorCallback, final String params) {
-    WXLogUtils.d("into--[watchPosition] successCallback:" + successCallback + " errorCallback:" + errorCallback + "\nparams:" + params);
+    if (WXEnvironment.isApkDebugable()){
+      WXLogUtils.d("into--[watchPosition] successCallback:" + successCallback + " errorCallback:" + errorCallback + "\nparams:" + params);
+    }
     if (!TextUtils.isEmpty(params)) {
       try {
         JSONObject jsObj = new JSONObject(params);
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
index 1bdb8d10ee..b46f0201cf 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
@@ -100,6 +100,8 @@
   /** from init to sdk-ready **/
   public static long sSDKInitTime =0;
 
+  public static long sJSFMStartListenerTime=0;
+
   /**
    * component and modules ready
    * */
@@ -110,6 +112,7 @@
   public static LogLevel sLogLevel = LogLevel.DEBUG;
   private static boolean isApkDebug = true;
   public static boolean isPerf = false;
+  private static boolean sDebugFlagInit = false;
 
   private static boolean openDebugLog = false;
 
@@ -277,20 +280,26 @@ public static boolean isApkDebugable() {
       return false;
     }
 
-    if (!isApkDebug) {
-      return false;
+    if (sDebugFlagInit){
+      return isApkDebug;
     }
     try {
-      ApplicationInfo info = sApplication.getApplicationInfo();
-      isApkDebug = (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
-      return isApkDebug;
+      String debugModeConfig = getCustomOptions().get(WXConfig.debugMode);
+      if (TextUtils.isEmpty(debugModeConfig)){
+        ApplicationInfo info = sApplication.getApplicationInfo();
+        isApkDebug = (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
+      }else {
+        isApkDebug = Boolean.valueOf(debugModeConfig);
+      }
     } catch (Exception e) {
       /**
        * Don't call WXLogUtils.e here,will cause stackoverflow
        */
       e.printStackTrace();
+      isApkDebug = false;
     }
-    return true;
+    sDebugFlagInit = true;
+    return isApkDebug;
   }
 
   public static boolean isPerf() {
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
index beb6a5023d..f528654eb9 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
@@ -25,6 +25,7 @@
 import android.support.v4.content.LocalBroadcastManager;
 import android.text.TextUtils;
 
+import android.util.Log;
 import com.taobao.weex.adapter.IDrawableLoader;
 import com.taobao.weex.adapter.IWXHttpAdapter;
 import com.taobao.weex.adapter.IWXImgLoaderAdapter;
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
index 32c3dd9c28..f51af1ae21 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
@@ -613,7 +613,6 @@ public void render(String pageName, Script template, Map<String, Object> options
     mWXPerformance.beforeInstanceRender(mInstanceId);
 
     if(WXEnvironment.isApkDebugable() && WXPerformance.DEFAULT.equals(pageName)){
-      WXLogUtils.e("WXSDKInstance", "Please set your pageName or your js bundle url !!!!!!!");
 
       if (getUIContext() != null) {
         new AlertDialog.Builder(getUIContext())
@@ -682,8 +681,6 @@ private void renderInternal(String pageName,
       mBundleUrl = mWXPerformance.pageName;
     }
 
-    WXLogUtils.d("WXSDKInstance", "Start render page: " + pageName);
-
     if (WXTracing.isAvailable()) {
       WXTracing.TraceEvent traceEvent = WXTracing.newEvent("executeBundleJS", mInstanceId, -1);
       traceEvent.traceId = mExecJSTraceId;
@@ -950,9 +947,6 @@ public String getInstanceId() {
   }
 
   public Context getContext() {
-    if(mContext == null){
-      WXLogUtils.e("WXSdkInstance mContext == null");
-    }
     return mContext;
   }
 
@@ -1058,7 +1052,9 @@ public void onActivityCreate() {
     if(mRootComp != null) {
       mRootComp.onActivityCreate();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityCreate can not be call!");
+        if (WXEnvironment.isApkDebugable()){
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityCreate can not be call!");
+        }
     }
 
     mGlobalEventReceiver=new WXGlobalEventReceiver(this);
@@ -1080,7 +1076,10 @@ public void onActivityStart() {
     if(mRootComp != null) {
       mRootComp.onActivityStart();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+
+        }
     }
 
   }
@@ -1091,7 +1090,10 @@ public boolean onCreateOptionsMenu(Menu menu) {
     if(mRootComp != null) {
       mRootComp.onCreateOptionsMenu(menu);
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+
+        }
     }
     return true;
   }
@@ -1116,10 +1118,11 @@ public void onActivityPause() {
     if(mRootComp != null) {
       mRootComp.onActivityPause();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityPause can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityPause can not be call!");
+        }
     }
 
-    WXLogUtils.i("Application onActivityPause()");
     if (!mCurrentGround) {
       WXLogUtils.i("Application to be in the backround");
       Intent intent = new Intent(WXGlobalEventReceiver.EVENT_ACTION);
@@ -1147,7 +1150,9 @@ public void onActivityResume() {
     if(mRootComp != null) {
       mRootComp.onActivityResume();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityResume can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityResume can not be call!");
+        }
     }
 
     if (mCurrentGround) {
@@ -1176,10 +1181,11 @@ public void onActivityStop() {
     if(mRootComp != null) {
       mRootComp.onActivityStop();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityStop can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityStop can not be call!");
+        }
     }
 
-
   }
 
   @Override
@@ -1189,7 +1195,9 @@ public void onActivityDestroy() {
     if(mRootComp != null) {
       mRootComp.onActivityDestroy();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityDestroy can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityDestroy can not be call!");
+        }
     }
 
     destroy();
@@ -1203,7 +1211,9 @@ public boolean onActivityBack() {
     if(mRootComp != null) {
       return mRootComp.onActivityBack();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityBack can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityBack can not be call!");
+        }
     }
 
     return false;
@@ -1236,7 +1246,9 @@ public void onActivityResult(int requestCode, int resultCode, Intent data){
     if(mRootComp != null) {
       mRootComp.onActivityResult(requestCode,resultCode,data);
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityResult can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityResult can not be call!");
+        }
     }
   }
 
@@ -1248,7 +1260,10 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
     if(mRootComp != null) {
        mRootComp.onRequestPermissionsResult(requestCode,permissions,grantResults);
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onRequestPermissionsResult can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w(
+                "Warning :Component tree has not build completely, onRequestPermissionsResult can not be call!");
+        }
     }
   }
 
@@ -1303,7 +1318,9 @@ public void onCreateFinish() {
    * call back when update finish
    */
   public void onUpdateFinish() {
-    WXLogUtils.d("Instance onUpdateSuccess");
+    if (WXEnvironment.isApkDebugable()){
+      WXLogUtils.d("Instance onUpdateSuccess");
+    }
   }
 
 
@@ -1319,11 +1336,6 @@ public void onRenderSuccess(final int width, final int height) {
 
     long time = System.currentTimeMillis() - mRenderStartTime;
     long[] renderFinishTime = WXBridgeManager.getInstance().getRenderFinishTime(getInstanceId());
-    WXLogUtils.renderPerformanceLog("onRenderSuccess", time);
-    WXLogUtils.renderPerformanceLog("   invokeCreateInstance",mWXPerformance.communicateTime);
-    WXLogUtils.renderPerformanceLog("   onRenderSuccessCallBridgeTime", renderFinishTime[0]);
-    WXLogUtils.renderPerformanceLog("   onRenderSuccessCssLayoutTime", renderFinishTime[1]);
-    WXLogUtils.renderPerformanceLog("   onRenderSuccessParseJsonTime", renderFinishTime[2]);
 
     mWXPerformance.callBridgeTime = renderFinishTime[0];
     mWXPerformance.cssLayoutTime = renderFinishTime[1];
@@ -1333,7 +1345,6 @@ public void onRenderSuccess(final int width, final int height) {
     if(mWXPerformance.screenRenderTime<0.001){
       mWXPerformance.screenRenderTime =  time;
     }
-    WXLogUtils.d(WXLogUtils.WEEX_PERF_TAG, "mComponentNum:" + mWXPerformance.componentCount);
 
     if (mRenderListener != null && mContext != null) {
       mRenderListener.onRenderSuccess(WXSDKInstance.this, width, height);
@@ -1343,8 +1354,9 @@ public void onRenderSuccess(final int width, final int height) {
         performance.args=getBundleUrl();
         mUserTrackAdapter.commit(mContext,null,IWXUserTrackAdapter.JS_BRIDGE,performance,getUserTrackParams());
       }
-
-      WXLogUtils.d(WXLogUtils.WEEX_PERF_TAG, mWXPerformance.toString());
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d(WXLogUtils.WEEX_PERF_TAG, mWXPerformance.toString());
+      }
     }
     if(WXEnvironment.isPerf()){
       WXLogUtils.e("weex_perf",mWXPerformance.getPerfData());
@@ -1352,7 +1364,6 @@ public void onRenderSuccess(final int width, final int height) {
   }
 
   public void onRefreshSuccess(final int width, final int height) {
-    WXLogUtils.renderPerformanceLog("onRefreshSuccess", (System.currentTimeMillis() - mRefreshStartTime));
     if (mRenderListener != null && mContext != null) {
       mRenderListener.onRefreshSuccess(WXSDKInstance.this, width, height);
     }
@@ -1391,10 +1402,6 @@ public void onChangeElement(WXComponent component, boolean isOutOfScreen) {
     }
 
     if (!isOutOfScreen) {
-
-//      WXLogUtils.renderPerformanceLog("   interactionViewAddCount", getWXPerformance().interactionViewAddCount);
-//      WXLogUtils.renderPerformanceLog("   interactionViewAddLimitCount", getWXPerformance().interactionViewAddLimitCount);
-//      WXLogUtils.renderPerformanceLog("   interactionTime", getWXPerformance().interactionTime);
       mApmForInstance.arriveInteraction(component);
     }
   }
@@ -1500,13 +1507,6 @@ public void run() {
       mApmForInstance.arriveFSRenderTime();
       mWXPerformance.fsRenderTime = System.currentTimeMillis();
       mWXPerformance.screenRenderTime = System.currentTimeMillis() - mRenderStartTime;
-
-      long[] fitstScreenPerformance = WXBridgeManager.getInstance().getFirstScreenRenderTime(getInstanceId());
-      WXLogUtils.renderPerformanceLog("firstScreenRenderFinished", mWXPerformance.screenRenderTime);
-      WXLogUtils.renderPerformanceLog("    firstScreenJSFExecuteTime", mWXPerformance.firstScreenJSFExecuteTime);
-      WXLogUtils.renderPerformanceLog("    firstScreenCallBridgeTime", fitstScreenPerformance[0]);
-      WXLogUtils.renderPerformanceLog("    firstScreenCssLayoutTime", fitstScreenPerformance[1]);
-      WXLogUtils.renderPerformanceLog("    firstScreenParseJsonTime", fitstScreenPerformance[2]);
   }
 
   private void destroyView(View rootView) {
@@ -2011,11 +2011,9 @@ public void onHttpFinish(WXResponse response) {
         mApmForInstance.updateRecordInfo(response.extendParams);
         Object actualNetworkTime=response.extendParams.get("actualNetworkTime");
         mWXPerformance.actualNetworkTime=actualNetworkTime instanceof Long?(long)actualNetworkTime:0;
-        WXLogUtils.renderPerformanceLog("actualNetworkTime", mWXPerformance.actualNetworkTime);
 
         Object pureNetworkTime=response.extendParams.get("pureNetworkTime");
         mWXPerformance.pureNetworkTime=pureNetworkTime instanceof Long?(long)pureNetworkTime:0;
-        WXLogUtils.renderPerformanceLog("pureNetworkTime", mWXPerformance.pureNetworkTime);
 
         Object connectionType=response.extendParams.get("connectionType");
         mWXPerformance.connectionType=connectionType instanceof String?(String)connectionType:"";
@@ -2065,7 +2063,6 @@ public void onHttpFinish(WXResponse response) {
           }
         }
       }
-      WXLogUtils.renderPerformanceLog("networkTime", mWXPerformance.networkTime);
       String wxErrorCode = WXInstanceApm.VALUE_ERROR_CODE_DEFAULT;
       if (response!=null && response.originalData!=null && TextUtils.equals("200", response.statusCode)) {
         mApmForInstance.onStage(WXInstanceApm.KEY_PAGE_STAGES_DOWN_BUNDLE_END);
diff --git a/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java b/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java
index ec6be03edf..915399ef0a 100644
--- a/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java
+++ b/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java
@@ -43,6 +43,7 @@
   String STREAM_MODULE = "streamModule";
   String INVOKE_MODULE = "invokeModule";
   String INIT_FRAMEWORK = "initFramework";
+  String COUNTER = "counter";
 
   /**
    * monitor keys
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
index 00bb1b8dc4..20f2b0d7f9 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
@@ -66,6 +66,7 @@
 import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.InputStreamReader;
+import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.text.DateFormat;
@@ -335,7 +336,6 @@ public WXDebugJsBridge getWXDebugJsBridge() {
         WXServiceManager.execAllCacheJsService();
       } else {
         WXLogUtils.e("WXBridgeManager", "WXEnvironment.sApplication is null, skip init Inspector");
-        WXLogUtils.w("WXBridgeManager", new Throwable("WXEnvironment.sApplication is null when init Inspector"));
       }
     }
     if (remoteDebug && mWxDebugProxy != null) {
@@ -1169,7 +1169,6 @@ public void run() {
                 + ", data:" + data);
           }
           mWXBridge.fireEventOnDataRenderNode(instanceId, ref,type,JSON.toJSONString(data));
-          WXLogUtils.renderPerformanceLog("fireEventOnDataRenderNode", System.currentTimeMillis() - start);
         } catch (Throwable e) {
           String err = "[WXBridgeManager] fireEventOnDataRenderNode " + WXLogUtils.getStackTrace(e);
           WXExceptionUtils.commitCriticalExceptionRT(instanceId,
@@ -1283,7 +1282,6 @@ private void invokeRefreshInstance(String instanceId, WXRefreshData refreshData)
               refreshData.data == null ? "{}" : refreshData.data);
       WXJSObject[] args = {instanceIdObj, dataObj};
       mWXBridge.refreshInstance(instanceId, null, METHOD_REFRESH_INSTANCE, args);
-      WXLogUtils.renderPerformanceLog("invokeRefreshInstance", System.currentTimeMillis() - start);
     } catch (Throwable e) {
       String err = "[WXBridgeManager] invokeRefreshInstance " + WXLogUtils.getStackTrace(e);
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
@@ -1844,7 +1842,19 @@ private void initFramework(String framework) {
       }
       try {
         if (WXSDKManager.getInstance().getWXStatisticsListener() != null) {
+          long start = System.currentTimeMillis();
           WXSDKManager.getInstance().getWXStatisticsListener().onJsFrameworkStart();
+          WXEnvironment.sJSFMStartListenerTime = System.currentTimeMillis() - start;
+          try {
+            IWXUserTrackAdapter adapter = WXSDKManager.getInstance().getIWXUserTrackAdapter();
+            if (null != adapter){
+              Map<String,Serializable> params = new HashMap<>(1);
+              params.put("time",String.valueOf(WXEnvironment.sJSFMStartListenerTime));
+              adapter.commit(WXEnvironment.getApplication(),"sJSFMStartListener",IWXUserTrackAdapter.COUNTER,null,params);
+            }
+          }catch (Exception e){
+            e.printStackTrace();
+          }
         }
 
         long start = System.currentTimeMillis();
@@ -1867,9 +1877,7 @@ private void initFramework(String framework) {
         // extends initFramework
         if (mWXBridge.initFrameworkEnv(framework, assembleDefaultOptions(), crashFile, pieSupport) == INIT_FRAMEWORK_OK) {
           WXEnvironment.sJSLibInitTime = System.currentTimeMillis() - start;
-          WXLogUtils.renderPerformanceLog("initFramework", WXEnvironment.sJSLibInitTime);
           WXEnvironment.sSDKInitTime = System.currentTimeMillis() - WXEnvironment.sSDKInitStart;
-          WXLogUtils.renderPerformanceLog("SDKInitTime", WXEnvironment.sSDKInitTime);
           setJSFrameworkInit(true);
 
           if (WXSDKManager.getInstance().getWXStatisticsListener() != null) {
@@ -1905,8 +1913,6 @@ private void trackComponentAndModulesTime() {
       @Override
       public void run() {
         WXEnvironment.sComponentsAndModulesReadyTime = System.currentTimeMillis() - WXEnvironment.sSDKInitStart;
-        WXLogUtils.renderPerformanceLog("ComponentModulesReadyTime", WXEnvironment.sComponentsAndModulesReadyTime);
-        WXLogUtils.d("ComponentModulesReadyTime " + WXEnvironment.sComponentsAndModulesReadyTime);
       }
     });
   }
@@ -2445,7 +2451,9 @@ public int callAddElement(String pageId, String componentType, String ref, int i
                             HashMap<String, String> styles, HashMap<String, String> attributes, HashSet<String> events,
                             float[] margins, float[] paddings, float[] borders,boolean willLayout) {
     if (TextUtils.isEmpty(pageId) || TextUtils.isEmpty(componentType) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callAddElement arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callAddElement arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(pageId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callAddElement",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2491,7 +2499,9 @@ public int callAddElement(String pageId, String componentType, String ref, int i
   public int callRemoveElement(String instanceId, String ref) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callRemoveElement arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callRemoveElement arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callRemoveElement",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2534,7 +2544,9 @@ public int callRemoveElement(String instanceId, String ref) {
   public int callMoveElement(String instanceId, String ref, String parentref, int index) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref) || TextUtils.isEmpty(parentref)) {
-      WXLogUtils.d("[WXBridgeManager] call callMoveElement arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callMoveElement arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callMoveElement",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2573,7 +2585,9 @@ public int callMoveElement(String instanceId, String ref, String parentref, int
   public int callAddEvent(String instanceId, String ref, String event) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref) || TextUtils.isEmpty(event)) {
-      WXLogUtils.d("[WXBridgeManager] call callAddEvent arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callAddEvent arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callAddEvent",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2612,7 +2626,9 @@ public int callAddEvent(String instanceId, String ref, String event) {
   public int callRemoveEvent(String instanceId, String ref, String event) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref) || TextUtils.isEmpty(event)) {
-      WXLogUtils.d("[WXBridgeManager] call callRemoveEvent arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callRemoveEvent arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callRemoveEvent",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2654,7 +2670,10 @@ public int callUpdateStyle(String instanceId, String ref, HashMap<String, Object
                              HashMap<String, String> borders) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callUpdateStyle arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callUpdateStyle arguments is null");
+      }
+
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callUpdateStyle",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2694,7 +2713,10 @@ public int callUpdateStyle(String instanceId, String ref, HashMap<String, Object
   public int callUpdateAttrs(String instanceId, String ref, HashMap<String, String> attrs) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callUpdateAttrs arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callUpdateAttrs arguments is null");
+      }
+
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callUpdateAttrs",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2731,7 +2753,10 @@ public int callUpdateAttrs(String instanceId, String ref, HashMap<String, String
   public int callLayout(String pageId, String ref, int top, int bottom, int left, int right, int height, int width, int index) {
 
     if (TextUtils.isEmpty(pageId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callLayout arguments is null");
+        if (WXEnvironment.isApkDebugable()){
+            WXLogUtils.d("[WXBridgeManager] call callLayout arguments is null");
+        }
+
       WXExceptionUtils.commitCriticalExceptionRT(pageId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callLayout",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
index e68cb372d7..93905d46f3 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
@@ -208,14 +208,12 @@ public void onReceive(Context context, Intent intent) {
           Layout layout = hostView.getTextLayout();
           if (layout != null) {
             layout.getPaint().setTypeface(fontDO.getTypeface());
-            WXLogUtils.d("WXText", "Apply font family " + fontFamily + " to paint");
           } else {
-            WXLogUtils.w("WXText", "Layout not created");
+            WXLogUtils.d("WXText", "Layout not created");
           }
           WXBridgeManager
               .getInstance().markDirty(getInstanceId(), getRef(), true);
         }
-        WXLogUtils.d("WXText", "Font family " + fontFamily + " is available");
       }
     };
 
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java
index 93bdc2bf3e..6b7e233969 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java
@@ -1613,7 +1613,9 @@ public void onLoadMore(int offScreenY) {
                 }
             }
         } catch (Exception e) {
-            WXLogUtils.d(TAG + " onLoadMore : ", e);
+            if (WXEnvironment.isApkDebugable()){
+                WXLogUtils.d(TAG + " onLoadMore : ", e);
+            }
         }
     }
 
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
index 3449359e3a..fc1367ff77 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
@@ -260,7 +260,6 @@ public void onDismiss(DialogInterface dialog) {
   @Override
   public void destroy() {
     if (activeDialog != null && activeDialog.isShowing()) {
-      WXLogUtils.w("Dismiss the active dialog");
       activeDialog.dismiss();
     }
   }
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java b/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java
index 2d113bc70a..507b527064 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java
@@ -58,7 +58,9 @@ public static void registerNativeFont(Map<String, Typeface> fonts) {
       for (Map.Entry<String, Typeface> font : fonts.entrySet()) {
         FontDO fontDO = new FontDO(font.getKey(), font.getValue());
         putFontDO(fontDO);
-        WXLogUtils.d("TypefaceUtil", "register new typeface: " + font.getKey());
+        if (WXEnvironment.isApkDebugable()){
+          WXLogUtils.d("TypefaceUtil", "register new typeface: " + font.getKey());
+        }
       }
     }
   }
@@ -68,7 +70,6 @@ public static FontDO getFontDO(String fontFamilyName) {
   }
 
   public static void removeFontDO(String fontFamilyName) {
-    WXLogUtils.d(TAG, fontFamilyName + " has removed");
     sCacheMap.remove(fontFamilyName);
   }
 
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
index 6bf9b0714d..21da7804ca 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
@@ -292,9 +292,14 @@ private static String _getFieldReflectively(Build build, String fieldName) {
   }
 
   private static String _cpuType() {
-
-    String abi = _getFieldReflectively(new Build(), "CPU_ABI");
-    if (abi == null || abi.length() == 0 || abi.equals("Unknown")) {
+    String abi ;
+    try {
+      abi = Build.CPU_ABI;
+    }catch (Exception e){
+      e.printStackTrace();
+      abi = ARMEABI;
+    }
+    if (TextUtils.isEmpty(abi)){
       abi = ARMEABI;
     }
     abi = abi.toLowerCase();
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java b/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
index 2a2a52f662..839763f63e 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
@@ -408,7 +408,7 @@ public static boolean isTabletDevice() {
     try{
       return (WXEnvironment.getApplication().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
     }catch (Exception e){
-      WXLogUtils.e("[WXUtils] isTabletDevice:", e);
+      //
     }
     return false;
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services