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

Commit 3ae4eb67 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato Committed by Nicolò Mazzucato
Browse files

Get notification panel density from configuration instead of CentralSurfaces

This ensures that the density is correct also if the shade window is moved to another display.

In practise this fixes the scroll speed calculation when the shade is on another display.

Bug: 362719719
Test: NONE trivial bugfix
Flag: com.android.systemui.shade_window_goes_around
Change-Id: Iab31b400a16a97e028d15f25dd612adbdbc03d53
parent 6c74a6cc
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ import com.android.systemui.settings.brightness.domain.interactor.BrightnessMirr
import com.android.systemui.shade.data.repository.FlingInfo;
import com.android.systemui.shade.data.repository.ShadeRepository;
import com.android.systemui.shade.domain.interactor.ShadeAnimationInteractor;
import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.GestureRecorder;
@@ -2269,8 +2270,12 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    }

    float getDisplayDensity() {
        if (ShadeWindowGoesAround.isEnabled()) {
            return mView.getContext().getResources().getConfiguration().densityDpi;
        } else {
            return mCentralSurfaces.getDisplayDensity();
        }
    }

    /** Return whether a touch is near the gesture handle at the bottom of screen */
    boolean isInGestureNavHomeHandleArea(float x, float y) {
@@ -3827,7 +3832,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
                    /* screenOnFromTouch=*/ getWakefulness().isAwakeFromTapOrGesture());
            // Log collapse gesture if on lock screen.
            if (!expand && onKeyguard) {
                float displayDensity = mCentralSurfaces.getDisplayDensity();
                float displayDensity = getDisplayDensity();
                int heightDp = (int) Math.abs((y - mInitialExpandY) / displayDensity);
                int velocityDp = (int) Math.abs(vel / displayDensity);
                mLockscreenGestureLogger.write(MetricsEvent.ACTION_LS_UNLOCK, heightDp, velocityDp);