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

Commit cec2df62 authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Merging ub-launcher3-qt-dev, build 5456758

Test: Manual

Bug:111142970 Icon display blur in all apps page
Bug:114136250 Have a more spartan RecentsActivity on android go
Bug:122609330 Update PIP animation for swiping up to home
Bug:123985787 Respect dialogCornerRadius for all apps / widgets / settings / shortcut menu / dwb / task / overview (everything)
Bug:126587956 Create an app to use with Launcher testing
Bug:126606858 In multiwindow mode, not able to switch between recent apps.
Bug:127766994 Gray app icons disappeared after completing cable transfer for a while
Bug:127987071 Create a proper contract for specifying default Launcher Layout
Bug:129033091 [Q-Preview] I would like the ability to swipe up anywhere on my screen to open up the app li.
Bug:129297464 [Gesture Nav] Exclude edges from most Launcher / Overview states.
Bug:129434166 Lab-only flake: drag to workspace doesn't happen
Bug:129746879 [Q-Preview] Quick search bar overlaying other app
Bug:129874298 Show different string (Wallpaper vs Style & Wallpaper) on Settings depending on device type
Bug:129947426 nexus launcher crash observed randomly during device boot up(NPE:Attempt to invoke virtual method 'android.app.ActivityManager$RunningTaskInfo com.android.systemui.shared.system.ActivityManagerWrapper.getRunningTask(int)' on a null object reference)
Bug:129976669 Implement returning to home from Widgets in 0-button mode Bug:130027168 Can't tap in nav region on home screen
Bug:130151609 Some tests in MultiDisplaySystemDecorationTests.java failing in pre-submit
Bug:130182878 Pixel launcher crashes on secondary display
Bug:130225926 Cannot unpin app while in gesture nav
Bug:130245920 Icons disappear from launcher when selected
Bug:130272454 [C1/B1] Message app crash when opening a video MMS.
Change-Id: I18aa35d2c75deaf5149358d96d4e1d7f26de2f02
parents fd378d79 5d7694c2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ public final class TaskActionController {
     * @param viewHolder the task view holder to launch
     */
    public void launchTask(TaskHolder viewHolder) {
        if (viewHolder.getTask() == null) {
            return;
        }
        TaskItemView itemView = (TaskItemView) (viewHolder.itemView);
        View v = itemView.getThumbnailView();
        int left = 0;
@@ -60,6 +63,9 @@ public final class TaskActionController {
     * @param viewHolder the task view holder to remove
     */
    public void removeTask(TaskHolder viewHolder) {
        if (viewHolder.getTask() == null) {
            return;
        }
        int position = viewHolder.getAdapterPosition();
        Task task = viewHolder.getTask();
        ActivityManagerWrapper.getInstance().removeTask(task.key.id);
+32 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.quickstep.views.TaskItemView;
import com.android.systemui.shared.recents.model.Task;

import java.util.List;
import java.util.Objects;

/**
 * Recycler view adapter that dynamically inflates and binds {@link TaskHolder} instances with the
@@ -40,6 +41,7 @@ public final class TaskAdapter extends Adapter<TaskHolder> {
    private final TaskListLoader mLoader;
    private final ArrayMap<Integer, TaskItemView> mTaskIdToViewMap = new ArrayMap<>();
    private TaskActionController mTaskActionController;
    private boolean mIsShowingLoadingUi;

    public TaskAdapter(@NonNull TaskListLoader loader) {
        mLoader = loader;
@@ -49,6 +51,18 @@ public final class TaskAdapter extends Adapter<TaskHolder> {
        mTaskActionController = taskActionController;
    }

    /**
     * Sets all positions in the task adapter to loading views, binding new views if necessary.
     * This changes the task adapter's view of the data, so the appropriate notify events should be
     * called in addition to this method to reflect the changes.
     *
     * @param isShowingLoadingUi true to bind loading task views to all positions, false to return
     *                           to the real data
     */
    public void setIsShowingLoadingUi(boolean isShowingLoadingUi) {
        mIsShowingLoadingUi = isShowingLoadingUi;
    }

    /**
     * Get task item view for a given task id if it's attached to the view.
     *
@@ -70,6 +84,10 @@ public final class TaskAdapter extends Adapter<TaskHolder> {

    @Override
    public void onBindViewHolder(TaskHolder holder, int position) {
        if (mIsShowingLoadingUi) {
            holder.bindEmptyUi();
            return;
        }
        List<Task> tasks = mLoader.getCurrentTaskList();
        if (position >= tasks.size()) {
            // Task list has updated.
@@ -79,13 +97,13 @@ public final class TaskAdapter extends Adapter<TaskHolder> {
        holder.bindTask(task);
        mLoader.loadTaskIconAndLabel(task, () -> {
            // Ensure holder still has the same task.
            if (task.equals(holder.getTask())) {
            if (Objects.equals(task, holder.getTask())) {
                holder.getTaskItemView().setIcon(task.icon);
                holder.getTaskItemView().setLabel(task.titleDescription);
            }
        });
        mLoader.loadTaskThumbnail(task, () -> {
            if (task.equals(holder.getTask())) {
            if (Objects.equals(task, holder.getTask())) {
                holder.getTaskItemView().setThumbnail(task.thumbnail.thumbnail);
            }
        });
@@ -93,16 +111,27 @@ public final class TaskAdapter extends Adapter<TaskHolder> {

    @Override
    public void onViewAttachedToWindow(@NonNull TaskHolder holder) {
        if (holder.getTask() == null) {
            return;
        }
        mTaskIdToViewMap.put(holder.getTask().key.id, (TaskItemView) holder.itemView);
    }

    @Override
    public void onViewDetachedFromWindow(@NonNull TaskHolder holder) {
        if (holder.getTask() == null) {
            return;
        }
        mTaskIdToViewMap.remove(holder.getTask().key.id);
    }

    @Override
    public int getItemCount() {
        if (mIsShowingLoadingUi) {
            // Show loading version of all items.
            return MAX_TASKS_TO_DISPLAY;
        } else {
            return Math.min(mLoader.getCurrentTaskList().size(), MAX_TASKS_TO_DISPLAY);
        }
    }
}
+15 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
 */
package com.android.quickstep;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;

import com.android.quickstep.views.TaskItemView;
@@ -50,11 +50,23 @@ public final class TaskHolder extends ViewHolder {
    }

    /**
     * Gets the task currently bound to this view
     * Bind a generic empty UI to the holder to make it clear that the item is loading/unbound and
     * should not be expected to react to user input.
     */
    public void bindEmptyUi() {
        mTask = null;
        // TODO: Set the task view to a loading, empty UI.
        // Temporarily using the one below for visual confirmation but should be swapped out to new
        // UI later.
        mTaskItemView.resetTaskItemView();
    }

    /**
     * Gets the task currently bound to this view. May be null if task holder is in a loading state.
     *
     * @return the current task
     */
    public @NonNull Task getTask() {
    public @Nullable Task getTask() {
        return mTask;
    }
}
+13 −3
Original line number Diff line number Diff line
@@ -67,17 +67,27 @@ public final class TaskListLoader {
        return Collections.unmodifiableList(mTaskList);
    }

    /**
     * Whether or not the loader needs to load data to be up to date. This can return true if the
     * task list is already up to date OR there is already a load in progress for the task list to
     * become up to date.
     *
     * @return true if already up to date or load in progress, false otherwise
     */
    public boolean needsToLoad() {
        return !mRecentsModel.isTaskListValid(mTaskListChangeId);
    }

    /**
     * Fetches the most recent tasks and updates the task list asynchronously. This call does not
     * provide guarantees the task content (icon, thumbnail, label) are loaded but will fill in
     * what it has. May run the callback immediately if there have been no changes in the task
     * list.
     * list since the start of the last load.
     *
     * @param onLoadedCallback callback to run when task list is loaded
     */
    public void loadTaskList(@Nullable Consumer<ArrayList<Task>> onLoadedCallback) {
        if (mRecentsModel.isTaskListValid(mTaskListChangeId)) {
            // Current task list is already up to date. No need to update.
        if (!needsToLoad()) {
            if (onLoadedCallback != null) {
                onLoadedCallback.accept(mTaskList);
            }
+0 −1
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ public class TouchInteractionService extends Service {
            ISystemUiProxy iSystemUiProxy = ISystemUiProxy.Stub
                    .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY));
            mRecentsModel.setSystemUiProxy(iSystemUiProxy);
            mRecentsModel.onInitializeSystemUI(bundle);
        }

        @Override
Loading