From 5632984369da423d64cb203c31ffc94037c2c46a Mon Sep 17 00:00:00 2001 From: Joe Fernandez Date: Fri, 29 Aug 2014 16:24:15 -0700 Subject: [PATCH] docs: Fix bug with Accessibility Services dev guide b/11448573 Change-Id: I778c26f86c4a2cb3ebef9f3e75b5d544269486dc --- .../guide/topics/ui/accessibility/services.jd | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd index c8680800da067..d69af9f1ca868 100644 --- a/docs/html/guide/topics/ui/accessibility/services.jd +++ b/docs/html/guide/topics/ui/accessibility/services.jd @@ -71,24 +71,30 @@ accessibility service.

Accessibility service declaration

-

In order to be treated as an accessibility service, your application must include the +

In order to be treated as an accessibility service, you must include a {@code service} element (rather than the {@code activity} element) within the {@code application} -element in its manifest. In addition, within the {@code service} element, you must also include an +element in your manifest. In addition, within the {@code service} element, you must also include an accessibility service intent filter. For compatiblity with Android 4.1 and higher, the manifest must also request the {@link android.Manifest.permission#BIND_ACCESSIBILITY_SERVICE} permission as shown in the following sample:

-<application>
-  <service android:name=".MyAccessibilityService"
-      android:label="@string/accessibility_service_label"
-      android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
-    <intent-filter>
-      <action android:name="android.accessibilityservice.AccessibilityService" />
-    </intent-filter>
-  </service>
-  <uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
-</application>
+<manifest>
+  ...
+  <uses-permission ... />
+  ...
+  <application>
+    ...
+    <service android:name=".MyAccessibilityService"
+        android:label="@string/accessibility_service_label"
+        android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
+      <intent-filter>
+        <action android:name="android.accessibilityservice.AccessibilityService" />
+      </intent-filter>
+    </service>
+    <uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
+  </application>
+</manifest>
 

These declarations are required for all accessibility services deployed on Android 1.6 (API Level