Merge "Folding Accessibility Service sample into ApiDemos." into ics-mr0
diff --git a/build/sdk.atree b/build/sdk.atree
index 5996c9c..0d436c6 100644
--- a/build/sdk.atree
+++ b/build/sdk.atree
@@ -152,7 +152,6 @@
 #
 # PLEASE KEEP THE SAMPLES IN ALPHABETICAL ORDER.
 #
-development/samples/AccessibilityService       samples/${PLATFORM_NAME}/AccessibilityService
 development/samples/AccelerometerPlay          samples/${PLATFORM_NAME}/AccelerometerPlay
 development/samples/ActionBarCompat            samples/${PLATFORM_NAME}/ActionBarCompat
 development/samples/AndroidBeamDemo            samples/${PLATFORM_NAME}/AndroidBeamDemo
diff --git a/samples/AccessibilityService/Android.mk b/samples/AccessibilityService/Android.mk
deleted file mode 100644
index e47b6f6..0000000
--- a/samples/AccessibilityService/Android.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := samples
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := AccessibilityService
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/samples/AccessibilityService/AndroidManifest.xml b/samples/AccessibilityService/AndroidManifest.xml
deleted file mode 100644
index 1b5f794..0000000
--- a/samples/AccessibilityService/AndroidManifest.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Copyright (C) 2010 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.example.android.clockback"
-      android:versionCode="1"
-      android:versionName="1.0">
-
-    <uses-permission android:name="android.permission.VIBRATE" />
-
-    <application android:label="@string/clockback_setup_title">
-
-        <!-- We declare our service here -->
-        <service android:name=".ClockBackService">
-            <!-- This intent filter is a clue for the system that this is an accessibility service -->
-            <intent-filter>
-                <action android:name="android.accessibilityservice.AccessibilityService" />
-            </intent-filter>
-        </service>
-
-    </application>
-
-    <!-- Accessibility API appeared in SDK version 4 (Android 1.6) -->
-    <uses-sdk android:minSdkVersion="4" />
-
-</manifest>
diff --git a/samples/AccessibilityService/_index.html b/samples/AccessibilityService/_index.html
deleted file mode 100644
index d6adbf2..0000000
--- a/samples/AccessibilityService/_index.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<p>
-  This is an example of an accessibility service that provides custom feedback for the Clock application which comes by default with Android devices. It demonstrates the following key features of the Android accessibility APIs:
-</p>
-<ol>
-  <li>
-    Simple demonstration of how to use the accessibility APIs.
-  </li>
-  <li>
-    Hands-on example of various ways to utilize the accessibility API for providing alternative and complementary feedback.
-  </li>
-  <li>
-    Providing application specific feedback &mdash; the service handles only accessibility events from the Clock application.
-  </li>
-  <li>
-    Providing dynamic, context-dependent feedback &mdash; feedback type changes depending on the ringer mode.
-  </li>
-  <li>
-    Application specific UI enhancement &mdash; application domain knowledge is utilized to enhance the provided feedback.
-  </li>
-</ol>
-<p>
-  <strong>
-    Note: This code sample will work only on devices shipped with the default Clock application. If you are
-    running Android 1.6 of Android 2.0 you should enable first ClockBack and then TalkBack since in these
-    releases accessibility services are notified in the order of registration.
-  </strong>
-</p>
-<p>
-  Steps to exercise the ClockBack example:
-</p>
-<ol>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Enable accessibility and all default accessibility services:<br/>
-        Settings &rarr; Accessibility &rarr; select the Accessibility, TalkBack, KickBack, and SoundBack checkboxes
-      </li>
-      <li>
-        <strong>Result:</strong> The system provides spoken, audible, and haptic feedback.
-      </li>
-    </ul>
-  </li>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Explore the feedback provided by the system:<br/>
-        Poke around with the trackball.
-      </li>
-      <li>
-        <strong>Result:</strong> You are somehow familiar with the type of the provided feedback.
-      </li>
-    </ul>
-  </li>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Go to the Clock application and try to change the time of an alarm:<br/>
-        All applications &rarr; Clock &rarr; Alarms (left corner) &rarr; Select an alarm &rarr; Time &mdash; explore the plus, minus buttons, hour and minute edit boxes.
-      </li>
-      <li>
-        <strong>Result:</strong> The hour and minute edit boxes are announced without any clue which is the hour and which is the minute one (you can guess from the arrangement).
-      </li>
-    </ul>
-  </li>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Enable ClockBack:<br>
-        Settings &rarr; Accessibility &rarr; ClockBack &mdash; select the checkbox (assuming you have installed the APK).
-      </li>
-      <li>
-        <strong>Result:</strong> We have active accessibility service for providing application specific feedback for the Clock application.
-      </li>
-    </ul>
-  </li>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Go to the Clock application and try to change the time of an alarm:<br/>
-        All applications &rarr; Clock &rarr; Alarms (left corner) &rarr; Select an alarm &rarr; Time &mdash; explore the hour and minute edit boxes.
-      </li>
-      <li>
-        <strong>Result:</strong> The hour and minute edit boxes are now spoken. This is an example of application specific feedback that utilizes domain information to enhance the user experience.
-      </li>
-    </ul>
-  </li>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Set the ringer to vibration mode and explore the provided feedback:<br/>
-        Use the device button for reducing the ringer volume until it is in vibration mode. Move around the Clock application and outside of that application.
-      </li>
-      <li>
-        <strong>Result:</strong> The Clock application provides custom audible and default haptic feedback. The rest of the system provides the default feedback.
-      </li>
-    </ul>
-  </li>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Set the ringer to muted mode and explore the provided feedback:<br/>
-        Use the device button for reducing the ringer volume until it is in muted mode. Move around the Clock application and outside of that application.
-      </li>
-      <li>
-        <strong>Result:</strong> The Clock application provides only custom haptic feedback. The rest of the system provides the default feedback. Now we are providing custom context dependent feedback based on the device state (ringer mode).
-      </li>
-    </ul>
-  </li>
-  <li>
-    <ul>
-      <li>
-        <strong>Action:</strong> Write an accessibility service:<br/>
-        The <a href="http://code.google.com/p/eyes-free/">Eyes-Free open source project</a> has more accessibility-related resources. To contribute, visit the project page or post to the <a href="http://groups.google.com/group/eyes-free">mailing list</a>.
-      </li>
-      <li>
-        <strong>Result:</strong> One more cool application has been written.
-      </li>
-    </ul>
-  </li>
-</ol>
diff --git a/samples/AccessibilityService/res/values/strings.xml b/samples/AccessibilityService/res/values/strings.xml
deleted file mode 100644
index a9913c2..0000000
--- a/samples/AccessibilityService/res/values/strings.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <!-- VALUES -->
-
-    <!-- Setting up the user interface vibration feedback service -->
-    <string name="clockback_setup_title">ClockBack</string>
-
-    <!-- String value for announcing the increase hours buttons -->
-    <string name="value_increase_hours">Increase hours</string>
-
-    <!-- String value for announcing the increase minutes buttons -->
-    <string name="value_increase_minutes">Increase minutes</string>
-
-    <!-- String value for announcing the decrease hours buttons -->
-    <string name="value_decrease_hours">Decrease hours</string>
-
-    <!-- String value for announcing the decrease minutes buttons -->
-    <string name="value_decrease_minutes">Decrease minutes</string>
-
-    <!-- String value for announcing one hour input -->
-    <string name="value_hour">hour</string>
-
-    <!-- String value for announcing the hours input -->
-    <string name="value_hours">hours</string>
-
-    <!-- String value for announcing one minute input -->
-    <string name="value_minute">minute</string>
-
-    <!-- String value for announcing the minutes input -->
-    <string name="value_minutes">minutes</string>
-
-    <!-- String value for announcing audible ringer mode -->
-    <string name="value_ringer_audible">Ringer audible</string>
-
-    <!-- String value for announcing vibrating ringer mode -->
-    <string name="value_ringer_vibrate">Ringer vibrate</string>
-
-    <!-- String value for announcing silent ringer mode-->
-    <string name="value_ringer_silent">Ringer silent</string>
-
-    <!-- TEMPLATES -->
-
-    <!-- String template for announcing the screen on -->
-    <string name="template_screen_on">Screen on. Volume %1$s percent.</string>
-
-    <!-- String template for announcing the screen off -->
-    <string name="template_screen_off">Screen off. Volume %1$s percent.</string>
-
-</resources>
diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index 97d3ac4..2bda4a7 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -541,8 +541,27 @@
             </intent-filter>
         </activity>
 
