質問

Why does Android( ICS ) keep waking up from sleep ? I am using a serial connection from the board to monitor kernel prints, I can see that every now and then android wakes up and goes back to sleep. Is it because of some scheduled task or something? How can I prevent this from happening?

Thanks

役に立ちましたか?

解決

Is it because of some scheduled task or something?

Quite possibly. adb shell dumpsys alarm will show you any events scheduled via AlarmManager. Those that are "wakeup" events will wake up the device out of sleep mode.

Incoming data packets on an open socket on mobile data, incoming phone calls, and incoming SMS messages will also wake up an Android device out of sleep mode.

How can I prevent this from happening?

If it is your app waking up the device, presumably you can change something about your app to avoid it.

If it is a third-party app that you installed that is waking up the device, uninstall that app.

Beyond that, your only way to control this is via your own ROM mod, where you alter the behavior of the OS such that wakeup alarms do not wake up the device. This is likely to be a very complex bit of work in general, let alone to get it right.

Or, switch to a device that has such capability built in. For example, some of the SONY Xperia line, such as the SONY Xperia Z, offer "stamina mode" where you can block wakeup alarms from waking up the device. This will cover installed apps; it may not affect wakeups from OS components, if SONY believed that those were essential.

Or, don't worry about it waking up, or modify things on the other end of your serial connection to not worry about it waking up.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top