Android: Incoming call screen contains no Answer & reject options - TelecomManager & Connection Service - android

I'm building a voip app and will be using Android's incoming call UI. I've successfully registered a phoneAccount using the TelecomManager and managed to get addNewIncomingCall working.
The problem is that when the phone is locked I get the incoming call UI but NO actions to answer or dismiss the call.
In the other hand, if the phone is not locked I still get the incoming call UI but it DOES contain actions to answer or dismiss the call.
Any ideas as to what might be happening?
I can attach code if needed.
But basically I'm following this android's documentation:
https://developer.android.com/reference/android/telecom/TelecomManager.html
https://developer.android.com/reference/android/telecom/ConnectionService.html

There is a test implementation of these APIs in the AOSP repository. Take a look at how the TestConnectionService does things.
Be forewarned, the CTS test coverage for these APIs was not complete in M (or even N for that matter), so its possible that OEMs do not fully support them in their intended manner. Starting in O the CTS test coverage has been improved so OEM compatibility should improve.

Related

Android: which api to use to record all incoming and outgoing call (Since in changelogs Android blocked call recording)

Is there is api where i can record all the incoming and outgoing call in android pie version . It seems nearly impossible to record a call. Please suggest what can be done in this scenario
Android disabled the api with their security update policy. Looking at the permissions list the closest you can find is the MANAGE_OWN_CALLS, meaning that the best solution for you is to implement a standalone application for calling where you should be able to interact with microphone directly.

Disconnect call programmatically in Android

How can we disconnect a call in Android. I know this has been asked many times. There are many other answers which state that our app needs to be a system app to disconnect a call but then the answer at this link states that it is not so. But, even the answer there does not help to disconnect the call.
Then I saw that SDK 23 adds a new class Call which the Android document says can be used to handle calls. It has a function called disconnect(). So, how can this be used, if our app is not the dialer app? I only need the data to cut/answer the call. (Don't want to become the default dialer app, nor the system app) https://developer.android.com/reference/android/telecom/Call.html#disconnect()
Could I be guided towards what is the latest information in this regard? For both Marshmallow and pre-Marshmallow devices. I feel the solution to both might be different.
Not sure of the solution for pre-Marshmallow, but for M+ I feel the Call class is to be used.

Programmatic auto attendant on an Android device

Is it possible to create an Android application that automatically attend incoming calls to an Android phone? If so, which APIs may be used to achieve this (a piece of code snippet highly appreciable)?
If the programmatic auto attendant feature not possible, why the Android OS imposes this restriction?
Is iOS behaves as same as Android in this scenario, please explain.
While googling I found something that can be useful. I haven't tried yet still I think this will help have a look at Call Control in Android
You can listen incomming call intent by implementing broadcast receiver Intent.CALL_STATE_CHANGED to listen for incoming call, but answering incomming call automatically seems not feasible.coz android application dont have access to incomming call audio stream.

C2DM handle registration properly

I want to use C2DM in my android application. I am using code schemas shown in official tutorials. Everything seems to work fine, but I have problem with handling registration properly.
There are 2 methods in C2DMMessaging class which I have to use: firstly register() and next getRegistrationID(). If I use them sequentially, I get null form the getRegistrationID(). The problem is registration is asynchronous. In my application in the beginning I need to know the regidtrationId, I can start the rest of the app only after I get it.
I tried to do some synchronization using monitors (i.e. wait() in register method and notify() in C2DMReceiver.onRegistered()), but it didn't work (the code of onRegistered() hasn't been reached, after calling wait() in register()).
In other words what I need is making registration synchronous, so I could continue, only after I get registrationId. What is the right way to do it?
Make sure you are following below guidelines:
To develop and test on the Android Emulator, you need to download the Android 2.2 version of the Google APIs Add-On into your SDK.
Make sure you set android:minSdkVersion="8" in the manifest.
Make sure you have at least one Google account synced on your emulator or device.

Calling native Android kernel function from user code

As my Motorola i1 refuses to light its LED in the usual programmatic way (using NotificationManager with LED on specified), I've dived into Android Cupcake's source code and found out that the native applications such as Calendar & Messaging do this using NotificationManagerService, which uses
IHardwareService.setLedState()
which, in turn, calls the
setLightFlashing_UNCHECKED()
function of the kernel (or is it a component other than the kernel?).
How do I either instantiate the HardwareService implementing IHardwareService, or call the setLightFlashing_UNCHECKED myself?
You can't, applications don't have permission to directly access such hardware.

Categories

Resources