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

Commit e389f15c authored by Tiger Huang's avatar Tiger Huang
Browse files

Use public types to update system UI visibility

Taskbar is also considered as a navigation bar. While its visibility is
changed, View#dispatchSystemUiVisibilityChanged should be called.

Bug: 225765490
Test: atest WindowInsetsControllerTests
Change-Id: Ie9624211aa6077085966d588c28601000c68a4f2
parent 017ebacd
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@ import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.InputDevice.SOURCE_CLASS_NONE;
import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
import static android.view.InsetsState.ITYPE_STATUS_BAR;
import static android.view.InsetsState.SIZE;
import static android.view.View.PFLAG_DRAW_ANIMATION;
import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN;
@@ -2314,11 +2312,12 @@ public final class ViewRootImpl implements ViewParent,
     */
    void updateCompatSysUiVisibility(@InternalInsetsType int type, boolean visible,
            boolean hasControl) {
        if (type != ITYPE_STATUS_BAR && type != ITYPE_NAVIGATION_BAR) {
        @InsetsType final int publicType = InsetsState.toPublicType(type);
        if (publicType != Type.statusBars() && publicType != Type.navigationBars()) {
            return;
        }
        final SystemUiVisibilityInfo info = mCompatibleVisibilityInfo;
        final int systemUiFlag = type == ITYPE_STATUS_BAR
        final int systemUiFlag = publicType == Type.statusBars()
                ? View.SYSTEM_UI_FLAG_FULLSCREEN
                : View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
        final boolean wasVisible = (info.globalVisibility & systemUiFlag) == 0;