weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ky...@apache.org
Subject [38/52] [abbrv] incubator-weex git commit: * [android] Add function for report layer overflow error.
Date Mon, 07 May 2018 07:53:11 GMT
* [android] Add function for report layer overflow error.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6d2337d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6d2337d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6d2337d0

Branch: refs/heads/master
Commit: 6d2337d098e1b36f635afa49acabde901cf95674
Parents: 99f1c04
Author: miomin <691292118@qq.com>
Authored: Fri May 4 11:46:04 2018 +0800
Committer: YorkShen <shenyuancs@gmail.com>
Committed: Mon May 7 15:52:09 2018 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/view/WXFrameLayout.java    | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6d2337d0/android/sdk/src/main/java/com/taobao/weex/ui/view/WXFrameLayout.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXFrameLayout.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXFrameLayout.java
index cfb1ec6..eb3d676 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXFrameLayout.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXFrameLayout.java
@@ -105,23 +105,29 @@ public class WXFrameLayout extends FrameLayout implements WXGestureObservable,IR
       try {
         dispatchDrawInterval(canvas);
       } catch (StackOverflowError e) {
-        int deep = calLayerDeep(this, 0);
-        WXExceptionUtils.commitCriticalExceptionRT(getComponent().getInstanceId(),
-                WXErrorCode.WX_RENDER_ERR_LAYER_OVERFLOW,
-                "draw android view",
-                WXErrorCode.WX_RENDER_ERR_LAYER_OVERFLOW.getErrorMsg() + "Layer overflow
limit error: " + deep + " layers!",
-                null);
+        int deep = reportLayerOverFlowError();
         throw new LayerOverFlowLimitException("Layer overflow limit error: " + deep + " layers!");
       }
     } else {
       try {
         dispatchDrawInterval(canvas);
       } catch (StackOverflowError e){
+        reportLayerOverFlowError();
         WXLogUtils.e("FlatGUI Crashed when dispatchDraw", WXLogUtils.getStackTrace(e));
       }
     }
   }
 
+  private int reportLayerOverFlowError() {
+    int deep = calLayerDeep(this, 0);
+    WXExceptionUtils.commitCriticalExceptionRT(getComponent().getInstanceId(),
+            WXErrorCode.WX_RENDER_ERR_LAYER_OVERFLOW,
+            "draw android view",
+            WXErrorCode.WX_RENDER_ERR_LAYER_OVERFLOW.getErrorMsg() + "Layer overflow limit
error: " + deep + " layers!",
+            null);
+    return deep;
+  }
+
   private void dispatchDrawInterval(Canvas canvas) {
     if (mWidgets != null) {
       canvas.save();


Mime
View raw message