change getRootInActiveWindow back to 2.0.12 Beta
This commit is contained in:
@@ -27,8 +27,8 @@ public class LayoutInspector {
|
|||||||
mCapture = null;
|
mCapture = null;
|
||||||
} else {
|
} else {
|
||||||
final AccessibilityNodeInfo root = service.getRootInActiveWindow();
|
final AccessibilityNodeInfo root = service.getRootInActiveWindow();
|
||||||
Log.d(LOG_TAG, "captureCurrentWindow: root = null");
|
|
||||||
if (root == null) {
|
if (root == null) {
|
||||||
|
Log.d(LOG_TAG, "captureCurrentWindow: root = null");
|
||||||
mCapture = null;
|
mCapture = null;
|
||||||
} else {
|
} else {
|
||||||
mExecutor.execute(new Runnable() {
|
mExecutor.execute(new Runnable() {
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ public class ScriptWidgets {
|
|||||||
static void removeAllNotIn(Set<Integer> appWidgetIdSet) {
|
static void removeAllNotIn(Set<Integer> appWidgetIdSet) {
|
||||||
List<String> keysToRemove = new LinkedList<>();
|
List<String> keysToRemove = new LinkedList<>();
|
||||||
for (Map.Entry<String, ?> entry : widgets.getAll().entrySet()) {
|
for (Map.Entry<String, ?> entry : widgets.getAll().entrySet()) {
|
||||||
|
if (entry.getKey().equals("max_rc")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Matcher matcher = ID_PATTERN.matcher(entry.getKey());
|
Matcher matcher = ID_PATTERN.matcher(entry.getKey());
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
int id = Integer.parseInt(matcher.group(1));
|
int id = Integer.parseInt(matcher.group(1));
|
||||||
@@ -55,7 +58,8 @@ public class ScriptWidgets {
|
|||||||
keysToRemove.add(entry.getKey());
|
keysToRemove.add(entry.getKey());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(LOG_TAG, "illegal key: " + entry.getKey());
|
Log.w(LOG_TAG, "illegal key: " + entry.getKey());
|
||||||
|
keysToRemove.add(entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SharedPreferences.Editor editor = widgets.edit();
|
SharedPreferences.Editor editor = widgets.edit();
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
|
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:accessibilityEventTypes="typeAllMask"
|
android:accessibilityEventTypes="typeNotificationStateChanged|typeAnnouncement|typeAssistReadingContext|typeContextClicked|typeGestureDetectionEnd|typeGestureDetectionStart|typeTouchExplorationGestureEnd|typeTouchExplorationGestureStart|typeTouchInteractionEnd|typeTouchInteractionStart|typeViewAccessibilityFocusCleared|typeViewAccessibilityFocused|typeViewClicked|typeViewHoverEnter|typeViewHoverExit|typeViewFocused|typeViewLongClicked|typeViewScrolled|typeViewSelected|typeViewTextChanged|typeViewTextSelectionChanged|typeViewTextTraversedAtMovementGranularity|typeWindowContentChanged|typeWindowsChanged|typeWindowStateChanged"
|
||||||
android:accessibilityFeedbackType="feedbackGeneric"
|
android:accessibilityFeedbackType="feedbackGeneric"
|
||||||
android:accessibilityFlags="flagRetrieveInteractiveWindows|flagIncludeNotImportantViews|flagReportViewIds|flagRequestEnhancedWebAccessibility"
|
android:accessibilityFlags="flagIncludeNotImportantViews|flagReportViewIds|flagRetrieveInteractiveWindows|flagRequestEnhancedWebAccessibility"
|
||||||
android:canPerformGestures="true"
|
android:canPerformGestures="true"
|
||||||
android:canRequestEnhancedWebAccessibility="true"
|
android:canRequestEnhancedWebAccessibility="true"
|
||||||
android:canRetrieveWindowContent="true"
|
android:canRetrieveWindowContent="true"
|
||||||
|
|||||||
@@ -59,13 +59,14 @@ public class AccessibilityService extends android.accessibilityservice.Accessibi
|
|||||||
@Override
|
@Override
|
||||||
public void onAccessibilityEvent(final AccessibilityEvent event) {
|
public void onAccessibilityEvent(final AccessibilityEvent event) {
|
||||||
Log.v(TAG, "onAccessibilityEvent: " + event);
|
Log.v(TAG, "onAccessibilityEvent: " + event);
|
||||||
try {
|
if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
|
||||||
|
|| event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
|
||||||
|
|| event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT) {
|
||||||
AccessibilityNodeInfo root = super.getRootInActiveWindow();
|
AccessibilityNodeInfo root = super.getRootInActiveWindow();
|
||||||
Log.v(TAG, "getRootInActiveWindow: " + root);
|
if (root != null) {
|
||||||
if (root != null)
|
|
||||||
mRootInActiveWindow = root;
|
mRootInActiveWindow = root;
|
||||||
} catch (Exception ignored) {
|
Log.d(TAG, "rootInActiveWindow: " + mRootInActiveWindow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!containsAllEventTypes && !eventTypes.contains(event.getEventType()))
|
if (!containsAllEventTypes && !eventTypes.contains(event.getEventType()))
|
||||||
return;
|
return;
|
||||||
@@ -81,6 +82,7 @@ public class AccessibilityService extends android.accessibilityservice.Accessibi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInterrupt() {
|
public void onInterrupt() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user