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

Commit 46f1faca authored by Russell Myers's avatar Russell Myers
Browse files

Provide layer IDs to Java InputWindowHandle.

This allows us to uniquely identify layers such as surface views in
addition to those views that are backed by window tokens.

Bug: 404617897
Test: Build; unit test; atest RenderSessionService test with plumbing
Flag: EXEMPT internal plumbing
Change-Id: I7749671aaea684527f80161ec401a2f36678f3d7
parent 73d957e3
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");