LifecycleService 是否与生命周期扩展工件一起被弃用?

Is LifecycleService deprecated along with lifecycle-extensions artifact?

似乎曾经存在于 lifecycle-extensions 工件中的 LifecycleService class 在当前推荐的任何工件中都不可用。我希望它在 lifecycle-runtime 中,这是没有 ViewModel 和 LiveData 的那个,但是 LifecycleService 不在 lifecycle-viewmodellifecycle-livedata.

LifecycleService 是否已弃用?

Source on current Lifecycle artifacts

不,LifecycleService 根据 Lifecycle 2.2.0 release notes:

lifecycle-service 依赖项中

lifecycle-extensions Artifact Deprecation: With the above deprecation of ViewModelProviders.of(), this release marks the deprecation of the last API in lifecycle-extensions and this artifact should now be considered deprecated in its entirety. We strongly recommend depending on the specific Lifecycle artifacts you need (such as lifecycle-service if you’re using LifecycleService and lifecycle-process if you’re using ProcessLifecycleOwner) rather than lifecycle-extensions as there will not be a future 2.3.0 release of lifecycle-extensions.