+        <!-- ============================ -->
+        <!--  Accessibility examples strings  -->
+        <!-- ============================ -->
+
+        <activity android:name=".accessibility.ClockBackActivity"
+            android:label="@string/accessibility_service">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <service android:name=".accessibility.ClockBackService"
+            android:label="@string/accessibility_service_label">
+            <intent-filter>
+                <action android:name="android.accessibilityservice.AccessibilityService" />
+            </intent-filter>
+        </service>
+
         <activity android:name=".accessibility.TaskListActivity"
-                  android:label="@string/accessibility_taskapp_name"
+                  android:label="@string/accessibility_query_window"
                   android:enabled="@bool/atLeastIceCreamSandwich">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -550,15 +569,16 @@
             </intent-filter>
         </activity>
 
-    <service android:name=".accessibility.TaskBackService"
-             android:label="@string/accessibility_service_label"
-             android:enabled="@bool/atLeastIceCreamSandwich">
-      <intent-filter>
-        <action android:name="android.accessibilityservice.AccessibilityService" />
-      </intent-filter>
-      <meta-data android:name="android.accessibilityservice" android:resource="@xml/taskbackconfig" />
-    </service>
-
+        <service android:name=".accessibility.TaskBackService"
+                 android:label="@string/accessibility_query_window_label"
+                 android:enabled="@bool/atLeastIceCreamSandwich">
+            <intent-filter>
+                <action android:name="android.accessibilityservice.AccessibilityService" />
+            </intent-filter>
+            <meta-data
+                android:name="android.accessibilityservice"
+                android:resource="@xml/taskbackconfig" />
+        </service>
 
         <!-- Instrumentation Samples -->
 
