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
This commit is contained in:
Kevin 2019-02-28 12:15:54 -08:00
parent 9272d0d31b
commit 5a3f7ae764
3 changed files with 11 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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 "";
}