安卓 开机按power不能休眠,过一段时间才能休眠
来源:互联网 发布:合金装备崛起 知乎 编辑:程序博客网 时间:2024/05/16 10:05
参考文章:点击打开链接
PowerManagerService.java
1,原本开机检查开机动画:startWatchingForBootAnimationFinished();在接到开机完成广播后才检查开机动画,把这个方法注释掉
private final class BootCompletedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // This is our early signal that the system thinks it has finished booting. // However, the boot animation may still be running for a few more seconds // since it is ultimately in charge of when it terminates. // Defer transitioning into the boot completed state until the animation exits. // We do this so that the screen does not start to dim prematurely before // the user has actually had a chance to interact with the device. // startWatchingForBootAnimationFinished(); } }
2,在 public void systemReady(TwilightService twilight, DreamManagerService dreamManager) {
synchronized (mLock) {
mSystemReady = true;
mDreamManager = dreamManager;
.......
// Go.
readConfigurationLocked();
updateSettingsLocked();
mDirty |= DIRTY_BATTERY_STATE;
updatePowerStateLocked();
// wdh add
startWatchingForBootAnimationFinished();
}
}
结尾处加上这个方法
方法二:归根结底,执行的是handleBootCompletedLocked()这个方法(就是说系统完成启动了),所以
把上面的startWatchingForBootAnimationFinished();方法换成 handleBootCompletedLocked();方法也可以
- 安卓 开机按power不能休眠,过一段时间才能休眠
- Android4.2 长按POWER键休眠
- 休眠
- 安卓屏幕唤醒与休眠
- 安卓CPU休眠Timer不执行
- 安卓4.4,去锁屏+禁止休眠
- 为什么中断不能休眠
- 为什么中断不能休眠
- 设置Android设备按Power按键不休眠
- android5.1 按下power键 系统不休眠
- 安卓M版本如何在setting中的休眠模式下添加永不休眠功能?
- 解决WINDOWS不能休眠问题
- Ubuntu休眠后不能唤醒
- Cocos2d-x 安卓设定不休眠(屏幕常亮)
- 安卓 休眠 长连接和推送的可选实现
- power key休眠唤醒时序图
- Android开发:休眠唤醒或开机后cmwap/cmnet网络不能连接的解决办法
- 笔记本 win7 不能待机 不能休眠
- Windows 64位下安装Redis详细教程
- Java面试常见问题总结
- gcc g++ 编译链接
- linux免密登录
- 杭电ACM第1007题——Quoit Design
- 安卓 开机按power不能休眠,过一段时间才能休眠
- 关于前台js和css引用外面文件的次序
- ubuntu14.04 安装docker以及其原理
- Redis介绍及实践分享
- webpack使用--基础
- leetcode138~Copy List with Random Pointer
- WampServer 局域网手机访问(403 Forbidden错误解决方法)
- iOS 开发常用宏定义总结
- 关于picture标签的一点记录