Reboot programmatically Android Things

前端 未结 4 1476
忘掉有多难
忘掉有多难 2020-12-19 20:38

I want to use this code in order to reboot my RPI3 running Android Things:

public static void Reboot()
{
    try {
        Process proc = R         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-19 21:02

    Access to system-protected features (such as those provided by the PowerManager.reboot() API) will be available to apps running on Android Things in a future developer preview release. You cannot (and should not) attempt to run your app process as the root user via su.

    As a side note, the developer images for Android Things are built as userdebug, which means you can access root from the shell by simply rebooting the ADB daemon with the adb root command before you attempt to access the shell. This gives you any root access you may need during development without compromising the device security and allowing app processes to run as root.

提交回复
热议问题