From 494f1a4dfa8abba5b468349a5375ec7a0194a91f Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Mon, 31 Jul 2017 19:13:38 -0700 Subject: [PATCH] docs: Noted that JobIntentService is usually a better choice Since IntentService is subject to the O background restrictions, most devs are better off switching to the new JobIntentService. (I assume IntentService is not actually deprecated; if it is, tell me and I'll change this to a @deprecated tag!) See first comment for doc stage location. Test: make ds-docs Bug: 64159987 Change-Id: I83a53d1e6336c2134bf4c61bedd2ae42cd80493a --- core/java/android/app/IntentService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/java/android/app/IntentService.java b/core/java/android/app/IntentService.java index e4a22c42d9bcb..95ec24cdb9c53 100644 --- a/core/java/android/app/IntentService.java +++ b/core/java/android/app/IntentService.java @@ -43,6 +43,13 @@ import android.os.Message; * long as necessary (and will not block the application's main loop), but * only one request will be processed at a time. * + *

Note: IntentService is subject to all the + * background execution limits + * imposed with Android 8.0 (API level 26). In most cases, you are better off + * using {@link android.support.v4.app.JobIntentService}, which uses jobs + * instead of services when running on Android 8.0 or higher. + *

+ * *
*

Developer Guides

*

For a detailed discussion about how to create services, read the @@ -50,6 +57,7 @@ import android.os.Message; * guide.

*
* + * @see android.support.v4.app.JobIntentService * @see android.os.AsyncTask */ public abstract class IntentService extends Service {