diff options
| author | Charles Munger <clm@google.com> | 2019-11-12 08:35:39 -0800 |
|---|---|---|
| committer | Charles Munger <clm@google.com> | 2019-11-22 09:12:25 -0800 |
| commit | 6f8b09029932dfd24945202017639754b00acc2e (patch) | |
| tree | 510656d936ca7388819d52922fca0094f9049a38 /core/java/android | |
| parent | 49af39e751a777f5bb05b4c9e5491e8762f2fc9a (diff) | |
Deprecate IntentService
IntentService always had some issues, such as delivering null, adding
latency, inconsistently silently dropping tasks scheduled on its thread
local handler, etc. But with android O's background task restrictions,
it's really not useful anymore, and there are jetpack APIs that provide
its same functionality.
Bug: 144042891
Test: No behavior changes
Change-Id: I1a91afeeb73e270c54a9ec266b15b5d865ef8339
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/IntentService.java | 15 | ||||
| -rw-r--r-- | core/java/android/app/Service.java | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/core/java/android/app/IntentService.java b/core/java/android/app/IntentService.java index 11c747f5db17..74fb99a0909f 100644 --- a/core/java/android/app/IntentService.java +++ b/core/java/android/app/IntentService.java @@ -44,13 +44,6 @@ 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. * - * <p class="note"><b>Note:</b> IntentService is subject to all the - * <a href="/preview/features/background.html">background execution limits</a> - * 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. - * </p> - * * <div class="special reference"> * <h3>Developer Guides</h3> * <p>For a detailed discussion about how to create services, read the @@ -59,8 +52,14 @@ import android.os.Message; * </div> * * @see android.support.v4.app.JobIntentService - * @see android.os.AsyncTask + * + * @deprecated IntentService is subject to all the + * <a href="/preview/features/background.html">background execution limits</a> + * imposed with Android 8.0 (API level 26). Consider using {@link androidx.work.WorkManager} + * or {@link androidx.core.app.JobIntentService}, which uses jobs + * instead of services when running on Android 8.0 or higher. */ +@Deprecated public abstract class IntentService extends Service { private volatile Looper mServiceLooper; @UnsupportedAppUsage diff --git a/core/java/android/app/Service.java b/core/java/android/app/Service.java index 1f91b3f431a1..9b62e3b3af98 100644 --- a/core/java/android/app/Service.java +++ b/core/java/android/app/Service.java @@ -57,7 +57,7 @@ import java.lang.annotation.RetentionPolicy; * networking) operations, it should spawn its own thread in which to do that * work. More information on this can be found in * <a href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html">Processes and - * Threads</a>. The {@link IntentService} class is available + * Threads</a>. The {@link androidx.core.app.JobIntentService} class is available * as a standard implementation of Service that has its own thread where it * schedules its work to be done.</p> * |
