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

Commit 9701174c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "NPVC should uses the top of the DeviceEntryIcon to calc space for notifs" into main

parents 1bfa7255 99b8fd73
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor;
import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.dump.DumpsysTableLogger;
@@ -1825,7 +1826,14 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    /** Returns space between top of lock icon and bottom of NotificationStackScrollLayout. */
    private float getLockIconPadding() {
        float lockIconPadding = 0f;
        if (mLockIconViewController.getTop() != 0f) {
        if (DeviceEntryUdfpsRefactor.isEnabled()) {
            View deviceEntryIconView = mKeyguardViewConfigurator.getKeyguardRootView()
                    .findViewById(R.id.device_entry_icon_view);
            if (deviceEntryIconView != null) {
                lockIconPadding = mNotificationStackScrollLayoutController.getBottom()
                    - deviceEntryIconView.getTop();
            }
        } else if (mLockIconViewController.getTop() != 0f) {
            lockIconPadding = mNotificationStackScrollLayoutController.getBottom()
                    - mLockIconViewController.getTop();
        }
+8 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractorFactory;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.domain.interactor.NaturalScrollingSettingObserver;
import com.android.systemui.keyguard.ui.view.KeyguardRootView;
import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel;
import com.android.systemui.keyguard.ui.viewmodel.GoneToDreamingLockscreenHostedTransitionViewModel;
import com.android.systemui.keyguard.ui.viewmodel.GoneToDreamingTransitionViewModel;
@@ -280,6 +281,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock protected UiEventLogger mUiEventLogger;
    @Mock protected LockIconViewController mLockIconViewController;
    @Mock protected KeyguardViewConfigurator mKeyguardViewConfigurator;
    @Mock protected KeyguardRootView mKeyguardRootView;
    @Mock protected View mKeyguardRootViewChild;
    @Mock protected KeyguardMediaController mKeyguardMediaController;
    @Mock protected NavigationModeController mNavigationModeController;
    @Mock protected NavigationBarController mNavigationBarController;
@@ -389,6 +392,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {

        mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR);
        mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT);
        mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);

        mMainDispatcher = getMainDispatcher();
        KeyguardInteractorFactory.WithDependencies keyguardInteractorDeps =
@@ -835,6 +839,10 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
        when(mNotificationStackScrollLayoutController.getBottom()).thenReturn(stackBottom);
        when(mLockIconViewController.getTop()).thenReturn((float) (stackBottom - lockIconPadding));

        when(mKeyguardRootViewChild.getTop()).thenReturn((int) (stackBottom - lockIconPadding));
        when(mKeyguardRootView.findViewById(anyInt())).thenReturn(mKeyguardRootViewChild);
        when(mKeyguardViewConfigurator.getKeyguardRootView()).thenReturn(mKeyguardRootView);

        when(mResources.getDimensionPixelSize(R.dimen.keyguard_indication_bottom_padding))
                .thenReturn(indicationPadding);
        mNotificationPanelViewController.loadDimens();
+20 −0
Original line number Diff line number Diff line
@@ -203,6 +203,10 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        when(mNotificationStackScrollLayoutController.getShelfHeight()).thenReturn(5);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(5);

        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(5);
    }

    @Test
@@ -216,6 +220,10 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        when(mNotificationStackScrollLayoutController.getShelfHeight()).thenReturn(5);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);

        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
    }

    @Test
@@ -229,6 +237,10 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        when(mNotificationStackScrollLayoutController.getShelfHeight()).thenReturn(5);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);

        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
    }

    @Test
@@ -242,6 +254,10 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        when(mNotificationStackScrollLayoutController.getShelfHeight()).thenReturn(5);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(2);

        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(2);
    }

    @Test
@@ -255,6 +271,10 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        when(mNotificationStackScrollLayoutController.getShelfHeight()).thenReturn(5);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);

        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
    }

    @Test