Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -3087,6 +3087,7 @@ package android.accessibilityservice { public abstract class AccessibilityService extends android.app.Service { ctor public AccessibilityService(); method public void attachAccessibilityOverlayToDisplay(int, @NonNull android.view.SurfaceControl); method public boolean clearCache(); method public boolean clearCachedSubtree(@NonNull android.view.accessibility.AccessibilityNodeInfo); method public final void disableSelf(); Loading Loading @@ -49980,6 +49981,7 @@ package android.view { public static final class SurfaceControlViewHost.SurfacePackage implements android.os.Parcelable { ctor public SurfaceControlViewHost.SurfacePackage(@NonNull android.view.SurfaceControlViewHost.SurfacePackage); method public int describeContents(); method @NonNull public android.view.SurfaceControl getSurfaceControl(); method public void notifyConfigurationChanged(@NonNull android.content.res.Configuration); method public void notifyDetachedFromWindow(); method public void release(); core/java/android/accessibilityservice/AccessibilityService.java +27 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ import android.util.SparseArray; import android.view.Display; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.SurfaceView; import android.view.SurfaceControl; import android.view.WindowManager; import android.view.WindowManagerImpl; import android.view.accessibility.AccessibilityCache; Loading Loading @@ -2467,8 +2467,8 @@ public abstract class AccessibilityService extends Service { * </p> * <p> * <strong>Note:</strong> If the view with {@link AccessibilityNodeInfo#FOCUS_INPUT} * is on an embedded view hierarchy which is embedded in a {@link SurfaceView} via * {@link SurfaceView#setChildSurfacePackage}, there is a limitation that this API * is on an embedded view hierarchy which is embedded in a {@link android.view.SurfaceView} via * {@link android.view.SurfaceView#setChildSurfacePackage}, there is a limitation that this API * won't be able to find the node for the view. It's because views don't know about * the embedded hierarchies. Instead, you could traverse all the nodes to find the * focus. Loading Loading @@ -3379,4 +3379,28 @@ public abstract class AccessibilityService extends Service { controller.onStateChanged(state); } } /** * Attaches a {@link android.view.SurfaceControl} containing an accessibility overlay to the * specified display. This type of overlay should be used for content that does not need to * track the location and size of Views in the currently active app e.g. service configuration * or general service UI. To remove this overlay and free the associated resources, use * <code> new SurfaceControl.Transaction().reparent(sc, null).apply();</code>. * * @param displayId the display to which the SurfaceControl should be attached. * @param sc the SurfaceControl containing the overlay content */ public void attachAccessibilityOverlayToDisplay(int displayId, @NonNull SurfaceControl sc) { Preconditions.checkNotNull(sc, "SurfaceControl cannot be null"); final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getConnection(mConnectionId); if (connection == null) { return; } try { connection.attachAccessibilityOverlayToDisplay(displayId, sc); } catch (RemoteException re) { throw new RuntimeException(re); } } } core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.os.Bundle; import android.os.RemoteCallback; import android.view.MagnificationSpec; import android.view.MotionEvent; import android.view.SurfaceControl; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; import android.view.accessibility.IAccessibilityInteractionConnectionCallback; Loading Loading @@ -155,4 +156,5 @@ interface IAccessibilityServiceConnection { void setInstalledAndEnabledServices(in List<AccessibilityServiceInfo> infos); List<AccessibilityServiceInfo> getInstalledAndEnabledServices(); void attachAccessibilityOverlayToDisplay(int displayId, in SurfaceControl sc); } core/java/android/view/SurfaceControlViewHost.java +5 −3 Original line number Diff line number Diff line Loading @@ -159,9 +159,11 @@ public class SurfaceControlViewHost { } /** * Use {@link SurfaceView#setChildSurfacePackage} or manually fix * accessibility (see SurfaceView implementation). * @hide * Returns the {@link android.view.SurfaceControl} associated with this SurfacePackage for * cases where more control is required. * * @return the SurfaceControl associated with this SurfacePackage and its containing * SurfaceControlViewHost */ public @NonNull SurfaceControl getSurfaceControl() { return mSurfaceControl; Loading core/tests/coretests/src/android/view/accessibility/AccessibilityServiceConnectionImpl.java +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.RemoteCallback; import android.os.RemoteException; import android.view.SurfaceControl; import android.window.ScreenCapture; import java.util.Collections; Loading Loading @@ -222,4 +223,7 @@ public class AccessibilityServiceConnectionImpl extends IAccessibilityServiceCon public List<AccessibilityServiceInfo> getInstalledAndEnabledServices() throws RemoteException { return null; } @Override public void attachAccessibilityOverlayToDisplay(int displayId, SurfaceControl sc) {} } Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -3087,6 +3087,7 @@ package android.accessibilityservice { public abstract class AccessibilityService extends android.app.Service { ctor public AccessibilityService(); method public void attachAccessibilityOverlayToDisplay(int, @NonNull android.view.SurfaceControl); method public boolean clearCache(); method public boolean clearCachedSubtree(@NonNull android.view.accessibility.AccessibilityNodeInfo); method public final void disableSelf(); Loading Loading @@ -49980,6 +49981,7 @@ package android.view { public static final class SurfaceControlViewHost.SurfacePackage implements android.os.Parcelable { ctor public SurfaceControlViewHost.SurfacePackage(@NonNull android.view.SurfaceControlViewHost.SurfacePackage); method public int describeContents(); method @NonNull public android.view.SurfaceControl getSurfaceControl(); method public void notifyConfigurationChanged(@NonNull android.content.res.Configuration); method public void notifyDetachedFromWindow(); method public void release();
core/java/android/accessibilityservice/AccessibilityService.java +27 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ import android.util.SparseArray; import android.view.Display; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.SurfaceView; import android.view.SurfaceControl; import android.view.WindowManager; import android.view.WindowManagerImpl; import android.view.accessibility.AccessibilityCache; Loading Loading @@ -2467,8 +2467,8 @@ public abstract class AccessibilityService extends Service { * </p> * <p> * <strong>Note:</strong> If the view with {@link AccessibilityNodeInfo#FOCUS_INPUT} * is on an embedded view hierarchy which is embedded in a {@link SurfaceView} via * {@link SurfaceView#setChildSurfacePackage}, there is a limitation that this API * is on an embedded view hierarchy which is embedded in a {@link android.view.SurfaceView} via * {@link android.view.SurfaceView#setChildSurfacePackage}, there is a limitation that this API * won't be able to find the node for the view. It's because views don't know about * the embedded hierarchies. Instead, you could traverse all the nodes to find the * focus. Loading Loading @@ -3379,4 +3379,28 @@ public abstract class AccessibilityService extends Service { controller.onStateChanged(state); } } /** * Attaches a {@link android.view.SurfaceControl} containing an accessibility overlay to the * specified display. This type of overlay should be used for content that does not need to * track the location and size of Views in the currently active app e.g. service configuration * or general service UI. To remove this overlay and free the associated resources, use * <code> new SurfaceControl.Transaction().reparent(sc, null).apply();</code>. * * @param displayId the display to which the SurfaceControl should be attached. * @param sc the SurfaceControl containing the overlay content */ public void attachAccessibilityOverlayToDisplay(int displayId, @NonNull SurfaceControl sc) { Preconditions.checkNotNull(sc, "SurfaceControl cannot be null"); final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getConnection(mConnectionId); if (connection == null) { return; } try { connection.attachAccessibilityOverlayToDisplay(displayId, sc); } catch (RemoteException re) { throw new RuntimeException(re); } } }
core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.os.Bundle; import android.os.RemoteCallback; import android.view.MagnificationSpec; import android.view.MotionEvent; import android.view.SurfaceControl; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; import android.view.accessibility.IAccessibilityInteractionConnectionCallback; Loading Loading @@ -155,4 +156,5 @@ interface IAccessibilityServiceConnection { void setInstalledAndEnabledServices(in List<AccessibilityServiceInfo> infos); List<AccessibilityServiceInfo> getInstalledAndEnabledServices(); void attachAccessibilityOverlayToDisplay(int displayId, in SurfaceControl sc); }
core/java/android/view/SurfaceControlViewHost.java +5 −3 Original line number Diff line number Diff line Loading @@ -159,9 +159,11 @@ public class SurfaceControlViewHost { } /** * Use {@link SurfaceView#setChildSurfacePackage} or manually fix * accessibility (see SurfaceView implementation). * @hide * Returns the {@link android.view.SurfaceControl} associated with this SurfacePackage for * cases where more control is required. * * @return the SurfaceControl associated with this SurfacePackage and its containing * SurfaceControlViewHost */ public @NonNull SurfaceControl getSurfaceControl() { return mSurfaceControl; Loading
core/tests/coretests/src/android/view/accessibility/AccessibilityServiceConnectionImpl.java +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.RemoteCallback; import android.os.RemoteException; import android.view.SurfaceControl; import android.window.ScreenCapture; import java.util.Collections; Loading Loading @@ -222,4 +223,7 @@ public class AccessibilityServiceConnectionImpl extends IAccessibilityServiceCon public List<AccessibilityServiceInfo> getInstalledAndEnabledServices() throws RemoteException { return null; } @Override public void attachAccessibilityOverlayToDisplay(int displayId, SurfaceControl sc) {} }