diff options
author | Kevin <kevhan@google.com> | 2019-02-28 12:15:54 -0800 |
---|---|---|
committer | Kevin <kevhan@google.com> | 2019-03-01 10:43:00 -0800 |
commit | 5a3f7ae764b196a6df370cc4250457584731da05 (patch) | |
tree | 5b4d8ecb87a80c2ace23fe4ebda6f889e9980bcc | |
parent | 9272d0d31bcce5a7f8faf77b44ccbf817d0a96e1 (diff) | |
download | android_packages_apps_Trebuchet-5a3f7ae764b196a6df370cc4250457584731da05.tar.gz android_packages_apps_Trebuchet-5a3f7ae764b196a6df370cc4250457584731da05.tar.bz2 android_packages_apps_Trebuchet-5a3f7ae764b196a6df370cc4250457584731da05.zip |
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
3 files changed, 11 insertions, 3 deletions
diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java index 12f5360c2..d7cba39e3 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 @@ import java.util.ArrayList; * 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 027fd910c..50cc4daed 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 @@ import java.util.ArrayList; */ 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 612c00e1f..07af9b385 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.Handler; 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 @@ public class TaskIconCache { 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 ""; } |