关机 ( 需要 root 权限 ) @return true success, false fail
()
| 1725 | * @return {@code true} success, {@code false} fail |
| 1726 | */ |
| 1727 | public static boolean shutdown() { |
| 1728 | try { |
| 1729 | ShellUtils.execCmd("reboot -p", true); |
| 1730 | Intent intent = new Intent("android.intent.action.ACTION_REQUEST_SHUTDOWN"); |
| 1731 | intent.putExtra("android.intent.extra.KEY_CONFIRM", false); |
| 1732 | return AppUtils.startActivity(intent); |
| 1733 | } catch (Exception e) { |
| 1734 | LogPrintUtils.eTag(TAG, e, "shutdown"); |
| 1735 | } |
| 1736 | return false; |
| 1737 | } |
| 1738 | |
| 1739 | /** |
| 1740 | * 重启设备 ( 需要 root 权限 ) |
no test coverage detected