Making task view accessibility-stoppable
This is done by associating an accessibility description with it. Bug: 72409756 Test: Touch-explore a task in Overview Change-Id: I988cdc167599406a36c0a3a9bbd0a2ac766ec333
This commit is contained in:
1 parent
f6a8f955ed
commit
4ba5e6046f
2 files changed
+6
-2
No files matched your search
@@ -30,6 +30,7 @@ import android.os.UserHandle;
|
||||
import android.support.annotation.WorkerThread;
|
||||
import android.util.LruCache;
|
||||
import android.util.SparseArray;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
|
||||
import com.android.launcher3.MainThreadExecutor;
|
||||
import com.android.launcher3.R;
|
||||
@@ -85,6 +86,7 @@ public class RecentsModel extends TaskStackChangeListener {
|
||||
private ISystemUiProxy mSystemUiProxy;
|
||||
private boolean mClearAssistCacheOnStackChange = true;
|
||||
private final boolean mPreloadTasksInBackground;
|
||||
private final AccessibilityManager mAccessibilityManager;
|
||||
|
||||
private RecentsModel(Context context) {
|
||||
mContext = context;
|
||||
@@ -111,6 +113,7 @@ public class RecentsModel extends TaskStackChangeListener {
|
||||
|
||||
mTaskChangeId = 1;
|
||||
loadTasks(-1, null);
|
||||
mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
|
||||
}
|
||||
|
||||
public RecentsTaskLoader getRecentsTaskLoader() {
|
||||
@@ -140,7 +143,7 @@ public class RecentsModel extends TaskStackChangeListener {
|
||||
// Preload the plan
|
||||
RecentsTaskLoadPlan loadPlan = new RecentsTaskLoadPlan(mContext);
|
||||
PreloadOptions opts = new PreloadOptions();
|
||||
opts.loadTitles = false;
|
||||
opts.loadTitles = mAccessibilityManager.isEnabled();
|
||||
loadPlan.preloadPlan(opts, mRecentsTaskLoader, taskId, UserHandle.myUserId());
|
||||
// Set the load plan on UI thread
|
||||
mMainThreadExecutor.execute(() -> {
|
||||
@@ -187,7 +190,7 @@ public class RecentsModel extends TaskStackChangeListener {
|
||||
launchOpts.onlyLoadPausedActivities = true;
|
||||
launchOpts.loadThumbnails = true;
|
||||
PreloadOptions preloadOpts = new PreloadOptions();
|
||||
preloadOpts.loadTitles = false;
|
||||
preloadOpts.loadTitles = mAccessibilityManager.isEnabled();
|
||||
plan.preloadPlan(preloadOpts, mRecentsTaskLoader, -1, userId);
|
||||
mRecentsTaskLoader.loadTasks(plan, launchOpts);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user