Check if accessibility is enabled in test

Bug 6537582

Change-Id: I8753fc0ba081e316c6b90fc618872ed655c72ff1
diff --git a/tests/tests/accessibility/src/android/view/accessibility/cts/AccessibilityManagerTest.java b/tests/tests/accessibility/src/android/view/accessibility/cts/AccessibilityManagerTest.java
index 9732117..28e26ebf 100644
--- a/tests/tests/accessibility/src/android/view/accessibility/cts/AccessibilityManagerTest.java
+++ b/tests/tests/accessibility/src/android/view/accessibility/cts/AccessibilityManagerTest.java
@@ -20,6 +20,7 @@
 import android.app.Service;
 import android.content.pm.ServiceInfo;
 import android.cts.util.PollingCheck;
+import android.provider.Settings;
 import android.test.AndroidTestCase;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityManager;
@@ -44,9 +45,17 @@
     private AccessibilityManager mAccessibilityManager;
 
     @Override
-    public void setUp() {
+    public void setUp() throws Exception {
         mAccessibilityManager = (AccessibilityManager)
             getContext().getSystemService(Service.ACCESSIBILITY_SERVICE);
+
+        assertEquals("Accessibility should have been enabled by the test runner.",
+                1, Settings.Secure.getInt(mContext.getContentResolver(),
+                        Settings.Secure.ACCESSIBILITY_ENABLED));
+
+        assertEquals("Touch exploration should have been enabled by the test runner.",
+                1, Settings.Secure.getInt(mContext.getContentResolver(),
+                        Settings.Secure.TOUCH_EXPLORATION_ENABLED));
     }
 
     public void testAddAndRemoveAccessibilityStateChangeListener() throws Exception {