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

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

Merge "Reduce lockscreen bottom area on small land screens - legacy support" into main

parents c9d78c6f 676f4151
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.keyguard;

import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
import static android.hardware.biometrics.BiometricSourceType.FINGERPRINT;

import static com.android.keyguard.LockIconView.ICON_FINGERPRINT;
import static com.android.keyguard.LockIconView.ICON_LOCK;
import static com.android.keyguard.LockIconView.ICON_UNLOCK;
@@ -44,6 +45,7 @@ import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -422,7 +424,13 @@ 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
            mWidthPixels -= insets.getSystemWindowInsetLeft() + insets.getSystemWindowInsetRight();
        }
        mHeightPixels = bounds.bottom;
        mBottomPaddingPx = mResources.getDimensionPixelSize(R.dimen.lock_icon_margin_bottom);
        mDefaultPaddingPx = mResources.getDimensionPixelSize(R.dimen.lock_icon_padding);
+13 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardBottomAreaViewModel
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.util.animation.requiresRemeasuring

/**
 * Renders the bottom area of the lock-screen. Concerned primarily with the quick affordance UI
@@ -61,6 +60,7 @@ constructor(
    }

    private var ambientIndicationArea: View? = null
    private var keyguardIndicationArea: View? = null
    private var binding: KeyguardBottomAreaViewBinder.Binding? = null
    private var lockIconViewController: LockIconViewController? = null

@@ -124,8 +124,20 @@ constructor(
    override fun onConfigurationChanged(newConfig: Configuration) {
        super.onConfigurationChanged(newConfig)
        binding?.onConfigurationChanged()

        keyguardIndicationArea?.let {
            val params = it.layoutParams as FrameLayout.LayoutParams
            params.bottomMargin =
                resources.getDimensionPixelSize(R.dimen.keyguard_indication_margin_bottom)
            it.layoutParams = params
        }
    }

    /** Returns a list of animators to use to animate the indication areas. */
    @Deprecated("Deprecated as part of b/278057014")
    val indicationAreaAnimators: List<ViewPropertyAnimator>
        get() = checkNotNull(binding).getIndicationAreaAnimators()

    override fun hasOverlappingRendering(): Boolean {
        return false
    }
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.keyguard;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
import static com.android.systemui.flags.Flags.DOZING_MIGRATION_1;
import static com.android.systemui.flags.Flags.FACE_AUTH_REFACTOR;
import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;
import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
import static com.android.systemui.flags.Flags.MIGRATE_LOCK_ICON;

@@ -146,6 +147,7 @@ public class LockIconViewControllerBaseTest extends SysuiTestCase {
        mFeatureFlags.set(FACE_AUTH_REFACTOR, false);
        mFeatureFlags.set(MIGRATE_LOCK_ICON, false);
        mFeatureFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false);
        mFeatureFlags.set(LOCKSCREEN_ENABLE_LANDSCAPE, false);
        mUnderTest = new LockIconViewController(
                mStatusBarStateController,
                mKeyguardUpdateMonitor,