ShutdownHook

interface ShutdownHook(source)

程序关闭前会扫描所有 ShutdownHook 实现并并发调用。

时机为关闭刚开始,适配器全部停止,AutoTweaker 的所有服务仍然在运行。

实现 ShutdownHook 的类只有在程序关闭前才被实例化。

需要打上 @AutoService(ShutdownHook::class) 来让 AutoTweaker 发现。

Functions

Link copied to clipboard
abstract suspend fun shutdown()

程序即将关闭时必然调用此方法,除非被强杀。