开发者

CallLog.Calls.NEW? What does it mean?

开发者 https://www.devze.com 2023-03-06 19:59 出处:网络
I am currently trying to figure out what CallLog.Calls.NEW means. The documentation says: Whether or not the call has been

I am currently trying to figure out what

CallLog.Calls.NEW

means.

The documentation says:

Whether or not the call has been acknowledged

( http://developer.android.com/reference/android/provider/CallLog.Calls.html#NEW ). I tried to reproduce this.

I made a call to another phone and hung up once it started ringing. What would I expect? An entry with TYPE = OUTGOING_TYPE and NEW = 0, righ开发者_StackOverflow中文版t? But NEW is 1. That really doesn't make any sense to me...

Any ideas?


See the source for it here.

The calls are always added with a NEW value of 1:

values.put(NEW, Integer.valueOf(1));

Probably, there is a method in the phone call log app or in the call notification to set it as zero. BTW, I did not look for that.


I don't know for sure but my guess would be that in your test scenario the phone you called would have TYPE = INCOMING_TYPE and NEW = 0 because the call has not yet been acknowledged on that phone. On that phone you would see the little "missed call" icon in the Notification bar. That call would be considered NEW.


In the emulator this is set to 1 for all calls, no matter if incoming or outgoing. Then if you click on a call in the call log application it will be set to zero for that single call. This field is also set to zero when you activate a missed call notification.

Therefore the meaning of this field is similar to the "unread" flag that most email programs use to flag emails that just arrived until you read them. In this case all calls that are added to the call log are flagged with NEW=1 and when they are acknowledged (i.e. "read") the flag is removed (NEW=0).

Of course this is of practical use only in the case of missed calls.


It's String. It seems to be used as a key in maps:

http://codesearch.google.com/codesearch?hl=pl&lr=&q=package%3Aandroid.git.kernel.org+Calls.NEW

The documentation describes what this key is used for.

Call values are:

    public static final int INCOMING_TYPE = 1;
    public static final int OUTGOING_TYPE = 2;
    public static final int MISSED_TYPE = 3;


On my phone (Motorola Droid2): NEW = 0 for all MISSED_TYPE calls NEW = 1 for all INCOMING_TYPE and OUTGOING_TYPE calls.

Seems to be true on the Atrix and HTC Inspire as well.


may be it's too late..hey i figured it out and the thing is if someone is calling you and you have missed that call and not returning the call then ,

CallLog.Calls.NEW=1 will be passed..

now if you are returning call to that number then

CallLog.Calls.NEW=0 will be passed..

and the same for all the type flags if you dial a number and some one is returning


I has encounted the same question.I think the NEw is just a flag that means this call has not been handled.just like a missed call,begin with NEW = 1,but when you set up a call app ,the missed call was changed with NEW = 0,and the icon in the notification bar dismissed.

0

精彩评论

暂无评论...
验证码 换一张
取 消