diff --git a/samples/ApiDemos/res/layout/accessibility_service.xml b/samples/ApiDemos/res/layout/accessibility_service.xml
new file mode 100644
index 0000000..169379b
--- /dev/null
+++ b/samples/ApiDemos/res/layout/accessibility_service.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/accessibility_service_instructions"
+        />
+
+    <ImageButton android:id="@+id/button"
+        android:background="@drawable/ic_launcher_settings"
+        android:layout_width="32dip"
+        android:layout_height="32dip"
+        android:layout_marginTop="50dip"
+        android:layout_gravity="center"
+        android:scaleType="fitCenter"
+        android:adjustViewBounds="true" />
+
+</LinearLayout>
diff --git a/samples/ApiDemos/res/layout/tasklist_main.xml b/samples/ApiDemos/res/layout/tasklist_main.xml
index 61a17e3..3226344 100644
--- a/samples/ApiDemos/res/layout/tasklist_main.xml
+++ b/samples/ApiDemos/res/layout/tasklist_main.xml
@@ -19,10 +19,29 @@
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/accessibility_query_window_instructions"
+        />
+
     <com.example.android.apis.accessibility.TaskListView
         android:id="@android:id/list"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:layout_marginTop="50dip"
+        android:layout_marginBottom="50dip"
         android:layout_weight="1"
         android:drawSelectorOnTop="false" />
+
+    <ImageButton android:id="@+id/button"
+        android:background="@drawable/ic_launcher_settings"
+        android:layout_width="32dip"
+        android:layout_height="32dip"
+        android:layout_marginTop="50dip"
+        android:layout_gravity="center"
+        android:scaleType="fitCenter"
+        android:adjustViewBounds="true" />
+
 </LinearLayout>
diff --git a/samples/ApiDemos/res/layout/tasklist_row.xml b/samples/ApiDemos/res/layout/tasklist_row.xml
index 51bb31e..029eb04 100644
--- a/samples/ApiDemos/res/layout/tasklist_row.xml
+++ b/samples/ApiDemos/res/layout/tasklist_row.xml
@@ -19,7 +19,10 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="horizontal"
     android:layout_width="match_parent"
-    android:layout_height="match_parent" android:weightSum="1" android:baselineAligned="false">
+    android:layout_height="match_parent"
+    android:weightSum="1"
+    android:baselineAligned="false">
+
     <TextView android:id="@+id/tasklist_label"
         android:textSize="20dp"
         android:textStyle="bold"
@@ -31,4 +34,5 @@
         android:checked="false" android:layout_height="48dp"
         android:layout_weight=".25"
         android:layout_width="wrap_content" />
+
 </LinearLayout>
diff --git a/samples/AccessibilityService/res/raw/sound_ringer_normal.ogg b/samples/ApiDemos/res/raw/sound_ringer_normal.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_ringer_normal.ogg
rename to samples/ApiDemos/res/raw/sound_ringer_normal.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_ringer_silent.ogg b/samples/ApiDemos/res/raw/sound_ringer_silent.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_ringer_silent.ogg
rename to samples/ApiDemos/res/raw/sound_ringer_silent.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_ringer_vibrate.ogg b/samples/ApiDemos/res/raw/sound_ringer_vibrate.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_ringer_vibrate.ogg
rename to samples/ApiDemos/res/raw/sound_ringer_vibrate.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_screen_off.ogg b/samples/ApiDemos/res/raw/sound_screen_off.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_screen_off.ogg
rename to samples/ApiDemos/res/raw/sound_screen_off.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_screen_on.ogg b/samples/ApiDemos/res/raw/sound_screen_on.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_screen_on.ogg
rename to samples/ApiDemos/res/raw/sound_screen_on.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_view_clicked.ogg b/samples/ApiDemos/res/raw/sound_view_clicked.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_view_clicked.ogg
rename to samples/ApiDemos/res/raw/sound_view_clicked.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_view_focused_or_selected.ogg b/samples/ApiDemos/res/raw/sound_view_focused_or_selected.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_view_focused_or_selected.ogg
rename to samples/ApiDemos/res/raw/sound_view_focused_or_selected.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_screen_on.ogg b/samples/ApiDemos/res/raw/sound_view_hover_enter.ogg
similarity index 100%
copy from samples/AccessibilityService/res/raw/sound_screen_on.ogg
copy to samples/ApiDemos/res/raw/sound_view_hover_enter.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_window_state_changed.ogg b/samples/ApiDemos/res/raw/sound_window_state_changed.ogg
similarity index 100%
rename from samples/AccessibilityService/res/raw/sound_window_state_changed.ogg
rename to samples/ApiDemos/res/raw/sound_window_state_changed.ogg
Binary files differ
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index 1dfc1bb..b1a57b0 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -1291,13 +1291,37 @@
     <!--  Accessibility examples strings  -->
     <!-- ============================ -->
 
+    <string name="accessibility_service">Accessibility/Accessibility Service</string>
+    <string name="accessibility_service_label">ClockBack</string>
+    <string name="accessibility_service_instructions">
+        1. Enable TalkBack (Settings -> Accessibility -> TalkBack).
+        \n\n2. Enable Explore-byTouch (Settings -> Accessibility -> Explore by Touch).
+        \n\n3. Touch explore the Clock application and the home screen.
+        \n\n4. Go to the Clock application and change the time of an alarm.
+        \n\n5. Enable ClockBack (Settings -> Accessibility -> ClockBack).
+        \n\n6. Go to the Clock application and change an alarm.
+        \n\n7. Set the ringer to vibration mode and change an alarm.
+        \n\n8. Set the ringer to muted mode and change an alarm.
+    </string>
 
