I found out why it didn't work. Since I use a HTC device, the broadcast messages are different from others.
- Shut down event broadcasts "
com.htc.intent.action.QUICKBOOT_POWEROFF
" - Restart(reboot) event broadcasts "
android.intent.action.ACTION_SHUTDOWN
" - Power on event broadcasts "
com.htc.intent.action.QUICKBOOT_POWERON
"
In other device, when shutting down the device, it might broadcast "android.intent.action.QUICKBOOT_POWEROFF
".