Skip to content

Commit 1737776

Browse files
author
Jim Miller
committed
Fix 5386408: Send accessibility event when a recent app is removed.
Change-Id: I7c88eac5d1c5ecaf96e7a0fcfbb8ab6a3d1dbf50
1 parent 63c8a47 commit 1737776

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/SystemUI/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@
305305
<!-- Content description of the ringer silent icon in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
306306
<string name="accessibility_ringer_silent">Ringer silent.</string>
307307

308+
<!-- Content description to tell the user an application has been removed from recents -->
309+
<string name="accessibility_recents_item_dismissed"><xliff:g id="app" example="Calendar">%s</xliff:g> dismissed.</string>
310+
308311
<!-- Title of dialog shown when 2G-3G data usage has exceeded limit and has been disabled. [CHAR LIMIT=48] -->
309312
<string name="data_usage_disabled_dialog_3g_title">2G-3G data disabled</string>
310313
<!-- Title of dialog shown when 4G data usage has exceeded limit and has been disabled. [CHAR LIMIT=48] -->

packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import android.view.MotionEvent;
3939
import android.view.View;
4040
import android.view.ViewGroup;
41+
import android.view.accessibility.AccessibilityEvent;
4142
import android.view.animation.AnimationUtils;
4243
import android.widget.AdapterView;
4344
import android.widget.BaseAdapter;
@@ -511,6 +512,12 @@ public void handleSwipe(View view) {
511512
final ActivityManager am = (ActivityManager)
512513
mContext.getSystemService(Context.ACTIVITY_SERVICE);
513514
am.removeTask(ad.persistentTaskId, ActivityManager.REMOVE_TASK_KILL_PROCESS);
515+
516+
// Accessibility feedback
517+
setContentDescription(
518+
mContext.getString(R.string.accessibility_recents_item_dismissed, ad.getLabel()));
519+
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
520+
setContentDescription(null);
514521
}
515522

516523
private void startApplicationDetailsActivity(String packageName) {

0 commit comments

Comments
 (0)