Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9dc98e3d authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Accessiiblity in right state upon connection of a test agent.

1. Enabling accessibility and disabling all enabled
   accessibility service when a test client connects
   the the AccessibilityManagerService.

Change-Id: I2f40cccaa0035ac1454d8c5ac84678c1542a0229
parent fa59d178
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -441,6 +441,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            if (oldService != null) {
                tryRemoveServiceLocked(oldService);
            }
            // This API is intended for testing so enable accessibility to make
            // sure clients can start poking with the window content.
            Settings.Secure.putInt(mContext.getContentResolver(),
                    Settings.Secure.ACCESSIBILITY_ENABLED, 1);
            // Also disable all accessibility services to avoid interference
            // with the tests.
            Settings.Secure.putString(mContext.getContentResolver(),
                    Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "");
        }
        AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();
        accessibilityServiceInfo.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;