In order to analyze the wakelock problem (most of the time, the CPU is at 200Mhz rather than deep sleep when it is not used. Also "battery info" tells me the battery was mostly used by "Android OS"), I have to factory reset the device and flash to the stock 4.3 ROM. I monitored the newly setup phone for a day before I rooted it and install CWM recovery 184.108.40.206 for full system backup.
Happily used the phone for a week. After my son played with it for an afternoon, the wakelock problem comes back. Not sure what settings did he changed or apps he installed. So I go ahead backup the current rom and restore the phone from the previous backups.
Here was what I have done:
1. Boot into Clockworkmod recovery
2. Clear all partition / factory reset
3. Select Backup and restore.
4. Select the backup directory that I want to restore from (the one without wakelock problem)
5. Wait for the restoration process to finish
6. System reboots.
After system rebooted, it kept popping up "unfortunately com.google.process.gapps has stopped". The device was not usable, because the message will pop up again once I click OK to dismiss it. I then tried the following, but none of them works.
1. Restore from different backups
2. Enable "download service" from application manager. (It was not disabled)
3. Reset all apps settings from "Application manager" (menu)
Trying option 2 and 3 was a pain as the popup messages was blocking the screen, I have to be really quick to dismiss the message box and touch on the command.
BTW, the CWM recovery touch was installed from Odin, not from ROM manager. I experience the following problems:
1. Issue with "backup current ROM" command from "ROM manager". It cannot find /ex_sdcard when it goes to recovery.
2. It cannot find dalvik partition to wipe.
3. Backup to zip command does not work. It does backup the files and at the end it said the backup file is in /storage/sdcard/clockworkmod/image.zip. But I cannot find the zip file any where, including the external sd card.
Here is what I did to restore my phone to previous state with stock ROM:
1. Use Odin to flash the stock rom (samsung 4.3 for N7100), which will restore the stock recovery instead of the CWM recovery.
2. Reboot the device.
3. Use Odin to flash CWM recovery.
4. Reboot the device.
5. Go into recovery and restore only the /data partition.
6. Wipe /cache.
7. Reboot the device
8. Boot back to recovery and root the device.
Now I have the phone at my previous state.
Does it mean CWM recovery will not work with stock ROMs ? or I did something wrong.
Also, I still have not find out what was the cause for the wakelock problem in "Android OS". I have two backups where one has the problem and one does not. I have tried untar them and compare them with WinMerge, but there were a lots of files to go through.