The method by which android receives incoming calls in root mode


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();
    }
}