-    <string name="accessibility_taskapp_name">Accessibility/Accessibility Node Querying</string>
-    <string name="accessibility_service_description">Task App Accessibility Service</string>
-    <string name="accessibility_service_label">TaskBack</string>
+    <string name="value_ringer_audible">Ringer audible</string>
+    <string name="value_ringer_vibrate">Ringer vibrate</string>
+    <string name="value_ringer_silent">Ringer silent</string>
+    <string name="template_screen_on">Screen on. Volume %1$s percent.</string>
+    <string name="template_screen_off">Screen off. Volume %1$s percent.</string>
+
+    <string name="accessibility_query_window">Accessibility/Accessibility Node Querying</string>
+    <string name="accessibility_query_window_label">QueryBack</string>
+    <string name="accessibility_query_window_description">Task App Accessibility Service</string>
+    <string name="accessibility_query_window_instructions">
+        1. Enable QueryBack (Settings -> Accessibility -> QueryBack).
+        \n\n2. Enable Explore-byTouch (Settings -> Accessibility -> Explore by Touch).
+        \n\n3. Touch explore the list.
+    </string>
 
     <string name="task_name">Task</string>
     <string name="task_complete_template">Task %1$s %2$s</string>
     <string name="task_complete">is complete</string>
     <string name="task_not_complete">is not complete</string>
+
   </resources>
diff --git a/samples/ApiDemos/res/xml/taskbackconfig.xml b/samples/ApiDemos/res/xml/taskbackconfig.xml
index 02ff11c..5dc0cf5 100644
--- a/samples/ApiDemos/res/xml/taskbackconfig.xml
+++ b/samples/ApiDemos/res/xml/taskbackconfig.xml
@@ -15,11 +15,10 @@
   limitations under the License.
  -->
 
-    <accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
-        android:accessibilityEventTypes="typeViewClicked|typeViewFocused"
-        android:packageNames="com.example.android.apis"
-        android:accessibilityFeedbackType="feedbackSpoken"
-        android:notificationTimeout="100"
-        android:accessibilityFlags="flagDefault"
-        android:canRetrieveWindowContent="true"
-        android:description="@string/accessibility_service_description" />
+<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:accessibilityEventTypes="typeAllMask"
+    android:packageNames="com.example.android.apis"
+    android:accessibilityFeedbackType="feedbackSpoken"
+    android:notificationTimeout="100"
+    android:canRetrieveWindowContent="true"
+    android:description="@string/accessibility_query_window_description" />
diff --git a/samples/ApiDemos/src/com/example/android/apis/accessibility/ClockBackActivity.java b/samples/ApiDemos/src/com/example/android/apis/accessibility/ClockBackActivity.java
new file mode 100644
index 0000000..75fb1ff
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/accessibility/ClockBackActivity.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2011 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 com.example.android.apis.accessibility;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.view.View;
+import android.widget.ImageButton;
+
+import com.example.android.apis.R;
+
+/**
+ * This is the entry activity for a sample that demonstrates how to implement an
+ * {@link android.accessibilityservice.AccessibilityService}.
+ */
+public class ClockBackActivity extends Activity {
+
+    /** An intent for launching the system settings. */
+    private static final Intent sSettingsIntent =
+        new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.accessibility_service);
+
+        // Add a shortcut to the accessibility settings.
+        ImageButton button = (ImageButton) findViewById(R.id.button);
+        button.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startActivity(sSettingsIntent);
+            }
+        });
+    }
+}
diff --git a/samples/AccessibilityService/src/com/example/android/clockback/ClockBackService.java b/samples/ApiDemos/src/com/example/android/apis/accessibility/ClockBackService.java
similarity index 74%
rename from samples/AccessibilityService/src/com/example/android/clockback/ClockBackService.java
rename to samples/ApiDemos/src/com/example/android/apis/accessibility/ClockBackService.java
index 5746716..d5cd2a3 100644
--- a/samples/AccessibilityService/src/com/example/android/clockback/ClockBackService.java
+++ b/samples/ApiDemos/src/com/example/android/apis/accessibility/ClockBackService.java
@@ -14,7 +14,9 @@
  * limitations under the License.
  */
 
-package com.example.android.clockback;
+package com.example.android.apis.accessibility;
+
+import com.example.android.apis.R;
 
 import android.accessibilityservice.AccessibilityService;
 import android.accessibilityservice.AccessibilityServiceInfo;
@@ -54,19 +56,7 @@
  *     Providing dynamic, context-dependent feedback &mdash; feedback type changes
  *     depending on the ringer state.
  *   </li>
- *   <li>
- *     Application specific UI enhancement - application domain knowledge is
- *     utilized to enhance the provided feedback.
- *   </li>
  * </ol>
