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

Commit 49354043 authored by Alex Chau's avatar Alex Chau
Browse files

Return mSynchronouslyBoundPages as getPagesToBindSynchronously between...

Return mSynchronouslyBoundPages as getPagesToBindSynchronously between onInitialBindCompleteand finishBindingItems

- Otherwise it'll return wrong currentPage value, as currentPage aren't updated until finishBindingItems
- There is still problem that wallpaper jumps to page 0 and then to the desired page: https://drive.google.com/file/d/132Sq5oRZKRclhdh1Ls1RaHNEVXJQcrxC/view?usp=sharing&resourcekey=0-l2N9NWtZ8FqfaVT0bVGVqw

Bug: 191657065
Test: manual
Change-Id: I7ec167b617a8f59865e959d9dd677256b1ab4ef9
parent 992fde6a
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2094,8 +2094,16 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche

    @Override
    public IntSet getPagesToBindSynchronously(IntArray orderedScreenIds) {
        IntSet visibleIds = mPagesToBindSynchronously.isEmpty()
                ? mWorkspace.getCurrentPageScreenIds() : mPagesToBindSynchronously;
        IntSet visibleIds;
        if (!mPagesToBindSynchronously.isEmpty()) {
            visibleIds = mPagesToBindSynchronously;
        } else if (!mWorkspaceLoading) {
            visibleIds = mWorkspace.getCurrentPageScreenIds();
        } else {
            // If workspace binding is still in progress, getCurrentPageScreenIds won't be accurate,
            // and we should use mSynchronouslyBoundPages that's set during initial binding.
            visibleIds = mSynchronouslyBoundPages;
        }
        IntArray actualIds = new IntArray();

        IntSet result = new IntSet();