Unexpected value of Android CallLog.Calls TYPE
Asked Answered
N

3

6

I have an Android (2.x) app that read call logs from CallLog.Calls.CONTENT_URI.

Recently I got an error report that get an unexpected value from TYPE field. I assume in the source code that the values should always be 1, 2, 3 (CallLog.Calls.INCOMING_TYPE, CallLog.Calls.OUTGOING_TYPE, and CallLog.Calls.MISSING_TYPE repectively)

Unfortunately I don't have information about the actual value I got. My problem is, what are the possible values of the TYPE field beyond the above three? The Android javadoc explicitly stated "The type of the call (incoming, outgoing or missed)"

Nary answered 17/3, 2011 at 10:49 Comment(0)
K
15

There are more types outside of the standard Incoming(1), Outgoing(2) and Missed(3). So far I have encountered 4 (VoiceMail), 5 (Rejected) and 6 (Refused List).

Khanna answered 29/6, 2012 at 15:24 Comment(4)
what the refused list means in android calllog ?Hearse
@Hearse maybe block contact listHorrendous
I would like to know the direction of the different codes. Is voicemail(4) and rejected(5) incoming calls and missed(3) outgoing?Rorry
Are these other codes, particularly 5 and 6, documented anywhere?Magbie
B
4
   final static int Rejected = 5;
   final static int Refused_List = 6;
   final static int Voice_Mail = 4;
Blackguard answered 2/12, 2014 at 13:6 Comment(3)
I would like to know the direction of the different codes. Is voicemail(4) and rejected(5) incoming calls and missed(3) outgoing?Rorry
On a LYF device I am getting 6 for outgoing!Afterword
Hi, I am a bit confused because based on the documentation here, developer.android.com/reference/android/provider/… . If you put the api below 24, you see REJECT_TYPE grayed out. Why does 5 still come back as a type then?Ouellette
B
2

Use the defined values, not discrete literal values:

CallLog.Calls.OUTGOING_TYPE
CallLog.Calls.INCOMING_TYPE
CallLog.Calls.MISSED_TYPE
Balanced answered 13/7, 2011 at 22:49 Comment(1)
the only problem with that is that some values are missing here (take a look at thinkpanda's answer)Prosthetics

© 2022 - 2024 — McMap. All rights reserved.