prevent screen to turn on when incoming call android - android

When Android phone receives an incoming call from a specific number the phone's ringing the screen should not blink. What I mean is the user should not be able to know that there was incoming call, but actually there was because i am blocking the incoming call through telephony manager but before ending call through telephony manager in broadcast receiver screen lights up that cause use in suspicion that something has happened.
Any help in this regard will be really appreciable.

Related

In rooted device detect if an outgoing call has been answered

I am developing a system app in which I need to capture the outgoing call answer/reject events. Could you advice on how to achieve this in a rooted device please ? Problem with TelephonyManager class is that there is no notification of when outgoing call has answered.
This is crucial to my app. My target device is android 4.4(kitkat).
Some thing like this app.
https://play.google.com/store/apps/details?id=io.github.yutouji0917.callvibrator.ad
To do this you must register broadcast receiver for listening phone events like incoming, outgoing call, hang up events and don't forget to define broadcast in manifest file.
Here i am attaching a link that will help you to implement your code
http://karanbalkar.com/2014/02/detect-incoming-call-and-call-hangup-event-in-android/
http://www.codeproject.com/Articles/548416/Detecting-incoming-and-outgoing-phone-calls-on-And

android.intent.action.BOOT_COMPLETED - do not receive broadcast if boot completed by a phone call

I am using a broadcast receiver in my app, to display a photo on BOOT_COMPLETED. However, I noticed that if I receive a phone call on my phone, the photo is displayed in front of incoming phone call activity, so I can's see who is calling me and what is worse - can't answer the phone.
What is the best way to override this behavior?
you could add another mechanism for listening to phone calls events, and if you detect that the phone is ringing (or the call was answered), you won't show the activity...
in any case, please don't show such things. no user likes popups go out of nowhere.
instead, use notifications to tell the user something has happened.

Outgoing Call Android

My application wants to get the event at which the call is ringing on the other side. Or when, the user on the other side has picked up the call. I tried android.intent.action.NEW_OUTGOING_CALL but it is of no use to me. I have gone through the TelephoneManager, but i am not able to get the solution.
Listen to phone state of the device, check this link:
Android: Taking complete control of phone(kiosk mode), is it possible? How?
Try to achieve with CALL_STATE_OFFHOOK of the telephoney manager:
CALL_STATE_OFFHOOK
At least one call exists that is dialing, active, or on hold, and no calls are ringing or waiting.

Kill app on incoming phone call

Hopefully an easy one for someone, but causing me problems.
I have an app that loops sound files. I have no code in onPause as I want the app to continue playing music in the background.
I now need the app to close if an incoming call is received.
I can add code to onPause and close the activity and stop the mediaplayer. However this stops the app if any app is launched.
How can I detect an incoming call to check for inside onPause?
To detect the incoming call, we register a BroadcastReceiver for the
action android.intent.action.PHONE_STATE. This will be broadcasted
when there is a change in phone state. The receiving intent will have
an extra string variable TelephonyManager.EXTRA_STATE which describes
the phone state. If this state is TelephonyManager.EXTRA_STATE_RINGING
then there will be another extra string variable
TelephonyManager.EXTRA_INCOMING_NUMBER. This variable contains the
incoming phone number. Note that this variable will not be present
when the state is not TelephonyManager.EXTRA_STATE_RINGING.
source : http://www.androiddevblog.net/android/detecting-incoming-and-outgoing-calls-in-android
basically, once you register a broadcast receiver you can listen for the broadcast notification you are interested in your phone, and then act accordingly.
You do not have to. Android takes care of it pausing your app - you have to use telephony manager to determine whether to stop your aplication or not. Proper way would be to handle this in onPause() method

Turn Off Sound and screen blink on incoming calls in Android?

I would like to know whether this is actually possible in Android?
When Android phone receives an incoming call from a specific number the phone's ringing should stop and also the screen should not blink. What I mean is the user should not be able to know that there was incoming call, but actually there was.
I do not want to delete any call logs, just to stop sound on incoming call from a specific number and that too at a specific time.
Can someone let me know if this is actually possible?
When Android phone receives an
incoming call from a specific number
the phone's ringing should stop and
also the screen should not blink. What
I mean is the user should not be able
to know that there was incoming call,
but actually there was.
Fortunately, this should not be possible from the SDK. You can be notified that a phone call comes in, but I do not believe you can stop the ringtone, and I am really sure you cannot stop the in-call screen from appearing.

Categories

Resources