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

Commit 6f8d213f authored by Russell Myers's avatar Russell Myers Committed by Android (Google) Code Review
Browse files

Merge "Provide layer IDs to Java InputWindowHandle." into main

parents 9fa41441 46f1faca
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -127,6 +127,9 @@ public final class InputWindowHandle {
    // security concerns
    public int touchOcclusionMode = TouchOcclusionMode.BLOCK_UNTRUSTED;

    // Globally unique layer ID for the surface / window.
    public int layerId;

    // Id of process and user that owns the window.
    public int ownerPid;
    public int ownerUid;
@@ -189,6 +192,7 @@ public final class InputWindowHandle {
        // Do not copy ptr to prevent this copy from sharing the same native object.
        ptr = 0;
        inputApplicationHandle = new InputApplicationHandle(other.inputApplicationHandle);
        layerId = other.layerId;
        token = other.token;
        windowToken = other.windowToken;
        name = other.name;
+4 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ static struct {
    jfieldID scaleFactor;
    jfieldID touchableRegion;
    jfieldID touchOcclusionMode;
    jfieldID layerId;
    jfieldID ownerPid;
    jfieldID ownerUid;
    jfieldID packageName;
@@ -270,6 +271,7 @@ jobject android_view_InputWindowHandle_fromWindowInfo(JNIEnv* env,

    env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.touchOcclusionMode,
                     static_cast<int32_t>(windowInfo.touchOcclusionMode));
    env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.layerId, windowInfo.id);
    env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerPid,
                     windowInfo.ownerPid.val());
    env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerUid,
@@ -380,6 +382,8 @@ int register_android_view_InputWindowHandle(JNIEnv* env) {

    GET_FIELD_ID(gInputWindowHandleClassInfo.touchOcclusionMode, clazz, "touchOcclusionMode", "I");

    GET_FIELD_ID(gInputWindowHandleClassInfo.layerId, clazz, "layerId", "I");

    GET_FIELD_ID(gInputWindowHandleClassInfo.ownerPid, clazz,
            "ownerPid", "I");