First run the Code:
[Java]
Intent intent = new Intent (Intent. ACTION_REBOOT );
Intent. setAction (Intent. ACTION_REBOOT );
Intent. putExtra ("nowait", 1 );
Intent. putExtra ("interval", 1 );
Intent. putExtra ("window", 0 );
SendBroadcast (intent );
Intent intent = new Intent (Intent. ACTION_REBOOT );
Intent. setAction (Intent. ACTION_REBOOT );
Intent. putExtra ("nowait", 1 );
Intent. putExtra ("interval", 1 );
Intent. putExtra ("window", 0 );
SendBroadcast (intent); www.2cto.com
This is where the call is made. You only need to send the broadcast above.
Add permissions to the root tag manifest in the androidmanifest. xml file.
[Java]
Android: sharedUserId = "android. uid. system"
Android: sharedUserId = "android. uid. system"
After adding the preceding permissions, compile the source code.
Add the following content to the Android. mk file:
[Java]
LOCAL_CERTIFICATE: = platform
LOCAL_CERTIFICATE: = platform
The restart code is in frameworks/base/core/jni/android_ OS _Power.cpp.
Author: wu_shu_jun