本篇功能的实现需要设备具有root权限,还没有获取root权限的可参考上一篇文章来获取–>【android工具篇】Firefly-RK系列(eg:RK3288 RK3368)一键获取root权限工具RootUtils
本文的方法只是实现手段的一种,不可能完全适用所有设备哦,试试才知道。
请尊重原创,转载需要注明出处,大力哥的博客:https://blog.youkuaiyun.com/qq137722697
实现重启
考虑到设备需要远程或自动重启的场景(比如通过远程推送的方式下发重启指令、设备定时重启缓解资源紧张等),下面提供一种思路:
public static void reboot(Context context) {
Intent intent = new Intent(Intent.ACTION_REBOOT);
intent.putExtra("nowait", 1);
intent.putExtra("interval",