1

Why I think it's not a duplicate:

  • I need to replace in-call screen, for both incoming and outgoing calls.

My requirements:

  • I need to create an Android app that will intercept both incoming and outgoing calls;
  • I need to display my own UI for the in-call screen.

Use case:

  • Idea is to create a very simplified android experience for elderly users;
  • They will be given a tablet with application in a full kiosk mode that will then allow them to receive and call only predefined whitelist of numbers;
  • They will get video calls, and etc;

My constraints:

  • It needs to be stable solution;
  • I don't need to handle many types of phone, most probably one make will be choosen and ordered in bulk;
  • It needs to work on recent android;

So is intercepting incoming and outgoing calls possible in android? I want to create my own in-call screen that will used instead of system one.

What I can do to the phone:

  • I don't (right now) control make of the phone
  • I can get device admin permissions
  • I don't want to root the phone or install custom ROM (right now)

Right now only solution I can think of is:

  • Obtain root access to the phone;
  • Replace dialer app with our own application;

This might be not possible as I'd need to integrate my dialer/in-call app with this specific system, and they could be intimately tied.

Questions

  • Is overriding in-call UI feasible in recent android systems?
  • If so, how it is possible;
jb.
  • 23,300
  • 18
  • 98
  • 136
  • Thanks for the pointer @Bryan, this helps, but from what I undestand this only initiates the call, while not providing my own ``in-call`` ui, which is an explicit requirement for me. – jb. Dec 12 '17 at 15:58

1 Answers1

2

The only application that is really able to trigger outgoing calls is the ROM Dialer application that comes with your Android OS. There are a couple of other apps out there, but they only trigger an intent which invokes the native dialer.


What does this mean for you?

Outgoing calls: You can write an application that checks if a number is in the whitelist for example, and which provides a simple, well-defined UI for elderly people. However, this application will then forward the call to the native dialer app. This is not a problem for what you want to achieve in general.

Incoming calls: You simply cannot replace the incoming call screen with your custom implementation. And there is no way of catching a call and forwarding it to your own app instead of the ROM dialer. This is for security reasons.


I tried to do something similar for a research project, where I wanted to provide a custom dialer application for patients suffering from Parkinson's disease. Unfortunately you were right with your guess that what you would like to achieve is only possible if you have root access to the phone.

PKlumpp
  • 4,913
  • 8
  • 36
  • 64
  • Are you sure? The documentation of `InCallService` states: "This service is implemented by any app that wishes to provide the user-interface for managing phone calls. " https://developer.android.com/reference/android/telecom/InCallService.html – Piotr Aleksander Chmielowski Feb 01 '18 at 11:04
  • 1
    Check this answer by arekolek: https://stackoverflow.com/a/49856583/1103974. Tested it today and it works wonders after accepting the prompt at startup. It will only work on API 23 and up. On above APIs, it might be necessary to further add TelecomManager permissions, see here: https://developer.android.com/reference/android/Manifest.permission.html#ANSWER_PHONE_CALLS – leRobot Apr 16 '18 at 18:21