Bug fix for b/4491376 CTS failure in CtsAccessibilityServiceTestCases. Changed to holo.notitle theme and test code.

Change-Id: Ibeace90f0b266b9d452444a2c4ccef89958b375a
diff --git a/tests/tests/accessibilityservice/AndroidManifest.xml b/tests/tests/accessibilityservice/AndroidManifest.xml
index b4fe6ab..70e1092 100644
--- a/tests/tests/accessibilityservice/AndroidManifest.xml
+++ b/tests/tests/accessibilityservice/AndroidManifest.xml
@@ -19,7 +19,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.android.cts.accessibilityservice">
 
-  <application>
+  <application android:theme="@android:style/Theme.Holo.NoActionBar" >
 
       <uses-library android:name="android.test.runner"/>
 
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
index d0ba659..07812b8 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
@@ -219,13 +219,8 @@
         focusedEvent.setClassName(Button.class.getName());
         focusedEvent.setPackageName(getActivity().getPackageName());
         focusedEvent.getText().add(activity.getString(R.string.button_title));
-        if (hasActivityActionBar()) {
-            focusedEvent.setItemCount(4);
-            focusedEvent.setCurrentItemIndex(3);
-        } else {
-            focusedEvent.setItemCount(3);
-            focusedEvent.setCurrentItemIndex(2);
-        }
+        focusedEvent.setItemCount(3);
+        focusedEvent.setCurrentItemIndex(2);
         focusedEvent.setEnabled(true);
 
         // set expectations
@@ -413,14 +408,6 @@
         throw lastVerifyThrowable;
     }
 
-    /**
-     * @return Whether the activity has action bar.
-     */
-    private boolean hasActivityActionBar() {
-        return (getActivity().getApplicationInfo().targetSdkVersion
-                >= Build.VERSION_CODES.HONEYCOMB);
-    }
-
     static class MockAccessibilityService extends AccessibilityService implements
             ServiceConnection {