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

Commit ee00fea7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix drag and drop (1/3)"

parents 6d82c537 59f532ef
Loading
Loading
Loading
Loading
+17 −1
Original line number Original line Diff line number Diff line
@@ -165,7 +165,8 @@ public class SurfaceControl implements Parcelable {


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

    private static native void nativeTransferTouchFocus(long transactionObj, IBinder fromToken,
            IBinder toToken);


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


        /**
         * Transfers touch focus from one window to another. It is possible for multiple windows to
         * have touch focus if they support split touch dispatch
         * {@link android.view.WindowManager.LayoutParams#FLAG_SPLIT_TOUCH} but this
         * method only transfers touch focus of the specified window without affecting
         * other windows that may also have touch focus at the same time.
         * @param fromToken The token of a window that currently has touch focus.
         * @param toToken The token of the window that should receive touch focus in
         * place of the first.
         */
        public Transaction transferTouchFocus(IBinder fromToken, IBinder toToken) {
            nativeTransferTouchFocus(mNativeObject, fromToken, toToken);
            return this;
        }

        @UnsupportedAppUsage
        @UnsupportedAppUsage
        public Transaction setMatrix(SurfaceControl sc,
        public Transaction setMatrix(SurfaceControl sc,
                float dsdx, float dtdx, float dtdy, float dsdy) {
                float dsdx, float dtdx, float dtdy, float dsdy) {
+12 −1
Original line number Original line Diff line number Diff line
@@ -348,6 +348,15 @@ static void nativeSetInputWindowInfo(JNIEnv* env, jclass clazz, jlong transactio
    transaction->setInputWindowInfo(ctrl, *handle->getInfo());
    transaction->setInputWindowInfo(ctrl, *handle->getInfo());
}
}


static void nativeTransferTouchFocus(JNIEnv* env, jclass clazz, jlong transactionObj,
        jobject fromTokenObj, jobject toTokenObj) {
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);

    sp<IBinder> fromToken(ibinderForJavaObject(env, fromTokenObj));
    sp<IBinder> toToken(ibinderForJavaObject(env, toTokenObj));
    transaction->transferTouchFocus(fromToken, toToken);
}

static void nativeSetColor(JNIEnv* env, jclass clazz, jlong transactionObj,
static void nativeSetColor(JNIEnv* env, jclass clazz, jlong transactionObj,
        jlong nativeObject, jfloatArray fColor) {
        jlong nativeObject, jfloatArray fColor) {
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
@@ -1033,6 +1042,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
            (void*)nativeCaptureLayers },
            (void*)nativeCaptureLayers },
    {"nativeSetInputWindowInfo", "(JJLandroid/view/InputWindowHandle;)V",
    {"nativeSetInputWindowInfo", "(JJLandroid/view/InputWindowHandle;)V",
            (void*)nativeSetInputWindowInfo },
            (void*)nativeSetInputWindowInfo },
    {"nativeTransferTouchFocus", "(JLandroid/os/IBinder;Landroid/os/IBinder;)V",
            (void*)nativeTransferTouchFocus },
    {"nativeGetDisplayedContentSamplingAttributes",
    {"nativeGetDisplayedContentSamplingAttributes",
            "(Landroid/os/IBinder;)Landroid/hardware/display/DisplayedContentSamplingAttributes;",
            "(Landroid/os/IBinder;)Landroid/hardware/display/DisplayedContentSamplingAttributes;",
            (void*)nativeGetDisplayedContentSamplingAttributes },
            (void*)nativeGetDisplayedContentSamplingAttributes },