title: Can't reboot device using runtime.exec
body: <p>For some reason I cannot reboot Android devices using Runtime.getRuntime().exec("/system/bin/reboot");. I have tried the following code on 3 devices now without luck. One was built from rowboat-android source. The other two are the Motorola Droid Pro (Rooted, stock) and the HTC Ledgent (Rooted, Cynogen Mod). All devices are running Android 2.2 Froyo.</p>
  
  <p>Does anyone know why? su works as well as the Super User application is visible. I should note various other shell commands do work, like netcfg (chmod' to 777) and ls.</p>
  
  <pre><code>public static boolean executeCommand(SHELL_CMD iShellCmd){
          String cmd = null;
          String line = null;
          String fullResponse = null;
          Process lPs = null;
  
          Log.d(Global.TAG,"--&gt; !!!!! Running shell command");
  
          if (iShellCmd == SHELL_CMD.restart_device){
              cmd = "reboot";
          }
  
          Log.d(Global.TAG,"--&gt; About to exec: " + cmd);
  
          try {
              lPs = Runtime.getRuntime().exec("su");
              lPs = Runtime.getRuntime().exec("/system/bin/reboot");
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          BufferedWriter out = new BufferedWriter(new OutputStreamWriter(lPs.getOutputStream()));
          BufferedReader in = new BufferedReader(new InputStreamReader(lPs.getInputStream()));
  
          try {
              while ((line = in.readLine()) != null) {
                  Log.d(Global.TAG,"--&gt; Command result line: " + line);
                  if (fullResponse == null){
                      fullResponse = line;
                  }else{
                      fullResponse = fullResponse + "\n" + line;
                  }
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          Log.d(Global.TAG,"--&gt; Full response was: " + fullResponse);
  
          return true;
      }
  </code></pre>