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

Commit 287cdd87 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Check the transient state by using public types" into sc-v2-dev am: 5e68bf3b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15746910

Change-Id: I0578bdc5486b2e3ac182c88f83c32f6b66815daf
parents 32d6d9b1 5e68bf3b
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.view.InsetsState.InternalInsetsType;
import android.view.InternalInsetsAnimationController;
import android.view.SurfaceControl;
import android.view.SyncRtSurfaceTransactionApplier;
import android.view.WindowInsets.Type;
import android.view.WindowInsetsAnimation;
import android.view.WindowInsetsAnimation.Bounds;
import android.view.WindowInsetsAnimationControlListener;
@@ -336,7 +337,7 @@ class InsetsPolicy {

    private @Nullable InsetsControlTarget getStatusControlTarget(@Nullable WindowState focusedWin,
            boolean fake) {
        if (mShowingTransientTypes.indexOf(ITYPE_STATUS_BAR) != -1 && !fake) {
        if (!fake && isShowingTransientTypes(Type.statusBars())) {
            return mDummyControlTarget;
        }
        final WindowState notificationShade = mPolicy.getNotificationShade();
@@ -386,7 +387,7 @@ class InsetsPolicy {
            // Force showing navigation bar while IME is visible.
            return null;
        }
        if (mShowingTransientTypes.indexOf(ITYPE_NAVIGATION_BAR) != -1 && !fake) {
        if (!fake && isShowingTransientTypes(Type.navigationBars())) {
            return mDummyControlTarget;
        }
        if (focusedWin == mPolicy.getNotificationShade()) {
@@ -412,6 +413,16 @@ class InsetsPolicy {
        return focusedWin;
    }

    private boolean isShowingTransientTypes(@Type.InsetsType int types) {
        final IntArray showingTransientTypes = mShowingTransientTypes;
        for (int i = showingTransientTypes.size() - 1; i >= 0; i--) {
            if ((InsetsState.toPublicType(showingTransientTypes.get(i)) & types) != 0) {
                return true;
            }
        }
        return false;
    }

    /**
     * Determines whether the remote insets controller should take control of system bars for all
     * windows.