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

Commit 788f5748 authored by Robert Carr's avatar Robert Carr
Browse files

Plumbing for SurfaceControl#setInputWindowInfo.

The standard SurfaceControl plumbing, plus moving InputWindowInfo from
the services jar to the framework jar so that it is accessible from
SurfaceControl.

Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: None
Change-Id: I3443a98cd04ac6b36977e1874641a34c6befca34
parent cc79a989
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.server.input;
package android.view;

/**
 * Functions as a handle for an application that can receive input.
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.server.input;
package android.view;

import android.graphics.Region;
import android.view.IWindow;
+9 −0
Original line number Diff line number Diff line
@@ -153,6 +153,9 @@ public class SurfaceControl implements Parcelable {

    private static native Display.HdrCapabilities nativeGetHdrCapabilities(IBinder displayToken);

    private static native void nativeSetInputWindowInfo(long transactionObj, long nativeObject,
            InputWindowHandle handle);


    private final CloseGuard mCloseGuard = CloseGuard.get();
    private final String mName;
@@ -1459,6 +1462,12 @@ public class SurfaceControl implements Parcelable {
            return this;
        }

        public Transaction setInputWindowInfo(SurfaceControl sc, InputWindowHandle handle) {
            sc.checkNotReleased();
            nativeSetInputWindowInfo(mNativeObject, sc.mNativeObject, handle);
            return this;
        }

        @UnsupportedAppUsage
        public Transaction setMatrix(SurfaceControl sc,
                float dsdx, float dtdx, float dtdy, float dsdy) {
+2 −2
Original line number Diff line number Diff line
@@ -135,13 +135,13 @@ static const JNINativeMethod gInputApplicationHandleMethods[] = {
        LOG_FATAL_IF(! (var), "Unable to find field " fieldName);

int register_android_server_InputApplicationHandle(JNIEnv* env) {
    int res = jniRegisterNativeMethods(env, "com/android/server/input/InputApplicationHandle",
    int res = jniRegisterNativeMethods(env, "android/view/InputApplicationHandle",
            gInputApplicationHandleMethods, NELEM(gInputApplicationHandleMethods));
    (void) res;  // Faked use when LOG_NDEBUG.
    LOG_FATAL_IF(res < 0, "Unable to register native methods.");

    jclass clazz;
    FIND_CLASS(clazz, "com/android/server/input/InputApplicationHandle");
    FIND_CLASS(clazz, "android/view/InputApplicationHandle");

    GET_FIELD_ID(gInputApplicationHandleClassInfo.ptr, clazz,
            "ptr", "J");
+3 −3
Original line number Diff line number Diff line
@@ -221,20 +221,20 @@ static const JNINativeMethod gInputWindowHandleMethods[] = {
        LOG_FATAL_IF(! (var), "Unable to find field " fieldName);

int register_android_server_InputWindowHandle(JNIEnv* env) {
    int res = jniRegisterNativeMethods(env, "com/android/server/input/InputWindowHandle",
    int res = jniRegisterNativeMethods(env, "android/view/InputWindowHandle",
            gInputWindowHandleMethods, NELEM(gInputWindowHandleMethods));
    (void) res;  // Faked use when LOG_NDEBUG.
    LOG_FATAL_IF(res < 0, "Unable to register native methods.");

    jclass clazz;
    FIND_CLASS(clazz, "com/android/server/input/InputWindowHandle");
    FIND_CLASS(clazz, "android/view/InputWindowHandle");

    GET_FIELD_ID(gInputWindowHandleClassInfo.ptr, clazz,
            "ptr", "J");

    GET_FIELD_ID(gInputWindowHandleClassInfo.inputApplicationHandle,
            clazz,
            "inputApplicationHandle", "Lcom/android/server/input/InputApplicationHandle;");
            "inputApplicationHandle", "Landroid/view/InputApplicationHandle;");

    GET_FIELD_ID(gInputWindowHandleClassInfo.inputChannel, clazz,
            "inputChannel", "Landroid/view/InputChannel;");
Loading