From 8b456581409e501a4153f91f2f1d2f561d7362ac Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Mon, 15 Apr 2019 10:12:14 -0700 Subject: [PATCH] Added example for ContentCaptureService.SERVICE_META_DATA Test: echo 'in TreeHugger we trust' Fixes: 130247765 Change-Id: I9a6f4f710bb5b6de4621257bc0d375ceb230c5ca --- .../contentcapture/ContentCaptureService.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/core/java/android/service/contentcapture/ContentCaptureService.java b/core/java/android/service/contentcapture/ContentCaptureService.java index 5be73b92fbc04..bee165160dd00 100644 --- a/core/java/android/service/contentcapture/ContentCaptureService.java +++ b/core/java/android/service/contentcapture/ContentCaptureService.java @@ -86,11 +86,28 @@ public abstract class ContentCaptureService extends Service { * <{@link * android.R.styleable#ContentCaptureService content-capture-service}> tag. * - *

This is a a sample XML file configuring a ContentCaptureService: - *

 <content-capture-service
-     *     android:settingsActivity="foo.bar.SettingsActivity"
-     *     . . .
-     * />
+ *

Here's an example of how to use it on {@code AndroidManifest.xml}: + * + *

+     * <service android:name=".MyContentCaptureService"
+     *     android:permission="android.permission.BIND_CONTENT_CAPTURE_SERVICE">
+     *   <intent-filter>
+     *     <action android:name="android.service.contentcapture.ContentCaptureService" />
+     *   </intent-filter>
+     *
+     *   <meta-data
+     *       android:name="android.content_capture"
+     *       android:resource="@xml/my_content_capture_service"/>
+     * </service>
+     * 
+ * + *

And then on {@code res/xml/my_content_capture_service.xml}: + * + *

+     *   <content-capture-service xmlns:android="http://schemas.android.com/apk/res/android"
+     *       android:settingsActivity="my.package.MySettingsActivity">
+     *   </content-capture-service>
+     * 
*/ public static final String SERVICE_META_DATA = "android.content_capture";