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

Commit 6472119d authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Apply ForciblyShown WindowLayoutParam flags for Transient Taskbar

Test: Manual
Bug: 278078311
Flag: Not needed
Change-Id: Ia963e45b3b4e6d928b6292b80b73394e76fe2325
parent d5f5a8f3
Loading
Loading
Loading
Loading
+20 −3
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ import android.view.Gravity;
import android.view.RoundedCorner;
import android.view.RoundedCorner;
import android.view.Surface;
import android.view.Surface;
import android.view.View;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.FrameLayout;
import android.widget.Toast;
import android.widget.Toast;
@@ -852,6 +853,21 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
        mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
    }
    }


    /**
     * Applies forcibly show flag to taskbar window iff transient taskbar is unstashed.
     */
    public void applyForciblyShownFlagWhileTransientTaskbarUnstashed(boolean shouldForceShow) {
        if (!DisplayController.isTransientTaskbar(this)) {
            return;
        }
        if (shouldForceShow) {
            mWindowLayoutParams.forciblyShownTypes |= WindowInsets.Type.navigationBars();
        } else {
            mWindowLayoutParams.forciblyShownTypes &= ~WindowInsets.Type.navigationBars();
        }
        notifyUpdateLayoutParams();
    }

    /**
    /**
     * Either adds or removes {@link WindowManager.LayoutParams#FLAG_NOT_FOCUSABLE} on the taskbar
     * Either adds or removes {@link WindowManager.LayoutParams#FLAG_NOT_FOCUSABLE} on the taskbar
     * window. If we're now focusable, also move nav buttons to a separate window above IME.
     * window. If we're now focusable, also move nav buttons to a separate window above IME.
@@ -1053,6 +1069,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {


    /**
    /**
     * Called when we detect a long press in the nav region before passing the gesture slop.
     * Called when we detect a long press in the nav region before passing the gesture slop.
     *
     * @return Whether taskbar handled the long press, and thus should cancel the gesture.
     * @return Whether taskbar handled the long press, and thus should cancel the gesture.
     */
     */
    public boolean onLongPressToUnstashTaskbar() {
    public boolean onLongPressToUnstashTaskbar() {
+1 −0
Original line number Original line Diff line number Diff line
@@ -1097,6 +1097,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
                    TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR,
                    TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR,
                    !hasAnyFlag(FLAG_STASHED_IN_APP_AUTO));
                    !hasAnyFlag(FLAG_STASHED_IN_APP_AUTO));
        }
        }
        mActivity.applyForciblyShownFlagWhileTransientTaskbarUnstashed(!isStashedInApp());
    }
    }


    private void notifyStashChange(boolean visible, boolean stashed) {
    private void notifyStashChange(boolean visible, boolean stashed) {