Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e777b75d authored by chaviw's avatar chaviw Committed by Chavi Weingarten
Browse files

Convert to using inputConfig for clone info in WindowInfo

Remove explicit isClone flag and add CLONE to InputConfig

Test: Builds
Bug: 230300971
Change-Id: Iced894472c75bf2ef22618b9e7485d1978d88be2
parent 20a0454e
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ public final class InputWindowHandle {
            InputConfig.DISABLE_USER_ACTIVITY,
            InputConfig.SPY,
            InputConfig.INTERCEPTS_STYLUS,
            InputConfig.CLONE,
    })
    public @interface InputConfigFlags {}

@@ -157,11 +158,6 @@ public final class InputWindowHandle {
     */
    public Matrix transform;

    /**
     * Whether this window is a clone or the original window.
     */
    public boolean isClone;

    private native void nativeDispose();

    public InputWindowHandle(InputApplicationHandle inputApplicationHandle, int displayId) {
@@ -210,7 +206,7 @@ public final class InputWindowHandle {
                .append(", scaleFactor=").append(scaleFactor)
                .append(", transform=").append(transform)
                .append(", windowToken=").append(windowToken)
                .append(", isClone=").append(isClone)
                .append(", isClone=").append((inputConfig & InputConfig.CLONE) != 0)
                .toString();

    }
+0 −5
Original line number Diff line number Diff line
@@ -74,7 +74,6 @@ static struct {
    WeakRefHandleField touchableRegionSurfaceControl;
    jfieldID transform;
    jfieldID windowToken;
    jfieldID isClone;
} gInputWindowHandleClassInfo;

static struct {
@@ -318,8 +317,6 @@ jobject android_view_InputWindowHandle_fromWindowInfo(JNIEnv* env, gui::WindowIn
    env->SetObjectField(inputWindowHandle, gInputWindowHandleClassInfo.windowToken,
                        javaObjectForIBinder(env, windowInfo.windowToken));

    env->SetBooleanField(inputWindowHandle, gInputWindowHandleClassInfo.isClone,
                         windowInfo.isClone);
    return inputWindowHandle;
}

@@ -436,8 +433,6 @@ int register_android_view_InputWindowHandle(JNIEnv* env) {
    GET_FIELD_ID(gInputWindowHandleClassInfo.windowToken, clazz, "windowToken",
                 "Landroid/os/IBinder;");

    GET_FIELD_ID(gInputWindowHandleClassInfo.isClone, clazz, "isClone", "Z");

    jclass weakRefClazz;
    FIND_CLASS(weakRefClazz, "java/lang/ref/Reference");

+2 −1
Original line number Diff line number Diff line
@@ -154,7 +154,8 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {

        for (InputWindowHandle window : windowHandles) {
            final boolean visible = (window.inputConfig & InputConfig.NOT_VISIBLE) == 0;
            if (visible && window.getWindow() != null && !window.isClone) {
            final boolean isNotClone = (window.inputConfig & InputConfig.CLONE) == 0;
            if (visible && window.getWindow() != null && isNotClone) {
                tempVisibleWindows.add(window);
            }
        }