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

Commit d346a1f1 authored by Jonathon Axford's avatar Jonathon Axford Committed by Android (Google) Code Review
Browse files

Merge "flag guarding getWindowInsets()" into main

parents 28e56025 faf9e70c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -424,11 +424,11 @@ public class LockIconViewController implements Dumpable {
    private void updateConfiguration() {
        WindowManager windowManager = mContext.getSystemService(WindowManager.class);
        Rect bounds = windowManager.getCurrentWindowMetrics().getBounds();
        WindowInsets insets = windowManager.getCurrentWindowMetrics().getWindowInsets();
        mWidthPixels = bounds.right;
        if (mFeatureFlags.isEnabled(Flags.LOCKSCREEN_ENABLE_LANDSCAPE)) {
            // Assumed to be initially neglected as there are no left or right insets in portrait
            // However, on landscape, these insets need to included when calculating the midpoint
            WindowInsets insets = windowManager.getCurrentWindowMetrics().getWindowInsets();
            mWidthPixels -= insets.getSystemWindowInsetLeft() + insets.getSystemWindowInsetRight();
        }
        mHeightPixels = bounds.bottom;
+2 −2
Original line number Diff line number Diff line
@@ -29,11 +29,11 @@ import androidx.constraintlayout.widget.ConstraintSet
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.LockIconView
import com.android.keyguard.LockIconViewController
import com.android.systemui.res.R
import com.android.systemui.biometrics.AuthController
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.keyguard.shared.model.KeyguardSection
import com.android.systemui.res.R
import com.android.systemui.shade.NotificationPanelView
import javax.inject.Inject

@@ -73,11 +73,11 @@ constructor(
        val mBottomPaddingPx =
            context.resources.getDimensionPixelSize(R.dimen.lock_icon_margin_bottom)
        val bounds = windowManager.currentWindowMetrics.bounds
        val insets = windowManager.currentWindowMetrics.windowInsets
        var widthPixels = bounds.right.toFloat()
        if (featureFlags.isEnabled(Flags.LOCKSCREEN_ENABLE_LANDSCAPE)) {
            // Assumed to be initially neglected as there are no left or right insets in portrait.
            // However, on landscape, these insets need to included when calculating the midpoint.
            val insets = windowManager.currentWindowMetrics.windowInsets
            widthPixels -= (insets.systemWindowInsetLeft + insets.systemWindowInsetRight).toFloat()
        }
        val heightPixels = bounds.bottom.toFloat()