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

Commit f060cc0a authored by Felix Stern's avatar Felix Stern Committed by Android (Google) Code Review
Browse files

Merge "Return previous visibility in InsetsSourceConsumer if no leash...

Merge "Return previous visibility in InsetsSourceConsumer if no leash available only for IME" into main
parents 7fec56e0 b84d3bea
Loading
Loading
Loading
Loading
+15 −24
Original line number Diff line number Diff line
@@ -310,7 +310,6 @@ public class InsetsSourceConsumer {
        }
        final boolean requestedVisible = (mController.getRequestedVisibleTypes() & mType) != 0;

        if (Flags.refactorInsetsController()) {
        // If we don't have control or the leash (in case of the IME), we enforce the
        // visibility to be hidden, as otherwise we would let the app know too early.
        if (mSourceControl == null) {
@@ -322,9 +321,11 @@ public class InsetsSourceConsumer {
                        WindowInsets.Type.toString(mType), requestedVisible));
            }
            return false;
                // TODO(b/323136120) add a flag to the control, to define whether a leash is needed
            } else if (mId != InsetsSource.ID_IME_CAPTION_BAR
                    && mSourceControl.getLeash() == null) {
        }
        if (Flags.refactorInsetsController()) {
            // TODO(b/323136120) add a flag to the control, to define whether a leash is
            //  needed and make it generic for all types
            if (mId == InsetsSource.ID_IME && mSourceControl.getLeash() == null) {
                if (DEBUG) {
                    Log.d(TAG, TextUtils.formatSimple(
                            "applyLocalVisibilityOverride: Set the source visibility to false, as"
@@ -338,16 +339,6 @@ public class InsetsSourceConsumer {
                // changed state
                return wasVisible;
            }
        } else {
            // If we don't have control, we are not able to change the visibility.
            if (mSourceControl == null) {
                if (DEBUG) {
                    Log.d(TAG, "applyLocalVisibilityOverride: No control in "
                            + mController.getHost().getRootViewTitle()
                            + " requestedVisible=" + requestedVisible);
                }
                return false;
            }
        }
        if (source.isVisible() == requestedVisible) {
            return false;