diff --git a/README.md b/README.md index a452b05..acebdd4 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,43 @@ [ci-badge]: https://travis-ci.org/firebase/firebase-jobdispatcher-android.svg?branch=master [ci-link]: https://travis-ci.org/firebase/firebase-jobdispatcher-android - -**Last year, we announced Android Jetpack [WorkManager](https://developer.android.com/topic/libraries/architecture/workmanager/). WorkManager, the new job management system in Jetpack, incorporates the features of Firebase Job Dispatcher (FJD) and Android’s [JobScheduler](https://developer.android.com/reference/android/app/job/JobScheduler) to provide a consistent job scheduling service back to api level 14 while leveraging JobScheduler on newer devices. WorkManager works with or without Google Play Services, which is something FJD cannot do. WorkManager was first released to alpha in May 2018 and then went thru extensive iteration and improvement based on developer feedback including 10 alphas; it moved to beta on Dec 19, 2018, and was released to [stable](https://developer.android.com/jetpack/androidx/releases/work#1.0.0) on Mar 5, 2019. One thing the team has been discussing at some length is whether it would be better for developers in the long run if we create one holistic solution via WorkManager; where we can pool all of our efforts and also give developers a single unified recommended path?** - -**After careful evaluation, the team has decided to focus all of our efforts on WorkManager and to deprecate Firebase Job Dispatcher. We have modified our plans in direct response to developer feedback in order to make this as easy for you as possible. We know that managing background work is a critical part of your app and these changes impact you. We want to support you through this migration as much as we can by giving you as much advance notice as possible to make these changes. Firebase Job Dispatcher will be archived in github in about 1 year, on Apr 7, 2020. Apps should migrate to WorkManager or an alternative job management system before this date.** - -**We’ve created a detailed [migration guide](https://developer.android.com/topic/libraries/architecture/workmanager/migrating-fb) to assist you in the transition to WorkManager. After Apr 7, 2020, this github repository will be archived and support for FJD customer issues will stop. Additionally, FJD will stop working once your app starts targeting an Android version after Android Q.** - -**We are continuing to invest in and add new features to WorkManager and welcome any feedback or feature [requests](https://issuetracker.google.com/issues/new?component=409906&template=1094197).** +**Last year, we announced Android Jetpack +[WorkManager](https://developer.android.com/topic/libraries/architecture/workmanager/). +WorkManager, the new job management system in Jetpack, incorporates the features +of Firebase Job Dispatcher (FJD) and Android’s +[JobScheduler](https://developer.android.com/reference/android/app/job/JobScheduler) +to provide a consistent job scheduling service back to api level 14 while +leveraging JobScheduler on newer devices. WorkManager works with or without +Google Play Services, which is something FJD cannot do. WorkManager was first +released to alpha in May 2018 and then went thru extensive iteration and +improvement based on developer feedback including 10 alphas; it moved to beta on +Dec 19, 2018, and was released to +[stable](https://developer.android.com/jetpack/androidx/releases/work#1.0.0) on +Mar 5, 2019. One thing the team has been discussing at some length is whether it +would be better for developers in the long run if we create one holistic +solution via WorkManager; where we can pool all of our efforts and also give +developers a single unified recommended path?** + +**After careful evaluation, the team has decided to focus all of our efforts on +WorkManager and to deprecate Firebase Job Dispatcher. We have modified our plans +in direct response to developer feedback in order to make this as easy for you +as possible. We know that managing background work is a critical part of your +app and these changes impact you. We want to support you through this migration +as much as we can by giving you as much advance notice as possible to make these +changes. Firebase Job Dispatcher will be archived in github in about 1 year, on +Apr 7, 2020. Apps should migrate to WorkManager or an alternative job management +system before this date.** + +**We’ve created a detailed +[migration guide](https://developer.android.com/topic/libraries/architecture/workmanager/migrating-fb) +to assist you in the transition to WorkManager. After Apr 7, 2020, this github +repository will be archived and support for FJD customer issues will stop. +Additionally, FJD will stop working once your app starts targeting an Android +version after Android Q.** + +**We are continuing to invest in and add new features to WorkManager and welcome +any feedback or feature +[requests](https://issuetracker.google.com/issues/new?component=409906&template=1094197).** The Firebase JobDispatcher is a library for scheduling background jobs in your Android app. It provides a [JobScheduler][]-compatible API that works on all diff --git a/jobdispatcher/src/main/java/com/firebase/jobdispatcher/FirebaseJobDispatcher.java b/jobdispatcher/src/main/java/com/firebase/jobdispatcher/FirebaseJobDispatcher.java index a0d1f1d..ecb7675 100644 --- a/jobdispatcher/src/main/java/com/firebase/jobdispatcher/FirebaseJobDispatcher.java +++ b/jobdispatcher/src/main/java/com/firebase/jobdispatcher/FirebaseJobDispatcher.java @@ -28,7 +28,10 @@ * @see #FirebaseJobDispatcher(Driver) * @see Driver * @see JobParameters + * @deprecated Firebase Job Dispatcher is deprecated. Apps should migrate to WorkManager before Apr + * 7, 2020. Please see FJD's README.md file for more information. */ +@Deprecated public final class FirebaseJobDispatcher { /** Indicates the schedule request seems to have been successful. */ public static final int SCHEDULE_RESULT_SUCCESS = 0; diff --git a/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobParameters.java b/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobParameters.java index 4d2aacc..1f9637d 100644 --- a/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobParameters.java +++ b/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobParameters.java @@ -21,7 +21,13 @@ import android.support.annotation.Nullable; import com.firebase.jobdispatcher.Constraint.JobConstraint; -/** JobParameters represents anything that can describe itself in terms of Job components. */ +/** + * JobParameters represents anything that can describe itself in terms of Job components. + * + * @deprecated Firebase Job Dispatcher is deprecated. Apps should migrate to WorkManager before Apr + * 7, 2020. Please see FJD's README.md file for more information. + */ +@Deprecated public interface JobParameters { /** Returns the name of the backing JobService class. */ diff --git a/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobService.java b/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobService.java index 2dcba58..d71abb6 100644 --- a/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobService.java +++ b/jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobService.java @@ -23,18 +23,14 @@ import android.app.Service; import android.content.Intent; import android.content.res.Configuration; -import android.os.Binder; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; -import android.os.Message; import android.os.RemoteException; import android.os.SystemClock; import android.support.annotation.AnyThread; import android.support.annotation.BinderThread; -import android.os.RemoteException; -// import android.support.annotation.GuardedBy; import android.support.annotation.IntDef; import android.support.annotation.MainThread; import android.support.annotation.NonNull; @@ -68,7 +64,11 @@ *

Implementations should also override {@link #onStopJob(JobParameters)}, which will be called * if the scheduling engine wishes to interrupt your work (most likely because the runtime * constraints that are associated with the job in question are no longer met). + * + * @deprecated Firebase Job Dispatcher is deprecated. Apps should migrate to WorkManager before Apr + * 7, 2020. Please see FJD's README.md file for more information. */ +@Deprecated public abstract class JobService extends Service { /**