Remove the accessibility focus search tests since these APIs are taken out.

1. In JellyBean we have added some APIs to search for next accessibility
   focus in various directions and set accessibility focus from hover.
   However, we have decided that there is not clean answer for how this
   should behave and the APIs were hidden. Now the accessibility service
   is responsible for that. The unused code is now taken out and some
   CTS tests are obsolete.

bug:6773816

Change-Id: I73e879522e15f11b2b7af94dc9a9c89914e49e59
diff --git a/tests/tests/accessibilityservice/AndroidManifest.xml b/tests/tests/accessibilityservice/AndroidManifest.xml
index 59fc8b0..3f5de30 100644
--- a/tests/tests/accessibilityservice/AndroidManifest.xml
+++ b/tests/tests/accessibilityservice/AndroidManifest.xml
@@ -34,9 +34,6 @@
       <activity android:label="@string/accessibility_view_tree_reporting_test_activity"
               android:name="android.accessibilityservice.cts.AccessibilityViewTreeReportingActivity"/>
 
-      <activity android:label="@string/accessibility_directional_focus_test_activity"
-              android:name="android.accessibilityservice.cts.AccessibilityDirectionalFocusActivity"/>
-
       <activity android:label="@string/accessibility_focus_and_input_focus_sync_test_activity"
               android:name="android.accessibilityservice.cts.AccessibilityFocusAndInputFocusSyncActivity"/>
 
diff --git a/tests/tests/accessibilityservice/res/layout/accessibility_directional_focus_test.xml b/tests/tests/accessibilityservice/res/layout/accessibility_directional_focus_test.xml
deleted file mode 100644
index e28c4ef..0000000
--- a/tests/tests/accessibilityservice/res/layout/accessibility_directional_focus_test.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2012, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    >
-
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        >
-        <Button
-            android:id="@+id/button1"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button1"
-            android:focusable="false"
-        />
-        <Button
-            android:id="@+id/button2"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button2"
-        />
-        <Button
-            android:id="@+id/button3"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button3"
-            android:focusable="false"
-        />
-    </LinearLayout>
-
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        >
-        <Button
-            android:id="@+id/button4"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button4"
-            android:focusable="false"
-        />
-        <Button
-            android:id="@+id/button5"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button5"
-        />
-        <Button
-            android:id="@+id/button6"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button6"
-            android:focusable="false"
-        />
-    </LinearLayout>
-
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        >
-        <Button
-            android:id="@+id/button7"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button7"
-            android:focusable="false"
-        />
-        <Button
-            android:id="@+id/button8"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button8"
-        />
-        <Button
-            android:id="@+id/button9"
-            android:layout_width="160px"
-            android:layout_height="100px"
-            android:text="@string/button9"
-            android:focusable="false"
-        />
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/tests/tests/accessibilityservice/res/values/strings.xml b/tests/tests/accessibilityservice/res/values/strings.xml
index d022ce3..97ddb7c 100644
--- a/tests/tests/accessibilityservice/res/values/strings.xml
+++ b/tests/tests/accessibilityservice/res/values/strings.xml
@@ -119,9 +119,6 @@
     <!-- String second Button text -->
     <string name="secondButton">secondButton</string>
 
