Skip to content

Commit 6252a8b

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Fix 5386408: Send accessibility event when a recent app is removed." into ics-mr0
2 parents 50b1534 + 1737776 commit 6252a8b

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;
@@ -512,6 +513,12 @@ public void handleSwipe(View view) {
512513
final ActivityManager am = (ActivityManager)
513514
mContext.getSystemService(Context.ACTIVITY_SERVICE);
514515
am.removeTask(ad.persistentTaskId, ActivityManager.REMOVE_TASK_KILL_PROCESS);
516+
517+
// Accessibility feedback
518+
setContentDescription(
519+
mContext.getString(R.string.accessibility_recents_item_dismissed, ad.getLabel()));
520+
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
521+
setContentDescription(null);
515522
}
516523

517524
private void startApplicationDetailsActivity(String packageName) {

0 commit comments

Comments
 (0)