As we know, Linux kernel supports standby, suspend-to-ram, suspend-to-disk. However, I found Android doesn't support suspend-to-disk, or hibernate, although it's kernel is derived from Linux.
And now, I want to enable it on Android, but don't know how to. I will do my job based on Andorid 4.1, and Linux 3.0.8.
Would you like to provide any useful information ? Has anybody done this before?
Thanks.
Asked
Active
Viewed 4,289 times
5

lian.duan
- 51
- 1
- 3
-
What is the real problem that you're trying to solve? – northben Jan 09 '13 at 17:46
-
I am trying to modify codes of android to make it support **suspend-to-disk**/**hibernate**. When i wrote **disk** to **/sys/power/state**, which will invoke the **hibernate()** process, I got "**active main wakelock**" in the log. I suspected that it was because I didn't add the **early-suspend** process before hibernate() as google added it before suspend(). – lian.duan Jan 14 '13 at 13:01
-
I meant why would you want to do such a thing? Whatever you're trying to do, I bet the Android frameworks already support a way to accomplish it. – northben Jan 14 '13 at 15:21
-
2It always takes too long to start up Android. Actually, hibernation may make it faster. During the **hibernation()** process, it will create an image of memory, save it into the disk and shutdown the device. So when we start up next time, it will just read the image to the memory. If reading speed is high, it can save a lot of time. – lian.duan Jan 16 '13 at 02:26
1 Answers
0
Android made a check to see if anyone holds wakelock when try_to_freeze_tasks. You can ignore it when you want hibernate.

jay
- 1
- 1
-
Thanks! I think I have solved this problem. I added the **early-suspend** before **hibernation()**. It can freeze tasks now. BUT I came into a new problem. I want to disable the suspend of console, so I can see the log after it suspended. I add **no_console_suspend** in the **bootargs** and it works. But after I wakeup the device,the console just print **messy code**. – lian.duan Jan 16 '13 at 02:36