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

Commit 056ee2ad 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:...

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

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

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


    private @Nullable InsetsControlTarget getStatusControlTarget(@Nullable WindowState focusedWin,
    private @Nullable InsetsControlTarget getStatusControlTarget(@Nullable WindowState focusedWin,
            boolean fake) {
            boolean fake) {
        if (mShowingTransientTypes.indexOf(ITYPE_STATUS_BAR) != -1 && !fake) {
        if (!fake && isShowingTransientTypes(Type.statusBars())) {
            return mDummyControlTarget;
            return mDummyControlTarget;
        }
        }
        final WindowState notificationShade = mPolicy.getNotificationShade();
        final WindowState notificationShade = mPolicy.getNotificationShade();
@@ -386,7 +387,7 @@ class InsetsPolicy {
            // Force showing navigation bar while IME is visible.
            // Force showing navigation bar while IME is visible.
            return null;
            return null;
        }
        }
        if (mShowingTransientTypes.indexOf(ITYPE_NAVIGATION_BAR) != -1 && !fake) {
        if (!fake && isShowingTransientTypes(Type.navigationBars())) {
            return mDummyControlTarget;
            return mDummyControlTarget;
        }
        }
        if (focusedWin == mPolicy.getNotificationShade()) {
        if (focusedWin == mPolicy.getNotificationShade()) {
@@ -412,6 +413,16 @@ class InsetsPolicy {
        return focusedWin;
        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
     * Determines whether the remote insets controller should take control of system bars for all
     * windows.
     * windows.