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

Commit ebe1ba19 authored by Winson Chung's avatar Winson Chung
Browse files

Fixing regression in Recents preloading.

- Changes in the CommandQueue callbacks resulted in the default
  implementation of preloadRecentApps() to be called instead of the
  actual implementation in the Recents component.
- Removing extraneous methods in the interface called from other parts of
  SystemUI.

Bug: 38390446
Test: Launch Recents, ensure that preloading is hit first on touch down on
      the button

Change-Id: I28f7ac47eafa76a53343505f3352760e6510c213
parent ee69756d
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@ import android.view.View;

public interface RecentsComponent {
    void showRecentApps(boolean triggeredFromAltTab, boolean fromHome);
    void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
    void toggleRecents();
    void preloadRecents();
    void showNextAffiliatedTask();
    void showPrevAffiliatedTask();

+2 −7
Original line number Diff line number Diff line
@@ -320,16 +320,11 @@ public class Recents extends SystemUI
        }
    }

    @Override
    public void toggleRecentApps() {
        toggleRecents();
    }

    /**
     * Toggles the Recents activity.
     */
    @Override
    public void toggleRecents() {
    public void toggleRecentApps() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isUserSetup()) {
@@ -366,7 +361,7 @@ public class Recents extends SystemUI
     * Preloads info for the Recents activity.
     */
    @Override
    public void preloadRecents() {
    public void preloadRecentApps() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isUserSetup()) {
+26 −22
Original line number Diff line number Diff line
@@ -433,7 +433,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener

    public void preloadRecents() {
        // Preload only the raw task list into a new load plan (which will be consumed by the
        // RecentsActivity) only if there is a task to animate to.
        // RecentsActivity) only if there is a task to animate to.  Post this to ensure that we
        // don't block the touch feedback on the nav bar button which triggers this.
        mHandler.post(() -> {
            SystemServicesProxy ssp = Recents.getSystemServices();
            MutableBoolean isHomeStackVisible = new MutableBoolean(true);
            if (!ssp.isRecentsActivityVisible(isHomeStackVisible)) {
@@ -447,16 +449,18 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
                loader.preloadTasks(sInstanceLoadPlan, runningTask.id, !isHomeStackVisible.value);
                TaskStack stack = sInstanceLoadPlan.getTaskStack();
                if (stack.getTaskCount() > 0) {
                // Only preload the icon (but not the thumbnail since it may not have been taken for
                // the pausing activity)
                    // Only preload the icon (but not the thumbnail since it may not have been taken
                    // for the pausing activity)
                    preloadIcon(runningTask.id);

                // At this point, we don't know anything about the stack state.  So only calculate
                // the dimensions of the thumbnail that we need for the transition into Recents, but
                // do not draw it until we construct the activity options when we start Recents
                    // At this point, we don't know anything about the stack state.  So only
                    // calculate the dimensions of the thumbnail that we need for the transition
                    // into Recents, but do not draw it until we construct the activity options when
                    // we start Recents
                    updateHeaderBarLayout(stack, null /* window rect override*/);
                }
            }
        });
    }

    public void cancelPreloadingRecents() {