Skip to content

Commit d288337

Browse files
committed
Exception when performing the global gestrue to enable accessibility.
1. If there is a non-speaking accessibility service installed and the global gesture is performed an exception is thrown since an attempt is made to modify the list with services returned by the accessibility manager (to remove the non-speaking ones) but this list is immutable. Now the returned services are put into a mutable list before removing the non-speaking ones. bug:7280996 Change-Id: I2852a3e169c1d34d942b50fb439e0961394c92bc
1 parent 26884df commit d288337

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

policy/src/com/android/internal/policy/impl/EnableAccessibilityController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
import com.android.internal.R;
4242

43+
import java.util.ArrayList;
4344
import java.util.Iterator;
4445
import java.util.List;
4546

@@ -131,8 +132,9 @@ public static boolean canEnableAccessibilityViaGesture(Context context) {
131132

132133
private static List<AccessibilityServiceInfo> getInstalledSpeakingAccessibilityServices(
133134
Context context) {
134-
List<AccessibilityServiceInfo> services = AccessibilityManager.getInstance(
135-
context).getInstalledAccessibilityServiceList();
135+
List<AccessibilityServiceInfo> services = new ArrayList<AccessibilityServiceInfo>();
136+
services.addAll(AccessibilityManager.getInstance(context)
137+
.getInstalledAccessibilityServiceList());
136138
Iterator<AccessibilityServiceInfo> iterator = services.iterator();
137139
while (iterator.hasNext()) {
138140
AccessibilityServiceInfo service = iterator.next();

0 commit comments

Comments
 (0)