-    <!-- String title of the accessibility directional focus test activity -->
-    <string name="accessibility_directional_focus_test_activity">Accessibility directional focus test</string>
-
     <!-- String title of the accessibility focus and input focus sync test activity -->
     <string name="accessibility_focus_and_input_focus_sync_test_activity">Accessibility focus and input focus sync test</string>
 
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityDirectionalFocusActivity.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityDirectionalFocusActivity.java
deleted file mode 100644
index 8e9de56..0000000
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityDirectionalFocusActivity.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.accessibilityservice.cts;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-import com.android.cts.accessibilityservice.R;
-
-/**
- * Activity for testing the accessibility focus APIs exposed to
- * accessibility services. These APIs allow moving accessibility
- * focus in the view tree from an AccessiiblityService. Specifically,
- * this activity is for verifying the directional movement of the
- * accessibility focus.
- */
-public class AccessibilityDirectionalFocusActivity extends Activity {
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.accessibility_directional_focus_test);
-    }
-}
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityDirectionalFocusTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityDirectionalFocusTest.java
deleted file mode 100644
index 00ed991..0000000
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityDirectionalFocusTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.accessibilityservice.cts;
-
-import android.test.suitebuilder.annotation.MediumTest;
-import android.view.View;
-import android.view.accessibility.AccessibilityNodeInfo;
-
-import com.android.cts.accessibilityservice.R;
-
-/**
- * Test cases for testing the accessibility focus APIs exposed to accessibility
- * services. These APIs allow moving accessibility focus in the view tree from
- * an AccessiiblityService. Specifically, this test is for verifying the directional
- * movement of the accessibility focus.
- * <p>
- * Note: The accessibility CTS tests are composed of two APKs, one with delegating
- * accessibility service and another with the instrumented activity and test cases.
- * The delegating service is installed and enabled during test execution. It serves
- * as a proxy to the system used by the tests. This indirection is needed since the
- * test runner stops the package before running the tests. Hence, if the accessibility
- * service is in the test package running the tests would break the binding between
- * the service and the system.  The delegating service is in
- * <strong>CtsDelegatingAccessibilityService.apk</strong> whose source is located at
- * <strong>cts/tests/accessibilityservice</strong>.
- * </p>
- */
-public class AccessibilityDirectionalFocusTest
-        extends AccessibilityActivityTestCase<AccessibilityDirectionalFocusActivity>{
-
-    public AccessibilityDirectionalFocusTest() {
-        super(AccessibilityDirectionalFocusActivity.class);
-    }
-
-    @MediumTest
-    public void testAccessibilityFocusSearchUp() throws Exception {
-        // The the middle button.
-        AccessibilityNodeInfo button5 = getInteractionBridge()
-            .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button5));
-        assertNotNull(button5);
-
-        // Get the first expected node info.
-        AccessibilityNodeInfo firstExpected = getInteractionBridge()
-                .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button2));
-        assertNotNull(firstExpected);
-        // Find the first focusable up.
-        AccessibilityNodeInfo firstReceived = getInteractionBridge().accessibilityFocusSearch(
-                button5, View.ACCESSIBILITY_FOCUS_UP);
-        assertNotNull(firstReceived);
-        // Make sure we got the expected focusable.
-        assertEquals(firstExpected, firstReceived);
-
-        // Should not find another focusable up.
-        AccessibilityNodeInfo secondReceived = getInteractionBridge().accessibilityFocusSearch(
-                firstExpected, View.ACCESSIBILITY_FOCUS_UP);
-        assertNull(secondReceived);
-    }
-
-    @MediumTest
-    public void testAccessibilityFocusSearchDown() throws Exception {
-        // The the middle button.
-        AccessibilityNodeInfo button5 = getInteractionBridge()
-            .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button5));
-        assertNotNull(button5);
-
-        // Get the first expected node info.
-        AccessibilityNodeInfo firstExpected = getInteractionBridge()
-                .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button8));
-        assertNotNull(firstExpected);
-        // Find the first focusable down.
-        AccessibilityNodeInfo firstReceived = getInteractionBridge().accessibilityFocusSearch(
-                button5, View.ACCESSIBILITY_FOCUS_DOWN);
-        assertNotNull(firstReceived);
-        // Make sure we got the expected focusable.
-        assertEquals(firstExpected, firstReceived);
-
-        // Should not find another focusable down.
-        AccessibilityNodeInfo secondReceived = getInteractionBridge().accessibilityFocusSearch(
-                firstExpected, View.ACCESSIBILITY_FOCUS_DOWN);
-        assertNull(secondReceived);
-    }
-
-    @MediumTest
-    public void testAccessibilityFocusSearchLeft() throws Exception {
-        // The the middle button.
-        AccessibilityNodeInfo button5 = getInteractionBridge()
-            .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button5));
-        assertNotNull(button5);
-
-        // Get the first expected node info.
-        AccessibilityNodeInfo firstExpected = getInteractionBridge()
-                .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button4));
-        assertNotNull(firstExpected);
-        // Find the first focusable left.
-        AccessibilityNodeInfo firstReceived = getInteractionBridge().accessibilityFocusSearch(
-                button5, View.ACCESSIBILITY_FOCUS_LEFT);
-        assertNotNull(firstReceived);
-        // Make sure we got the expected focusable.
-        assertEquals(firstExpected, firstReceived);
-
-        // Should not find another focusable left.
-        AccessibilityNodeInfo secondReceived = getInteractionBridge().accessibilityFocusSearch(
-                firstExpected, View.ACCESSIBILITY_FOCUS_LEFT);
-        assertNull(secondReceived);
-    }
-
-    @MediumTest
-    public void testAccessibilityFocusSearchRight() throws Exception {
-        // The the middle button.
-        AccessibilityNodeInfo button5 = getInteractionBridge()
-            .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button5));
-        assertNotNull(button5);
-
-        // Get the first expected node info.
-        AccessibilityNodeInfo firstExpected = getInteractionBridge()
-                .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.button6));
-        assertNotNull(firstExpected);
-        // Find the first focusable right.
-        AccessibilityNodeInfo firstReceived = getInteractionBridge().accessibilityFocusSearch(
-                button5, View.ACCESSIBILITY_FOCUS_RIGHT);
-        assertNotNull(firstReceived);
-        // Make sure we got the expected focusable.
-        assertEquals(firstExpected, firstReceived);
-
-        // Should not find another focusable right.
-        AccessibilityNodeInfo secondReceived = getInteractionBridge().accessibilityFocusSearch(
-                firstExpected, View.ACCESSIBILITY_FOCUS_RIGHT);
-        assertNull(secondReceived);
-    }
-}
diff --git a/tests/tests/view/src/android/view/cts/ViewTest.java b/tests/tests/view/src/android/view/cts/ViewTest.java
index 9065592..4387564 100644
--- a/tests/tests/view/src/android/view/cts/ViewTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewTest.java
@@ -3388,11 +3388,6 @@
         public void childAccessibilityStateChanged(View child) {
 
         }
-
-        @Override
-        public View findViewToTakeAccessibilityFocusFromHover(View child, View descendant) {
-            return null;
-        }
     }
 
     private final class OnCreateContextMenuListenerImpl implements OnCreateContextMenuListener {