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

Commit 20bf1d01 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Refactor IWindow#insetsControlChanged to use InsetsSourceControl.Array" into main

parents 9d6f7c05 115f8643
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ oneway interface IWindow {
    /**
     * Called when this window retrieved control over a specified set of insets sources.
     */
    void insetsControlChanged(in InsetsState insetsState, in InsetsSourceControl[] activeControls);
    void insetsControlChanged(in InsetsState insetsState,
            in InsetsSourceControl.Array activeControls);

    /**
     * Called when a set of insets source window should be shown by policy.
+2 −2
Original line number Diff line number Diff line
@@ -11258,10 +11258,10 @@ public final class ViewRootImpl implements ViewParent,
        @Override
        public void insetsControlChanged(InsetsState insetsState,
                InsetsSourceControl[] activeControls) {
                InsetsSourceControl.Array activeControls) {
            final ViewRootImpl viewAncestor = mViewAncestor.get();
            if (viewAncestor != null) {
                viewAncestor.dispatchInsetsControlChanged(insetsState, activeControls);
                viewAncestor.dispatchInsetsControlChanged(insetsState, activeControls.get());
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ public class BaseIWindow extends IWindow.Stub {

    @Override
    public void insetsControlChanged(InsetsState insetsState,
            InsetsSourceControl[] activeControls) {
            InsetsSourceControl.Array activeControls) {
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ public class SystemWindows {

        @Override
        public void insetsControlChanged(InsetsState insetsState,
                InsetsSourceControl[] activeControls) {}
                InsetsSourceControl.Array activeControls) {}

        @Override
        public void showInsets(int types, boolean fromIme, @Nullable ImeTracker.Token statsToken) {}
+7 −2
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ import android.view.IWindowId;
import android.view.InputChannel;
import android.view.InputWindowHandle;
import android.view.InsetsSource;
import android.view.InsetsSourceControl;
import android.view.InsetsState;
import android.view.Surface;
import android.view.Surface.Rotation;
@@ -432,6 +433,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    /** @see #isLastConfigReportedToClient() */
    private boolean mLastConfigReportedToClient;

    // TODO(b/339380439): Ensure to use the same object for IWindowSession#relayout
    private final InsetsSourceControl.Array mLastReportedActiveControls =
            new InsetsSourceControl.Array();

    private final Configuration mTempConfiguration = new Configuration();

    /**
@@ -3813,9 +3818,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
        final InsetsStateController stateController =
                getDisplayContent().getInsetsStateController();
        mLastReportedActiveControls.set(stateController.getControlsForDispatch(this));
        try {
            mClient.insetsControlChanged(getCompatInsetsState(),
                    stateController.getControlsForDispatch(this));
            mClient.insetsControlChanged(getCompatInsetsState(), mLastReportedActiveControls);
        } catch (RemoteException e) {
            Slog.w(TAG, "Failed to deliver inset control state change to w=" + this, e);
        }
Loading