I do not know if you can define a temporary call, but differentiate when a call can be launched.
You can do it like this in CALL_STATE_IDLE:
Uri allCalls = Uri.parse("content://call_log/calls");
String lastMinute = String.valueOf(new Date().getTime() - DAY_IN_MILISECONDS);
Cursor c = app.getContentResolver().query(allCalls, null, Calls.DATE + " > "
+ lastMinute, null, Calls.DATE + " desc");
c.moveToFirst();
if (c.getCount() > 0) {
int duration = Integer.parseInt(c.getString(c.getColumnIndex(Calls.DURATION)));
}
if the duration is> 0, then the answer was triggered.
Obviously, there are other flags that you should use to determine that CALL_STATE_IDLE is called after the call has been made.
Hope this helps and puts you in the correct position for what you are trying to do.
source
share