- * <p>
- *   <strong>
- *     Note: This code sample will work only on devices shipped with the default Clock
- *     application. If you are running Android 1.6 of Android 2.0 you should enable first
- *     ClockBack and then TalkBack since in these releases accessibility services are
- *     notified in the order of registration.
- *   </strong>
- * </p>
  */
 public class ClockBackService extends AccessibilityService {
 
@@ -147,56 +137,6 @@
     /** The space string constant. */
     private static final String SPACE = " ";
 
-    /**
-     * The class name of the number picker buttons with no text we want to
-     * announce in the Clock application.
-     */
-    private static final String CLASS_NAME_NUMBER_PICKER_BUTTON_CLOCK = "android.widget.NumberPickerButton";
-
-    /**
-     * The class name of the number picker buttons with no text we want to
-     * announce in the AlarmClock application.
-     */
-    private static final String CLASS_NAME_NUMBER_PICKER_BUTTON_ALARM_CLOCK = "com.android.internal.widget.NumberPickerButton";
-
-    /**
-     * The class name of the edit text box for hours and minutes we want to
-     * better announce.
-     */
-    private static final String CLASS_NAME_EDIT_TEXT = "android.widget.EditText";
-
-    /**
-     * Mapping from integer to string resource id where the keys are generated
-     * from the {@link AccessibilityEvent#getText()},
-     * {@link AccessibilityEvent#getItemCount()} and
-     * {@link AccessibilityEvent#getCurrentItemIndex()} properties.
-     * <p>
-     * Note: In general, computing these mappings includes the widget position on
-     * the screen. This is fragile and should be used as a last resort since
-     * changing the layout could potentially change the widget position. This is
-     * a workaround since the widgets of interest are image buttons that do not
-     * have contentDescription attribute set (plus/minus buttons) or no other
-     * information in the accessibility event is available to distinguish them
-     * aside of their positions on the screen (hour/minute inputs).<br/>
-     * If you are owner of the target application (Clock in this case) you
-     * should add contentDescription attribute to all image buttons such that a
-     * screen reader knows how to speak them. For input fields (while not
-     * applicable for the hour and minute inputs since they are not empty) a
-     * hint text should be set to enable better announcement.
-     * </p>
-     */
-    private static final SparseArray<Integer> sEventDataMappedStringResourceIds = new SparseArray<Integer>();
-    static {
-        sEventDataMappedStringResourceIds.put(110, R.string.value_increase_hours);
-        sEventDataMappedStringResourceIds.put(1140, R.string.value_increase_minutes);
-        sEventDataMappedStringResourceIds.put(1120, R.string.value_decrease_hours);
-        sEventDataMappedStringResourceIds.put(1160, R.string.value_decrease_minutes);
-        sEventDataMappedStringResourceIds.put(1111, R.string.value_hour);
-        sEventDataMappedStringResourceIds.put(1110, R.string.value_hours);
-        sEventDataMappedStringResourceIds.put(1151, R.string.value_minute);
-        sEventDataMappedStringResourceIds.put(1150, R.string.value_minutes);
-    }
-
     /** Mapping from integers to vibration patterns for haptic feedback. */
     private static final SparseArray<long[]> sVibrationPatterns = new SparseArray<long[]>();
     static {
@@ -215,6 +155,9 @@
         sVibrationPatterns.put(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, new long[] {
                 0L, 25L, 50L, 25L, 50L, 25L
         });
+        sVibrationPatterns.put(AccessibilityEvent.TYPE_VIEW_HOVER_ENTER, new long[] {
+                0L, 15L, 10L, 15L, 15L, 10L
+        });
         sVibrationPatterns.put(INDEX_SCREEN_ON, new long[] {
                 0L, 10L, 10L, 20L, 20L, 30L
         });
@@ -226,11 +169,18 @@
     /** Mapping from integers to raw sound resource ids. */
     private static SparseArray<Integer> sSoundsResourceIds = new SparseArray<Integer>();
     static {
-        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_CLICKED, R.raw.sound_view_clicked);
-        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED, R.raw.sound_view_clicked);
-        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_SELECTED, R.raw.sound_view_focused_or_selected);
-        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_FOCUSED, R.raw.sound_view_focused_or_selected);
-        sSoundsResourceIds.put(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, R.raw.sound_window_state_changed);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_CLICKED,
+                R.raw.sound_view_clicked);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED,
+                R.raw.sound_view_clicked);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_SELECTED,
+                R.raw.sound_view_focused_or_selected);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_FOCUSED,
+                R.raw.sound_view_focused_or_selected);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED,
+                R.raw.sound_window_state_changed);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_HOVER_ENTER,
+                R.raw.sound_view_hover_enter);
         sSoundsResourceIds.put(INDEX_SCREEN_ON, R.raw.sound_screen_on);
         sSoundsResourceIds.put(INDEX_SCREEN_OFF, R.raw.sound_screen_off);
         sSoundsResourceIds.put(INDEX_RINGER_SILENT, R.raw.sound_ringer_silent);
@@ -304,7 +254,9 @@
                 case MESSAGE_VIBRATE:
                     int key = message.arg1;
                     long[] pattern = sVibrationPatterns.get(key);
-                    mVibrator.vibrate(pattern, -1);
+                    if (pattern != null) {
+                        mVibrator.vibrate(pattern, -1);
+                    }
                     return;
                 case MESSAGE_STOP_VIBRATE:
                     mVibrator.cancel();
@@ -473,12 +425,6 @@
      *             Let some other services provide audible feedback (SounBack) and haptic
      *             feedback (KickBack).
      * </p>
-     * Note: In the above description an assumption is made that all default feedback
-     *       services are enabled. Such services are TalkBack, SoundBack, and KickBack.
-     *       Also the feature of defining a service as the default for a given feedback
-     *       type will be available in Android 2.2 and above. For previous releases the package
-     *       specific accessibility service must be registered first i.e. checked in the
-     *       settings.
      *
      * @param ringerMode The device ringer mode.
      */
