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

Commit c77468cf authored by Android Culprit Assistant's avatar Android Culprit Assistant Committed by Patrick Williams
Browse files

Revert "Update SCVH InputTransferToken when available"

This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/78a373af-3d5f-4015-a25e-bcb24843f6a9

).

Bug: 405254118
Change-Id: Id09afebdfdb16d58c17da55c070a023e9aca9a1a
Signed-off-by: default avatar <boq-android-culprit-assistant@system.gserviceaccount.com>
parent 3df9b8b3
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.graphics.Rect;
import android.view.InsetsState;
import android.view.ISurfaceControlViewHostParent;
import android.window.ISurfaceSyncGroup;
import android.window.InputTransferToken;

/**
 * API from content embedder back to embedded content in SurfaceControlViewHost
@@ -33,7 +32,6 @@ interface ISurfaceControlViewHost {
     * APIs that are blocking
     */
    oneway void onConfigurationChanged(in Configuration newConfig);
    oneway void onDispatchAttachedToWindow(in InputTransferToken token);
    oneway void onDispatchDetachedFromWindow();
    oneway void onInsetsChanged(in InsetsState state, in Rect insetFrame);
    ISurfaceSyncGroup getSurfaceSyncGroup();
+2 −3
Original line number Diff line number Diff line
@@ -313,9 +313,8 @@ interface IWindowSession {
    /**
     * Update the flags on an input channel associated with a particular surface.
     */
    oneway void updateInputChannel(in IBinder channelToken,
            in @nullable InputTransferToken hostInputTransferToken,
            int displayId, in SurfaceControl surface, int flags, int privateFlags, int inputFeatures,
    oneway void updateInputChannel(in IBinder channelToken, int displayId,
            in SurfaceControl surface, int flags, int privateFlags, int inputFeatures,
            in Region region);

    /**
+0 −14
Original line number Diff line number Diff line
@@ -78,20 +78,6 @@ public class SurfaceControlViewHost {
            });
        }

        @Override
        public void onDispatchAttachedToWindow(InputTransferToken hostInputTransferToken) {
            boolean hostInputTransferTokenChanged =
                    !Objects.equals(hostInputTransferToken, mWm.mHostInputTransferToken);
            if (!hostInputTransferTokenChanged) {
                return;
            }

            mWm.setHostInputTransferToken(hostInputTransferToken);
            if (mViewRoot != null && mViewRoot.mView != null) {
                mWm.updateInputChannel(getWindowToken().asBinder());
            }
        }

        @Override
        public void onDispatchDetachedFromWindow() {
            if (mViewRoot == null) {
+1 −33
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.view;


import static android.view.flags.Flags.FLAG_DEPRECATE_SURFACE_VIEW_Z_ORDER_APIS;
import static android.view.flags.Flags.FLAG_SURFACE_VIEW_GET_SURFACE_PACKAGE;
import static android.view.flags.Flags.FLAG_SURFACE_VIEW_SET_COMPOSITION_ORDER;
@@ -24,8 +23,6 @@ import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
import static android.view.WindowManagerPolicyConstants.APPLICATION_MEDIA_OVERLAY_SUBLAYER;
import static android.view.WindowManagerPolicyConstants.APPLICATION_MEDIA_SUBLAYER;
import static android.view.WindowManagerPolicyConstants.APPLICATION_PANEL_SUBLAYER;
import static android.view.flags.Flags.FLAG_SURFACE_VIEW_GET_SURFACE_PACKAGE;
import static android.view.flags.Flags.FLAG_SURFACE_VIEW_SET_COMPOSITION_ORDER;

import android.annotation.FlaggedApi;
import android.annotation.FloatRange;
@@ -62,7 +59,6 @@ import android.util.Log;
import android.view.SurfaceControl.Transaction;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.IAccessibilityEmbeddedConnection;
import android.window.InputTransferToken;
import android.window.SurfaceSyncGroup;

import com.android.graphics.hwui.flags.Flags;
@@ -351,7 +347,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                    sv.mSurfacePackage.getRemoteInterface().attachParentInterface(this);
                    mSurfaceView = sv;
                } catch (RemoteException e) {
                    Log.d(TAG, "Failed to attach parent interface to SCVH. Likely SCVH is already "
                    Log.d(TAG, "Failed to attach parent interface to SCVH. Likely SCVH is alraedy "
                            + "dead.");
                }
            }
@@ -496,37 +492,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
        mTag = "SV[" + System.identityHashCode(this) + windowName + "]";
    }

    private void dispatchScvhAttachedToHost() {
        final ViewRootImpl viewRoot = getViewRootImpl();
        if (viewRoot == null) {
            return;
        }

        IBinder inputToken = viewRoot.getInputToken();
        if (inputToken == null) {
            // We don't have an input channel so we can't transfer focus or active
            // touch gestures to embedded.
            return;
        }

        try {
            mSurfacePackage
                    .getRemoteInterface()
                    .onDispatchAttachedToWindow(new InputTransferToken(inputToken));
        } catch (RemoteException e) {
            Log.d(TAG,
                    "Failed to onDispatchAttachedToWindow to SCVH. Likely SCVH is already "
                            + "dead.");
        }
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        setTag();
        if (mSurfacePackage != null) {
            dispatchScvhAttachedToHost();
        }
        getViewRootImpl().addSurfaceChangedCallback(this);
        mWindowStopped = false;
        mViewVisibility = getVisibility() == VISIBLE;
@@ -2220,7 +2189,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            applyTransactionOnVriDraw(transaction);
        }
        mSurfacePackage = p;
        dispatchScvhAttachedToHost();
        mSurfaceControlViewHostParent.attach(this);

        if (isFocused()) {
+2 −3
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@ import static android.view.Surface.FRAME_RATE_CATEGORY_HIGH_HINT;
import static android.view.Surface.FRAME_RATE_CATEGORY_LOW;
import static android.view.Surface.FRAME_RATE_CATEGORY_NORMAL;
import static android.view.Surface.FRAME_RATE_CATEGORY_NO_PREFERENCE;
import static android.view.Surface.FRAME_RATE_COMPATIBILITY_AT_LEAST;
import static android.view.Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE;
import static android.view.Surface.FRAME_RATE_COMPATIBILITY_AT_LEAST;
import static android.view.View.FRAME_RATE_CATEGORY_REASON_BOOST;
import static android.view.View.FRAME_RATE_CATEGORY_REASON_CONFLICTED;
import static android.view.View.FRAME_RATE_CATEGORY_REASON_INTERMITTENT;
@@ -2703,8 +2703,7 @@ public final class ViewRootImpl implements ViewParent,
            mStopped = stopped;
            final ThreadedRenderer renderer = mAttachInfo.mThreadedRenderer;
            if (renderer != null) {
                if (DEBUG_DRAW)
                    Log.d(mTag, "WindowStopped on " + getTitle() + " set to " + mStopped);
                if (DEBUG_DRAW) Log.d(mTag, "WindowStopped on " + getTitle() + " set to " + mStopped);
                renderer.setStopped(mStopped);
            }
            if (!mStopped) {
Loading