package com.ttstd.dialer.base; import androidx.lifecycle.LifecycleService; /** * Service 基类(基于 AndroidX {@link LifecycleService})。 *
* 通过继承 {@link LifecycleService} 自动获得: * - {@link androidx.lifecycle.LifecycleOwner} 能力 * - 生命周期事件自动派发:onCreate → ON_CREATE,onStartCommand → ON_START / ON_RESUME,onDestroy → ON_DESTROY * (其中 ON_START / ON_RESUME 满足 Service 中 LiveData 的触发条件,无需再手动修补) * - 不再需要手动维护 {@link androidx.lifecycle.LifecycleRegistry} 或覆写生命周期方法派发事件 *
* 子类如需在生命周期回调中做处理,可直接覆写 onStartCommand / onDestroy 并调用 super。 */ public abstract class BaseService extends LifecycleService { }