屏幕保护(Keyguard)管理Activity生命周期
在锁屏时开发自定义SystemUI的锁屏时,会出现无法使底部Activity不在解锁时再走OnStart和OnResume方法,此时可以使用下面的方法,第一个showing参数传为true或者false即可,亲测有效,可以用于独立开发的锁屏界面,用于优化内存占用。
/**
* Informs ActivityTaskManagerService that the keyguard is showing.
*
* @param showingKeyguard True if the keyguard is showing, false otherwise.
* @param showingAod True if AOD(息屏显示) is showing, false otherwise.
*/
ActivityTaskManager.getService().setLockScreenShown(showing, aodShowing);