位元組碼和安卓相關文章
阿新 • • 發佈:2021-10-13
Android SystemServer 中 WatchDog 機制介紹 https://www.jianshu.com/p/5e8c0cb1a58e
Android Watchdog
Android中的Watchdog
- 在Android中,Watchdog是用來監測關鍵服務是否發生了死鎖,如果發生了死鎖就kill程序,重啟SystemServer
- Android的Watchdog是在SystemServer中進行初始化的,所以Watchdog是執行在SystemServer程序中
- Watchdog是執行一個單獨的執行緒中的,每次wait 30s之後就會發起一個監測行為,如果系統休眠了,那Watchdog的wait行為也會休眠,此時需要等待系統喚醒之後才會重新恢復監測
- 想要被Watchdog監測的物件需要實現Watchdog.Monitor介面的monitor()方法,然後呼叫addMonitor()方法
一起玩轉Android專案中的位元組碼http://quinnchen.cn/2018/09/13/2018-09-13-asm-transform/
ASM https://www.jianshu.com/p/a1e6b3abd789
https://github.com/heiheiwanne/ASMDemo