The title seems to be a duplicate of this.
However as I tried the solution and reading further came to know that CALL_PRIVILEGED permission is only possible for system apps. Hence I wanted to know if there's any work-around to this.
What I want to achieve is quite obvious, call an emergency number such as 911 directly without opening the dialer screen. (which I found is not possible for security reasons. Still trying.)
My Assumption: (The following steps are stupid assumptions of mine to achieve the above)
A. Use Action_DIAL intent action and open the dialer screen with 911 already dialed into it by doing this,
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + "911"));
startActivity(callIntent);
Here my dream code starts. If only these are possible.
B. Register a receiver which will check if the dialer is open (looking for an Intent if exists for this) and the number it contains is 911.
C. Call the click event of the CALL button programmatically. (Again if this is possible)
Please tell me if above is possible? I am also trying to get this done. Also any other way to achieve this would be great.
EDIT - I am hoping if this can be possible without user having the root access.