Catch Throwable instead of Exception
This commit is contained in:
1 parent
8c3796605e
commit
bfd85e9bc7
17 files changed
+179
-113
No files matched your search
@@ -21,6 +21,7 @@ import android.os.Build;
|
||||
import android.support.design.widget.TextInputEditText;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
import com.hippo.util.ExceptionUtils;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
// Avoid crash on some Meizu devices
|
||||
@@ -40,7 +41,8 @@ public class HackyTextInputEditText extends TextInputEditText {
|
||||
if (isMeizu && isPreP) {
|
||||
try {
|
||||
return getSuperHint();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
ExceptionUtils.throwIfFatal(e);
|
||||
return super.getHint();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.content.Context;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import com.hippo.util.ExceptionUtils;
|
||||
|
||||
public class SafeCoordinatorLayout extends CoordinatorLayout {
|
||||
|
||||
@@ -39,7 +40,8 @@ public class SafeCoordinatorLayout extends CoordinatorLayout {
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
try {
|
||||
return super.onInterceptTouchEvent(ev);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
ExceptionUtils.throwIfFatal(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +50,8 @@ public class SafeCoordinatorLayout extends CoordinatorLayout {
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
try {
|
||||
return super.onTouchEvent(ev);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
ExceptionUtils.throwIfFatal(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user