@@ -593,19 +539,6 @@
                 utterance.append(SPACE);
             }
 
-            // Here we do a bit of enhancement of the UI presentation by using the semantic
-            // of the event source in the context of the Clock application.
-            if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED
-                    && CLASS_NAME_EDIT_TEXT.equals(event.getClassName())) {
-                // If the source is an edit text box and we have a mapping based on
-                // its position in the items of the container parent of the event source
-                // we append that value as well. We say "XX hours" and "XX minutes".
-                String resourceValue = getEventDataMappedStringResource(event);
-                if (resourceValue != null) {
-                    utterance.append(resourceValue);
-                }
-            }
-
             return utterance.toString();
         }
 
@@ -617,71 +550,10 @@
             return utterance.toString();
         }
 
-        // No text and content description for the plus and minus buttons, so we lookup
-        // custom values based on the event's itemCount and currentItemIndex properties.
-        CharSequence className = event.getClassName();
-
-        if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED
-                && (CLASS_NAME_NUMBER_PICKER_BUTTON_ALARM_CLOCK.equals(className)
-                || CLASS_NAME_NUMBER_PICKER_BUTTON_CLOCK.equals(className))) {
-            String resourceValue = getEventDataMappedStringResource(event);
-            utterance.append(resourceValue);
-        }
-
         return utterance.toString();
     }
 
     /**
-     * Returns a string resource mapped based on the accessibility event
-     * data, specifically the
-     * {@link AccessibilityEvent#getText()},
-     * {@link AccessibilityEvent#getItemCount()}, and
-     * {@link AccessibilityEvent#getCurrentItemIndex()} properties.
-     *
-     * @param event The {@link AccessibilityEvent} to process.
-     * @return The mapped string if such exists, null otherwise.
-     */
-    private String getEventDataMappedStringResource(AccessibilityEvent event) {
-        int lookupIndex = computeLookupIndex(event);
-        int resourceId = sEventDataMappedStringResourceIds.get(lookupIndex);
-        return getString(resourceId);
-    }
-
-    /**
-     * Computes an index for looking up the custom text for views which either
-     * do not have text/content description or the position information
-     * is the only oracle for deciding from which widget was an accessibility
-     * event generated. The index is computed based on
-     * {@link AccessibilityEvent#getText()},
-     * {@link AccessibilityEvent#getItemCount()}, and
-     * {@link AccessibilityEvent#getCurrentItemIndex()} properties.
-     *
-     * @param event The event from which to compute the index.
-     * @return The lookup index.
-     */
-    private int computeLookupIndex(AccessibilityEvent event) {
-        int lookupIndex = event.getItemCount();
-        int divided = event.getCurrentItemIndex();
-
-        while (divided > 0) {
-            lookupIndex *= 10;
-            divided /= 10;
-        }
-
-        lookupIndex += event.getCurrentItemIndex();
-        lookupIndex *= 10;
-
-        // This is primarily for handling the zero hour/zero minutes cases
-        if (!event.getText().isEmpty()
-                && ("1".equals(event.getText().get(0).toString()) || "01".equals(event.getText()
-                        .get(0).toString()))) {
-            lookupIndex++;
-        }
-
-        return lookupIndex;
-    }
-
-    /**
      * Plays an earcon given its id.
      *
      * @param earconId The id of the earcon to be played.
@@ -690,10 +562,12 @@
         String earconName = mEarconNames.get(earconId);
         if (earconName == null) {
             // We do not know the sound id, hence we need to load the sound.
-            int resourceId = sSoundsResourceIds.get(earconId);
-            earconName = "[" + earconId + "]";
-            mTts.addEarcon(earconName, getPackageName(), resourceId);
-            mEarconNames.put(earconId, earconName);
+            Integer resourceId = sSoundsResourceIds.get(earconId);
+            if (resourceId != null) {
+                earconName = "[" + earconId + "]";
+                mTts.addEarcon(earconName, getPackageName(), resourceId);
+                mEarconNames.put(earconId, earconName);
+            }
         }
 
         mTts.playEarcon(earconName, QUEUING_MODE_INTERRUPT, null);
diff --git a/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskBackService.java b/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskBackService.java
index dbbfe3a..c7088be 100644
--- a/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskBackService.java
+++ b/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskBackService.java
@@ -19,6 +19,7 @@
 import com.example.android.apis.R;
 
 import android.accessibilityservice.AccessibilityService;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
@@ -28,26 +29,40 @@
 
 import java.util.Locale;
 
-/** The TaskBackService listens for AccessibilityEvents, and turns them into information it can
- *  communicate to the user with speech.
+/**
+ * This class demonstrates how an accessibility service can query
+ * window content to improve the feedback given to the user.
  */
 public class TaskBackService extends AccessibilityService implements OnInitListener {
 
-    private final String LOG_TAG = "TaskBackService/onAccessibilityEvent";
-    private boolean mTextToSpeechInitialized = false;
-    private TextToSpeech mTts = null;
+    /** Tag for logging. */
+    private static final String LOG_TAG = "TaskBackService/onAccessibilityEvent";
+
+    /** Comma separator. */
     private static final String SEPARATOR = ", ";
 
+    /** The class name of TaskListView - for simplicity we speak only its items. */
+    private static final String TASK_LIST_VIEW_CLASS_NAME =
+        "com.example.android.apis.accessibility.TaskListView";
 
+    /** Flag whether Text-To-Speech is initialized. */
+    private boolean mTextToSpeechInitialized;
 
-    /** Initializes the Text-To-Speech engine as soon as the service is connected. */
+    /** Handle to the Text-To-Speech engine. */
+    private TextToSpeech mTts;
+
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void onServiceConnected() {
+        // Initializes the Text-To-Speech engine as soon as the service is connected.
         mTts = new TextToSpeech(getApplicationContext(), this);
     }
 
-    /** Processes an AccessibilityEvent, by traversing the View's tree and putting together a
-     *  message to speak to the user.
+    /**
+     * Processes an AccessibilityEvent, by traversing the View's tree and
+     * putting together a message to speak to the user.
      */
     @Override
     public void onAccessibilityEvent(AccessibilityEvent event) {
@@ -56,55 +71,49 @@
             return;
         }
 
-        int eventType = event.getEventType();
-        if (eventType != AccessibilityEvent.TYPE_VIEW_CLICKED) {
+        // This AccessibilityNodeInfo represents the view that fired the
+        // AccessibilityEvent. The following code will use it to traverse the
+        // view hierarchy, using this node as a starting point.
+        //
+        // NOTE: Every method that returns an AccessibilityNodeInfo may return null,
+        // because the explored window is in another process and the
+        // corresponding View might be gone by the time your request reaches the
+        // view hierarchy.
+        AccessibilityNodeInfo source = event.getSource();
+        if (source == null) {
             return;
         }
 
-        /* This AccessibilityNodeInfo represents the view that fired the
-         * AccessibilityEvent.  The following code will use it to traverse
-         * the view hierarchy, using this node as a starting point.
-         */
-        AccessibilityNodeInfo entryNode = event.getSource();
-
-        /* Every method that returns an AccessibilityNodeInfo may return null,
-         * because the explored window is in another process and the corresponding
-         * View might be gone by the time your request reaches the view hierarchy."
-         */
-        if (entryNode == null) {
-          return;
-        }
         // Grab the parent of the view that fired the event.
-        AccessibilityNodeInfo rowNode = entryNode.getParent();
-
+        AccessibilityNodeInfo rowNode = getListItemNodeInfo(source);
         if (rowNode == null) {
-          return;
+            return;
         }
 
-        /* Using this parent, get references to both child nodes,
-         * the label and the checkbox.
-         */
+        // Using this parent, get references to both child nodes, the label and the checkbox.
         AccessibilityNodeInfo labelNode = rowNode.getChild(0);
-        AccessibilityNodeInfo completeNode = rowNode.getChild(1);
-
-        if (labelNode == null || completeNode == null) {
-          return;
+        if (labelNode == null) {
+            rowNode.recycle();
+            return;
         }
 
-        /* Using these to determine what the task is and whether or not
-         * it's complete, based on the text inside the label, and the state
-         * of the checkbox.
-         */
+        AccessibilityNodeInfo completeNode = rowNode.getChild(1);
+        if (completeNode == null) {
+            rowNode.recycle();
+            return;
+        }
 
-        // Quick check to make sure we're not in the ApiDemos nav.
+        // Determine what the task is and whether or not it's complete, based on
+        // the text inside the label, and the state of the check-box.
         if (rowNode.getChildCount() < 2 || !rowNode.getChild(1).isCheckable()) {
+            rowNode.recycle();
             return;
         }
 
         CharSequence taskLabel = labelNode.getText();
-        boolean isComplete = completeNode.isChecked();
+        final boolean isComplete = completeNode.isChecked();
 
-        String completeStr = null;;
+        String completeStr = null;
         if (isComplete) {
             completeStr = getString(R.string.task_complete);
         } else {
@@ -112,44 +121,66 @@
         }
 
         String taskStr = getString(R.string.task_complete_template, taskLabel, completeStr);
-        StringBuilder forSpeech = new StringBuilder(taskStr);
+        StringBuilder utterance = new StringBuilder(taskStr);
 
-        /* The custom listview added extra context to the event by adding
-         * an AccessibilityRecord to it.  Extract that from the event and read it.
-         */
-        int records = event.getRecordCount();
-
+        // The custom ListView added extra context to the event by adding an
+        // AccessibilityRecord to it. Extract that from the event and read it.
+        final int records = event.getRecordCount();
         for (int i = 0; i < records; i++) {
             AccessibilityRecord record = event.getRecord(i);
             CharSequence contentDescription = record.getContentDescription();
-            if (contentDescription != null) {
-                forSpeech.append(SEPARATOR).append(contentDescription);
+            if (!TextUtils.isEmpty(contentDescription )) {
+                utterance.append(SEPARATOR);
+                utterance.append(contentDescription);
             }
         }
 
-        /* Speak the forSpeech string to the user.  QUEUE_ADD adds the string to the end of the
-         * queue, QUEUE_FLUSH would interrupt whatever was currently being said.
-         */
-        mTts.speak(forSpeech.toString() ,  TextToSpeech.QUEUE_ADD, null);
-        Log.d(LOG_TAG, forSpeech.toString());
+        // Announce the utterance.
+        mTts.speak(utterance.toString(), TextToSpeech.QUEUE_FLUSH, null);
+        Log.d(LOG_TAG, utterance.toString());
     }
 
-    @Override
-    public void onInterrupt() {
-      /* do nothing */
+    private AccessibilityNodeInfo getListItemNodeInfo(AccessibilityNodeInfo source) {
+        AccessibilityNodeInfo current = source;
+        while (true) {
+            AccessibilityNodeInfo parent = current.getParent();
+            if (parent == null) {
+                return null;
+            }
+            if (TASK_LIST_VIEW_CLASS_NAME.equals(parent.getClassName())) {
+                return current;
+            }
+            // NOTE: Recycle the infos.
+            AccessibilityNodeInfo oldCurrent = current;
+            current = parent;
+            oldCurrent.recycle();
+        }
     }
 
-    /** Sets a flag so that the TaskBackService knows that the Text-To-Speech engine has been
-     *  initialized, and can now handle speaking requests.
+    /**
+     * {@inheritDoc}
      */
     @Override
-    public void onInit (int status) {
+    public void onInterrupt() {
+        /* do nothing */
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onInit(int status) {
+        // Set a flag so that the TaskBackService knows that the Text-To-Speech
+        // engine has been initialized, and can now handle speaking requests.
         if (status == TextToSpeech.SUCCESS) {
             mTts.setLanguage(Locale.US);
             mTextToSpeechInitialized = true;
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void onDestroy() {
         super.onDestroy();
diff --git a/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskListActivity.java b/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskListActivity.java
index bbc1403..4f7f384 100644
--- a/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskListActivity.java
+++ b/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskListActivity.java
@@ -19,18 +19,26 @@
 import com.example.android.apis.R;
 
 import android.app.ListActivity;
+import android.content.Intent;
 import android.os.Bundle;
-import android.widget.ArrayAdapter;
+import android.provider.Settings;
+import android.view.View;
+import android.widget.ImageButton;
 
 /** Starts up the task list that will interact with the AccessibilityService sample. */
 public class TaskListActivity extends ListActivity {
+
+    /** An intent for launching the system settings. */
+    private static final Intent sSettingsIntent =
+        new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
+
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.tasklist_main);
 
-        // Hardcoded hand-waving here.
+        // Hard-coded hand-waving here.
         boolean[] checkboxes = {true, true, false, true, false, false, false};
         String[] labels = {"Take out Trash", "Do Laundry",
                            "Conquer World", "Nap", "Do Taxes",
@@ -38,5 +46,14 @@
 
         TaskAdapter myAdapter = new TaskAdapter(this, labels, checkboxes);
         this.setListAdapter(myAdapter);
+
+        // Add a shortcut to the accessibility settings.
+        ImageButton button = (ImageButton) findViewById(R.id.button);
+        button.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startActivity(sSettingsIntent);
+            }
+        });
     }
 }
diff --git a/samples/ApiDemos/src/com/example/android/apis/accessibility/_index.html b/samples/ApiDemos/src/com/example/android/apis/accessibility/_index.html
index eacefa1..7506cb3 100644
--- a/samples/ApiDemos/src/com/example/android/apis/accessibility/_index.html
+++ b/samples/ApiDemos/src/com/example/android/apis/accessibility/_index.html
@@ -1,9 +1,23 @@
 <dl>
+  <dt><a href="ClockBackService.html">Accessibility Service</a></dt>
+  <dd>
+    This is an example of an accessibility service that provides custom feedback for the Clock
+    application which comes by default with Android devices. It is a hands-on example of various
+    ways to utilize the accessibility API for providing alternative and complementary feedback.
+    The sample demonstrates how to provide application specific feedback &mdash; the service
+    handles only accessibility events from the Clock application. Further, the sample demonstrates
+    how to provide dynamic, context-dependent feedback &mdash; feedback type changes depending on
+    the ringer mode.
+  </dd>
+<dt>
+
+<dl>
   <dt><a href="TaskBackService.html">Window Querying Accessibility Service</a></dt>
-  <dd>Demonstrates several new accessibility features in Ice Cream Sandwich,
-      including the ability for an AccessibilityService to traverse the view
-      hierarchy using AccessibilityNodeInfo objects, service configuration via
-      xml files, and adding additional information to AccessibilityEvents using
-      AccessibilityRecords.
-   </dd>
+  <dd>
+    Demonstrates several new accessibility features in Ice Cream Sandwich,
+    including the ability for an AccessibilityService to traverse the view
+    hierarchy using AccessibilityNodeInfo objects, service configuration via
+    xml files, and adding additional information to AccessibilityEvents using
+    AccessibilityRecords.
+  </dd>
 </dl>
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/ActionBarSettingsActionProviderActivity.java b/samples/ApiDemos/src/com/example/android/apis/app/ActionBarSettingsActionProviderActivity.java
index 2bf7c37..4748762 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/ActionBarSettingsActionProviderActivity.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/ActionBarSettingsActionProviderActivity.java
@@ -19,7 +19,6 @@
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
-import android.os.Bundle;
 import android.provider.Settings;
 import android.view.ActionProvider;
 import android.view.LayoutInflater;
@@ -43,14 +42,6 @@
      * {@inheritDoc}
      */
     @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         super.onCreateOptionsMenu(menu);
         getMenuInflater().inflate(R.menu.action_bar_settings_action_provider, menu);