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

Commit 020ca899 authored by Grace Cheng's avatar Grace Cheng Committed by Automerger Merge Worker
Browse files

Merge "Fixes updateOverlayVisibility and updates SideFpsControllerTest for...

Merge "Fixes updateOverlayVisibility and updates SideFpsControllerTest for natural orientation shift" into tm-qpr-dev am: 5bdad5d5 am: b865dc74

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



Change-Id: I60d1448047c37f8aa1f304b77460d4cd57901572
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 20e1a894 b865dc74
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ constructor(
        context.resources.getInteger(android.R.integer.config_mediumAnimTime).toLong()

    private val isReverseDefaultRotation =
        context.getResources().getBoolean(com.android.internal.R.bool.config_reverseDefaultRotation)
        context.resources.getBoolean(com.android.internal.R.bool.config_reverseDefaultRotation)

    private var overlayHideAnimator: ViewPropertyAnimator? = null

@@ -268,10 +268,12 @@ constructor(
        val isDefaultOrientation =
            if (isReverseDefaultRotation) !isNaturalOrientation else isNaturalOrientation
        val size = windowManager.maximumWindowMetrics.bounds

        val displayWidth = if (isDefaultOrientation) size.width() else size.height()
        val displayHeight = if (isDefaultOrientation) size.height() else size.width()
        val boundsWidth = if (isDefaultOrientation) bounds.width() else bounds.height()
        val boundsHeight = if (isDefaultOrientation) bounds.height() else bounds.width()

        val sensorBounds =
            if (overlayOffsets.isYAligned()) {
                Rect(
@@ -297,6 +299,7 @@ constructor(

        overlayViewParams.x = sensorBounds.left
        overlayViewParams.y = sensorBounds.top

        windowManager.updateViewLayout(overlayView, overlayViewParams)
    }

@@ -306,7 +309,12 @@ constructor(
        }
        // hide after a few seconds if the sensor is oriented down and there are
        // large overlapping system bars
        val rotation = context.display?.rotation
        var rotation = context.display?.rotation

        if (rotation != null) {
            rotation = getRotationFromDefault(rotation)
        }

        if (
            windowManager.currentWindowMetrics.windowInsets.hasBigNavigationBar() &&
                ((rotation == Surface.ROTATION_270 && overlayOffsets.isYAligned()) ||
+277 −67

File changed.

Preview size limit exceeded, changes collapsed.