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

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

Merge "Fix Settings crash"

parents 84d5b194 5184c9b0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -865,6 +865,10 @@ public class ApplicationsState {
        void handleRebuildList() {
            AppFilter filter;
            Comparator<AppEntry> comparator;

            if (!mResumed) {
                return;
            }
            synchronized (mRebuildSync) {
                if (!mRebuildRequested) {
                    return;
@@ -1069,8 +1073,8 @@ public class ApplicationsState {
                }
            }
            if (rebuildingSessions != null) {
                for (int i = 0; i < rebuildingSessions.size(); i++) {
                    rebuildingSessions.get(i).handleRebuildList();
                for (Session session : rebuildingSessions) {
                    session.handleRebuildList();
                }
            }

+14 −1
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ public class ApplicationsStateRoboTest {
    }

    @Test
    public void testDefaultSessionLoadsAll() {
    public void testDefaultSession_isResumed_LoadsAll() {
        mSession.onResume();

        addApp(HOME_PACKAGE_NAME, 1);
@@ -295,6 +295,19 @@ public class ApplicationsStateRoboTest {
        assertThat(launchableEntry.launcherEntryEnabled).isTrue();
    }

    @Test
    public void testDefaultSession_isPaused_NotLoadsAll() {
        mSession.onResume();

        addApp(HOME_PACKAGE_NAME, 1);
        addApp(LAUNCHABLE_PACKAGE_NAME, 2);
        mSession.mResumed = false;
        mSession.rebuild(ApplicationsState.FILTER_EVERYTHING, ApplicationsState.SIZE_COMPARATOR);
        processAllMessages();

        verify(mCallbacks, never()).onRebuildComplete(mAppEntriesCaptor.capture());
    }

    @Test
    public void testCustomSessionLoadsIconsOnly() {
        mSession.setSessionFlags(ApplicationsState.FLAG_SESSION_REQUEST_ICONS);