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

Commit 616a250b authored by Pat Manning's avatar Pat Manning
Browse files

Shorten app title in overview icon app chip menu.

- Do not show "work" at the beginning of work apps.
- Do not use the top component name in case any dialogs are on top of app.

Fix: 305988810
Fix: 305983272
Fix: 307231916
Test: OverviewImageTest
Flag: ACONFIG com.android.launcher3.enable_overview_icon_menu DEVELOPMENT
Change-Id: I4ce741529c975db778abc540e6c353ea4c76bf11
parent 24231d99
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.quickstep;

import static com.android.launcher3.Flags.enableOverviewIconMenu;
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;

import android.annotation.Nullable;
@@ -119,6 +120,7 @@ public class TaskIconCache implements DisplayInfoChangeListener {
            public void handleResult(TaskCacheEntry result) {
                task.icon = result.icon;
                task.titleDescription = result.contentDescription;
                task.title = result.title;
                callback.accept(task);
                dispatchIconUpdate(task.key.id);
            }
@@ -189,6 +191,10 @@ public class TaskIconCache implements DisplayInfoChangeListener {
        if (activityInfo != null) {
            entry.contentDescription = getBadgedContentDescription(
                    activityInfo, task.key.userId, task.taskDescription);
            if (enableOverviewIconMenu()) {
                entry.title = Utilities.trim(
                        activityInfo.applicationInfo.loadLabel(mContext.getPackageManager()));
            }
        }

        mIconCache.put(task.key, entry);
@@ -275,6 +281,7 @@ public class TaskIconCache implements DisplayInfoChangeListener {
    private static class TaskCacheEntry {
        public Drawable icon;
        public String contentDescription = "";
        public String title = "";
    }

    void registerTaskVisualsChangeListener(TaskVisualsChangeListener newListener) {
+1 −2
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import com.android.launcher3.util.TransformingTouchDelegate;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.TaskIconCache;
import com.android.quickstep.TaskThumbnailCache;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.util.CancellableTask;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.util.SplitSelectStateController;
@@ -170,7 +169,7 @@ public class GroupedTaskView extends TaskView {
                        (task) -> {
                            setIcon(mIconView2, task.icon);
                            if (enableOverviewIconMenu()) {
                                setText(mIconView2, TaskUtils.getTitle(getContext(), task));
                                setText(mIconView2, task.title);
                            }
                            mDigitalWellBeingToast2.initialize(mSecondaryTask);
                            mDigitalWellBeingToast2.setSplitConfiguration(mSplitBoundsConfig);
+1 −1
Original line number Diff line number Diff line
@@ -1094,7 +1094,7 @@ public class TaskView extends FrameLayout implements Reusable {
                        (task) -> {
                            setIcon(mIconView, task.icon);
                            if (enableOverviewIconMenu()) {
                                setText(mIconView, TaskUtils.getTitle(getContext(), task));
                                setText(mIconView, task.title);
                            }
                            mDigitalWellBeingToast.initialize(task);
                        });