The method by which android receives incoming calls in root mode

  • 2020-05-27 07:11:22
  • OfStack

Root Tools is used to host commands. https: / / code. google. com/p/roottools /


/**
 *  Answering calls 
 */
private void answerRingingCall()
{
    try
    {
        Command command = new Command(0, "input keyevent 5")
        {
            @Override
            public void output(int id, String line)
            {
                Log.d(Tag, line);
            }
        };
        RootTools.getShell(true).add(command).waitForFinish();
    }
    catch (InterruptedException e)
    {
        e.printStackTrace();
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
    catch (TimeoutException e)
    {
        e.printStackTrace();
    }
    catch (RootDeniedException e)
    {
        e.printStackTrace();
    }
}


Related articles: