Closed Bug 1008104 Opened 10 years ago Closed 9 years ago

[Sora]Fire a callschanged event when suspend/resume the device with power key

Categories

(Firefox OS Graveyard :: RIL, defect)

x86
macOS
defect
Not set
normal

Tracking

(tracking-b2g:backlog)

RESOLVED DUPLICATE of bug 1036851
tracking-b2g backlog

People

(Reporter: vchen, Unassigned)

Details

Attachments

(1 file)

While suspend/resume the device with power key, sometime a callschanged event will be fired even if there is not call.
In order to trace the callschanged event, we add the log in the following place:

In Telephony.cpp

class Telephony::EnumerationAck : public nsRunnable
{
  nsRefPtr<Telephony> mTelephony;

  public:
  EnumerationAck(Telephony* aTelephony)
  : mTelephony(aTelephony)
  {
    MOZ_ASSERT(mTelephony);
  }

  NS_IMETHOD Run()
  {
    MYLOG("class Telephony::EnumerationAck : public nsRunnable Run()");
    mTelephony->NotifyCallsChanged(nullptr);
    return NS_OK;
  }
};


nsresult
Telephony::NotifyCallsChanged(TelephonyCall* aCall)
{
  MYLOG(" Telephony::NotifyCallsChanged(TelephonyCall* aCall) ");
  return DispatchCallEvent(NS_LITERAL_STRING("callschanged"), aCall);
}

The log is attached
Hi Kan -

Could you find someone to help to check why even if there is no call, the Telephony will still send out the callchanged event? Because this event will accidently trigger screen backlight sometimes...
Flags: needinfo?(kchang)
(In reply to Vance Chen [:vchen][vchen@mozilla.com] from comment #3)
> Hi Kan -
> 
> Could you find someone to help to check why even if there is no call, the
> Telephony will still send out the callchanged event? Because this event will
> accidently trigger screen backlight sometimes...

Hi Vance, I can answer this.

In TelephonyAPI, we guarantee to send at least one 'callschanged' event when a Telephony object is initiated no matter there's a call or not. This design is to help Gaia to know if 'telephony.calls' is ready. Without this design, gaia has no idea of the exact meaning of 'telephony.calls' being 0. That said, 0 could be there's indeed no call but it could also mean the initialization isn't completed so .calls is empty.

Is it clear? Thanks.
Flags: needinfo?(kchang)
Thanks Hsin-Yi, it is crystal clear, and i get one follow up question: When will the telephony object be initiated? I guess there might be quite a few circumstances, right?

Thanks

Vance
(In reply to Vance Chen [:vchen][vchen@mozilla.com] from comment #5)
> Thanks Hsin-Yi, it is crystal clear, and i get one follow up question: When
> will the telephony object be initiated? I guess there might be quite a few
> circumstances, right?
> 
> Thanks
> 
> Vance

Usually when you query "navigator.mozTelephony" for a new frame. So, yes, several circumstances, and even in one App, there could be several distinct Telephony objects.

I'd suggest reviewing the code of Screen manager to make sure the case, callschanged being fired for initialization, is correctly handled. :)
Thanks for the explanation Hsin-Yi

Hi GuoQiang - 

Hope this answers your question, shall you have further question questions, please let us know

Thanks
Flags: needinfo?(Chenguoqiang)
(In reply to Hsin-Yi Tsai  [:hsinyi] from comment #6)
> (In reply to Vance Chen [:vchen][vchen@mozilla.com] from comment #5)
> > Thanks Hsin-Yi, it is crystal clear, and i get one follow up question: When
> > will the telephony object be initiated? I guess there might be quite a few
> > circumstances, right?
> > 
> > Thanks
> > 
> > Vance
> 
> Usually when you query "navigator.mozTelephony" for a new frame. So, yes,
> several circumstances, and even in one App, there could be several distinct
> Telephony objects.
> 
> I'd suggest reviewing the code of Screen manager to make sure the case,
> callschanged being fired for initialization, is correctly handled. :)

Ok, but I still want to know why this message is sent from dom/telephone when I press power key to turnon screen. I do not make any call or insert simcard, but still can received this message, and this message is sent from Telephony.cpp.
Flags: needinfo?(Chenguoqiang)
My best guess is, somehow when you press the power key to resume the phone, a telephony object is initialized and hence trigger the callschanged event.

So I guess we should dive into the source code to see if that is the case
(In reply to Vance Chen [:vchen][vchen@mozilla.com] from comment #9)
> My best guess is, somehow when you press the power key to resume the phone,
> a telephony object is initialized and hence trigger the callschanged event.
> 
> So I guess we should dive into the source code to see if that is the case

Totally agree with Vance.
blocking-b2g: --- → backlog
We shouldn't have this issue since bug 1036851.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
blocking-b2g: backlog → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: