title: Need root to execute shell command "input keyevent <#>" through an app at runtime?
body: <p>I'm trying to execute the adb shell command <code>input keyevent 5</code> to answer a call through my app at run time.</p>
  
  <p>If I do this:</p>
  
  <pre><code>Runtime.getRuntime().exec("input keyevent 5");
  </code></pre>
  
  <p>It doesn't seem to execute (nothing is happening). But when I do this:</p>
  
  <pre><code>Runtime.getRuntime().exec(new String[] {"su", "-c", "input keyevent 5"});
  </code></pre>
  
  <p>The expected simulated tap on the answer button on-screen happens. Which is good.</p>
  
  <p>However one problem is that on some devices which are rooted using Superuser, the command takes a while to get the superuser permission. It works fine with devices which have Chainfire's SuperSU su binary.</p>
  
  <p>My question is:
  Is it possible to execute this command without root through Java code at runtime?</p>
  
  <p>Thanks in advance!</p>