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

Commit a6c72623 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "Add alpha to InputWindowHandle" into main

parents 900b8e51 d02726e5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -156,6 +156,11 @@ public final class InputWindowHandle {
     */
    public Matrix transform;

    /**
     * The alpha value returned from SurfaceFlinger. This will be ignored if passed as input data.
     */
    public float alpha;

    /**
     * The input token for the window to which focus should be transferred when this input window
     * can be successfully focused. If null, this input window will not transfer its focus to
@@ -199,6 +204,7 @@ public final class InputWindowHandle {
        }
        focusTransferTarget = other.focusTransferTarget;
        contentSize = new Size(other.contentSize.getWidth(), other.contentSize.getHeight());
        alpha = other.alpha;
    }

    @Override
@@ -212,6 +218,7 @@ public final class InputWindowHandle {
                .append(", displayId=").append(displayId)
                .append(", isClone=").append((inputConfig & InputConfig.CLONE) != 0)
                .append(", contentSize=").append(contentSize)
                .append(", alpha=").append(alpha)
                .toString();

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

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

    env->SetFloatField(inputWindowHandle, gInputWindowHandleClassInfo.alpha, windowInfo.alpha);

    return inputWindowHandle;
}

@@ -446,6 +449,8 @@ int register_android_view_InputWindowHandle(JNIEnv* env) {
    GET_FIELD_ID(gInputWindowHandleClassInfo.touchableRegionSurfaceControl.ctrl, clazz,
            "touchableRegionSurfaceControl", "Ljava/lang/ref/WeakReference;");

    GET_FIELD_ID(gInputWindowHandleClassInfo.alpha, clazz, "alpha", "F");

    jclass surfaceControlClazz;
    FIND_CLASS(surfaceControlClazz, "android/view/SurfaceControl");
    GET_FIELD_ID(gInputWindowHandleClassInfo.touchableRegionSurfaceControl.mNativeObject,