修复 某些情况下调用app.sendBroadcast("inspect_layout_bounds")等崩溃的问题
This commit is contained in:
@@ -63,12 +63,18 @@ public class AutoJs extends com.stardust.autojs.AutoJs {
|
|||||||
private BroadcastReceiver mLayoutInspectBroadcastReceiver = new BroadcastReceiver() {
|
private BroadcastReceiver mLayoutInspectBroadcastReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
ensureAccessibilityServiceEnabled();
|
try {
|
||||||
String action = intent.getAction();
|
ensureAccessibilityServiceEnabled();
|
||||||
if (LayoutBoundsFloatyWindow.class.getName().equals(action)) {
|
String action = intent.getAction();
|
||||||
capture(LayoutBoundsFloatyWindow::new);
|
if (LayoutBoundsFloatyWindow.class.getName().equals(action)) {
|
||||||
} else if (LayoutHierarchyFloatyWindow.class.getName().equals(action)) {
|
capture(LayoutBoundsFloatyWindow::new);
|
||||||
capture(LayoutHierarchyFloatyWindow::new);
|
} else if (LayoutHierarchyFloatyWindow.class.getName().equals(action)) {
|
||||||
|
capture(LayoutHierarchyFloatyWindow::new);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user