Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Notification when calls array is ready even it's empty #207

Open
hsinyi opened this issue Aug 27, 2013 · 2 comments
Open

Notification when calls array is ready even it's empty #207

hsinyi opened this issue Aug 27, 2013 · 2 comments

Comments

@hsinyi
Copy link

hsinyi commented Aug 27, 2013

Learned from feedback from mozilla app developers, there needs a way to tell if the calls array is ready even the calls array is empty. Otherwise, how can they differentiate telephony.calls giving us an empty array because it's not ready from telephony.calls or giving us an empty array because there is no call?

The mozilla's solution is making use of the 'callschanged' event. We could just guarantee that every time app registers an oncallschanged listener, they are guaranteed to get a callback at some point. If the calls array has loaded then the app will get the event on the next tick. If the array hasn't loaded yet then the app will get the event as soon as it has.

@zolkis
Copy link
Contributor

zolkis commented Aug 27, 2013

I'd agree with how you put it on the second sentence. Do you expect that the 'callschanged' event contain the call array (sequence)? It is expected to be a short array.

@hsinyi
Copy link
Author

hsinyi commented Aug 27, 2013

In Mozilla's design, callschanged event type is TelephonyEvent containing a nullable TelephonyCall object. In the case of notifying calls array is ready, the callschanged event isn't carrying a call. Having a simple notification in the case should be fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants