* commit '1d4419e3c2067151baa9010f8bda98653c43cfc8': Add accessibility event for assist disclosure
This commit is contained in:
@@ -37464,6 +37464,7 @@ package android.view.accessibility {
|
||||
field public static final deprecated int MAX_TEXT_LENGTH = 500; // 0x1f4
|
||||
field public static final int TYPES_ALL_MASK = -1; // 0xffffffff
|
||||
field public static final int TYPE_ANNOUNCEMENT = 16384; // 0x4000
|
||||
field public static final int TYPE_ASSIST_READING_CONTEXT = 16777216; // 0x1000000
|
||||
field public static final int TYPE_GESTURE_DETECTION_END = 524288; // 0x80000
|
||||
field public static final int TYPE_GESTURE_DETECTION_START = 262144; // 0x40000
|
||||
field public static final int TYPE_NOTIFICATION_STATE_CHANGED = 64; // 0x40
|
||||
|
||||
@@ -39762,6 +39762,7 @@ package android.view.accessibility {
|
||||
field public static final deprecated int MAX_TEXT_LENGTH = 500; // 0x1f4
|
||||
field public static final int TYPES_ALL_MASK = -1; // 0xffffffff
|
||||
field public static final int TYPE_ANNOUNCEMENT = 16384; // 0x4000
|
||||
field public static final int TYPE_ASSIST_READING_CONTEXT = 16777216; // 0x1000000
|
||||
field public static final int TYPE_GESTURE_DETECTION_END = 524288; // 0x80000
|
||||
field public static final int TYPE_GESTURE_DETECTION_START = 262144; // 0x40000
|
||||
field public static final int TYPE_NOTIFICATION_STATE_CHANGED = 64; // 0x40
|
||||
|
||||
@@ -687,6 +687,11 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
|
||||
*/
|
||||
public static final int TYPE_VIEW_CONTEXT_CLICKED = 0x00800000;
|
||||
|
||||
/**
|
||||
* Represents the event of the assistant currently reading the users screen context.
|
||||
*/
|
||||
public static final int TYPE_ASSIST_READING_CONTEXT = 0x01000000;
|
||||
|
||||
/**
|
||||
* Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event:
|
||||
* The type of change is not defined.
|
||||
@@ -1412,6 +1417,13 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
|
||||
}
|
||||
builder.append("TYPE_VIEW_CONTEXT_CLICKED");
|
||||
eventTypeCount++;
|
||||
}
|
||||
case TYPE_ASSIST_READING_CONTEXT: {
|
||||
if (eventTypeCount > 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append("TYPE_ASSIST_READING_CONTEXT");
|
||||
eventTypeCount++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3124,6 +3124,8 @@ i
|
||||
<flag name="typeWindowsChanged" value="0x00400000" />
|
||||
<!-- Receives {@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_CONTEXT_CLICKED} events. -->
|
||||
<flag name="typeContextClicked" value="0x00800000" />
|
||||
<!-- Receives {@link android.view.accessibility.AccessibilityEvent#TYPE_ASSIST_READING_CONTEXT} events. -->
|
||||
<flag name="typeAssistReadingContext" value="0x01000000" />
|
||||
<!-- Receives {@link android.view.accessibility.AccessibilityEvent#TYPES_ALL_MASK} i.e. all events. -->
|
||||
<flag name="typeAllMask" value="0xffffffff" />
|
||||
</attr>
|
||||
|
||||
@@ -32,6 +32,7 @@ import android.graphics.PorterDuffXfermode;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.animation.AnimationUtils;
|
||||
|
||||
/**
|
||||
@@ -166,6 +167,7 @@ public class AssistDisclosure {
|
||||
super.onAttachedToWindow();
|
||||
|
||||
startAnimation();
|
||||
sendAccessibilityEvent(AccessibilityEvent.TYPE_ASSIST_READING_CONTEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3351,6 +3351,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
||||
case AccessibilityEvent.TYPE_TOUCH_INTERACTION_END:
|
||||
case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER:
|
||||
case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT:
|
||||
// Also always dispatch the event that assist is reading context.
|
||||
case AccessibilityEvent.TYPE_ASSIST_READING_CONTEXT:
|
||||
// Also windows changing should always be anounced.
|
||||
case AccessibilityEvent.TYPE_WINDOWS_CHANGED: {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user