Making clear-all action accessible on a fallback Overview.

Bug: 72222505
Test: Manual
Change-Id: I063081b4fa009882e50852e107490fddae0f86b7
This commit is contained in:
Vadim Tryshev
2018-05-22 11:06:36 -07:00
parent 8417a7b514
commit 783cd3cf21
3 changed files with 38 additions and 2 deletions
@@ -17,6 +17,7 @@
package com.android.quickstep.views;
import static android.widget.Toast.LENGTH_SHORT;
import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA_MULTIPLIER;
import android.animation.Animator;
@@ -116,7 +117,7 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
}
launchTask(true /* animate */);
BaseActivity.fromContext(context).getUserEventDispatcher().logTaskLaunchOrDismiss(
Touch.TAP, Direction.NONE, ((RecentsView) getParent()).indexOfChild(this),
Touch.TAP, Direction.NONE, getRecentsView().indexOfChild(this),
TaskUtils.getComponentKeyForTask(getTask().key));
});
setOutlineProvider(new TaskOutlineProvider(getResources()));
@@ -318,12 +319,14 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
context.getText(menuOption.labelResId)));
}
}
getRecentsView().addTaskAccessibilityActionsExtra(info);
}
@Override
public boolean performAccessibilityAction(int action, Bundle arguments) {
if (action == R.string.accessibility_close_task) {
((RecentsView) getParent()).dismissTask(this, true /*animateTaskView*/,
getRecentsView().dismissTask(this, true /*animateTaskView*/,
true /*removeTask*/);
return true;
}
@@ -339,9 +342,15 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
}
}
if (getRecentsView().performTaskAccessibilityActionExtra(action)) return true;
return super.performAccessibilityAction(action, arguments);
}
private RecentsView getRecentsView() {
return (RecentsView) getParent();
}
public void notifyTaskLaunchFailed(String tag) {
String msg = "Failed to launch task";
if (mTask != null) {