mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-24 21:33:16 +08:00
修复 某些情况下调用app.sendBroadcast("inspect_layout_bounds")等崩溃的问题
This commit is contained in:
parent
fbe2df406a
commit
0bccf1c3a3
@ -63,12 +63,18 @@ public class AutoJs extends com.stardust.autojs.AutoJs {
|
||||
private BroadcastReceiver mLayoutInspectBroadcastReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
ensureAccessibilityServiceEnabled();
|
||||
String action = intent.getAction();
|
||||
if (LayoutBoundsFloatyWindow.class.getName().equals(action)) {
|
||||
capture(LayoutBoundsFloatyWindow::new);
|
||||
} else if (LayoutHierarchyFloatyWindow.class.getName().equals(action)) {
|
||||
capture(LayoutHierarchyFloatyWindow::new);
|
||||
try {
|
||||
ensureAccessibilityServiceEnabled();
|
||||
String action = intent.getAction();
|
||||
if (LayoutBoundsFloatyWindow.class.getName().equals(action)) {
|
||||
capture(LayoutBoundsFloatyWindow::new);
|
||||
} else if (LayoutHierarchyFloatyWindow.class.getName().equals(action)) {
|
||||
capture(LayoutHierarchyFloatyWindow::new);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user