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

Commit cea7b86d authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Do not re-inflate footer and empty shade views

These views already have a setTextColor and don't need re-inflation when
the theme changes. Doing so would only degrade performance and
introduced a race condition where the text color would be
desynchronized.

Change-Id: I9351c73cc5f54bc47b7d717f22d4da54350008de
Fixes: 80040614
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
Test: set light wallpaper on home and lock screen
Test: set dark wallpaper on home and lock screen
Test: set dark wallpaper on home and light wallpaper on lock screen
Test: change font size in settings app
parent 7f6641b8
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1122,6 +1122,8 @@ public class StatusBar extends SystemUI implements DemoMode,
        mNotificationIconAreaController.onDensityOrFontScaleChanged(mContext);
        mHeadsUpManager.onDensityOrFontScaleChanged();

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

@@ -1150,10 +1152,8 @@ public class StatusBar extends SystemUI implements DemoMode,
        }
    }

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

@@ -1174,7 +1174,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,