Load app content descriptions for Go recents.
Recents Go with icons will use the app's title description as the app
label, so we need this to actually load when we load the task's content
even if accessibility is disabled. This CL puts this behind a static
flag only set to true in recents Go code.
Bug: 114136250
Test: Log that titles/labels are appropriately fetched
Change-Id: I4fe7d8758b3141695a82c0677cec97686c977934
diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
index 12f5360..d7cba39 100644
--- a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
+++ b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
@@ -35,7 +35,8 @@
* Provides recents-related {@link UiFactory} logic and classes.
*/
public abstract class RecentsUiFactory {
-
+
+ public static final boolean GO_LOW_RAM_RECENTS_ENABLED = true;
// Scale recents takes before animating in
private static final float RECENTS_PREPARE_SCALE = 1.33f;
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
index 027fd91..50cc4da 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
@@ -44,6 +44,7 @@
*/
public abstract class RecentsUiFactory {
+ public static final boolean GO_LOW_RAM_RECENTS_ENABLED = false;
private static final AsyncCommand SET_SHELF_HEIGHT_CMD = (visible, height) ->
WindowManagerWrapper.getInstance().setShelfHeight(visible != 0, height);
diff --git a/quickstep/src/com/android/quickstep/TaskIconCache.java b/quickstep/src/com/android/quickstep/TaskIconCache.java
index 612c00e..07af9b3 100644
--- a/quickstep/src/com/android/quickstep/TaskIconCache.java
+++ b/quickstep/src/com/android/quickstep/TaskIconCache.java
@@ -15,6 +15,8 @@
*/
package com.android.quickstep;
+import static com.android.launcher3.uioverrides.RecentsUiFactory.GO_LOW_RAM_RECENTS_ENABLED;
+
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
@@ -24,14 +26,17 @@
import android.os.Looper;
import android.util.LruCache;
import android.view.accessibility.AccessibilityManager;
+
import com.android.launcher3.MainThreadExecutor;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.icons.cache.HandlerRunnable;
+import com.android.launcher3.uioverrides.RecentsUiFactory;
import com.android.launcher3.util.Preconditions;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.TaskKeyLruCache;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+
import java.util.function.Consumer;
/**
@@ -125,8 +130,9 @@
return label;
}
- // Skip loading content descriptions if accessibility is not enabled
- if (!mAccessibilityManager.isEnabled()) {
+ // Skip loading content descriptions if accessibility is disabled unless low RAM recents
+ // is enabled.
+ if (!GO_LOW_RAM_RECENTS_ENABLED && !mAccessibilityManager.isEnabled()) {
return "";
}