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

Commit 62b8bc04 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not re-inflate footer and empty shade views"

parents 8bb0cc2f cea7b86d
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1130,6 +1130,8 @@ public class StatusBar extends SystemUI implements DemoMode,
        mNotificationIconAreaController.onDensityOrFontScaleChanged(mContext);
        mHeadsUpManager.onDensityOrFontScaleChanged();

        inflateFooterView();
        inflateEmptyShadeView();
        reevaluateStyles();
    }

@@ -1158,10 +1160,8 @@ public class StatusBar extends SystemUI implements DemoMode,
        }
    }

    protected void reevaluateStyles() {
        inflateFooterView();
    private void reevaluateStyles() {
        updateFooter();
        inflateEmptyShadeView();
        updateEmptyShadeView();
    }

@@ -1182,7 +1182,8 @@ public class StatusBar extends SystemUI implements DemoMode,
        mStackScroller.setEmptyShadeView(mEmptyShadeView);
    }

    private void inflateFooterView() {
    @VisibleForTesting
    protected void inflateFooterView() {
        if (mStackScroller == null) {
            return;
        }
+9 −2
Original line number Diff line number Diff line
@@ -597,7 +597,7 @@ public class StatusBarTest extends SysuiTestCase {

    @Test
    public void testInflateFooterView() {
        mStatusBar.reevaluateStyles();
        mStatusBar.inflateFooterView();
        ArgumentCaptor<FooterView> captor = ArgumentCaptor.forClass(FooterView.class);
        verify(mStackScroller).setFooterView(captor.capture());

@@ -661,7 +661,7 @@ public class StatusBarTest extends SysuiTestCase {
    @Test
    public void testUpdateFooter_atEnd() {
        // add footer
        mStatusBar.reevaluateStyles();
        mStatusBar.inflateFooterView();

        // add notification
        ExpandableNotificationRow row = mock(ExpandableNotificationRow.class);
@@ -700,6 +700,13 @@ public class StatusBarTest extends SysuiTestCase {
        assertTrue(mStatusBar.mState == StatusBarState.FULLSCREEN_USER_SWITCHER);
    }

    @Test
    public void testOnDensityOrFontScaleChanged_reInflatesFooterViews() {
        mStatusBar.onDensityOrFontScaleChanged();
        verify(mStackScroller).setFooterView(any());
        verify(mStackScroller).setEmptyShadeView(any());
    }

    static class TestableStatusBar extends StatusBar {
        public TestableStatusBar(StatusBarKeyguardViewManager man,
                UnlockMethodCache unlock, KeyguardIndicationController key,