Closed Bug 915071 Opened 9 years ago Closed 9 years ago

[General] [Dialer] Panel screen is still off while 2nd incoming call in dialling.

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:koi+, firefox25 wontfix, firefox26 fixed, firefox27 fixed, b2g-v1.2 fixed)

VERIFIED FIXED
1.2 C4(Nov8)
blocking-b2g koi+
Tracking Status
firefox25 --- wontfix
firefox26 --- fixed
firefox27 --- fixed
b2g-v1.2 --- fixed

People

(Reporter: hlu, Assigned: airpingu)

References

Details

(Whiteboard: [FT:RIL])

Attachments

(2 files, 2 obsolete files)

Attached file logcat.txt
[Version Info]
Gaia:     2d870100a945272824f8e42a8c52aac095fe907e
  B-D     2013-09-11 04:59:20
Gecko:    46c335b301fdb32f47e58c665190ffc41522ae00
BuildID   20130911062051
Version   26.0a1

* Symptom:
1. The panel screen is still in off mode while 2nd incoming call is dialling, user should press HW power key to wake up the panel screen and will see the incoming call screen.

* Reproduce Steps
1. Make a call to other device or MT call to DUT.
2. Wait few minutes to let panel screen to be OFF.
3. MT a second call to DUT.

* Actual results:
1. The panel screen is still in off mode while 2nd incoming call is dialling

* Expected results:
1. The panel screen should be ON and wake up to show the incoming call screen for 2nd incoming call.
blocking-b2g: --- → koi?
Whiteboard: [FT:RIL
Whiteboard: [FT:RIL → [FT:RIL]
Blocks: 890807
according to 9/25 triage result, change to koi+
blocking-b2g: koi? → koi+
When users use headset, the fix for this issue would have more benefits.
Assignee: nobody → gene.lian
Gene, please take this bug. Thanks.
Hi hlu,

I'd like to ask one question. Is it 100% reproducible? If not, what's the reproducing rate?
Flags: needinfo?(hlu)
It's 100% reproducible. Thanks.
Flags: needinfo?(hlu)
Attached patch Patch (WIP) (obsolete) — Splinter Review
This one doesn't only happen on CDMA but also GSM.
Summary: [wasabi] Panel screen is still off while 2nd incoming call in dialling. → Panel screen is still off while 2nd incoming call in dialling.
Ya, this bug is not CDMA only issue, Gene and I could also reproduce it on gsm phone. This issue might also need some gaia fixing here to wake up the screen. I can take a quick look for the possible solution.
Summary: Panel screen is still off while 2nd incoming call in dialling. → [General] [Dialer] Panel screen is still off while 2nd incoming call in dialling.
Hi Gene, it seems that we will call "requestWakeLock('screen')" to keep the screen on while recieving an incoming call: https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/js/calls_handler.js#L264
and unlock while call status change (hang up or pick up) https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/js/calls_handler.js#L275
It should cause the screen get unlocked while speaking because user pick up the phone and screen might get dark in a period of time. But it should not happend because screen should be always on while speaking, and 2nd incoming call will be displayed for sure.
The interest thing is, we got 2 differernt results in this case:
1) If the phone is locked while dial in, requestWakeLock unlock is called while speaking and screen will off after few sec;
2) If the phone is unlocked while dial in, requestWakeLock unlock is called while speaking but screen will always on; 
Could you please help investigate if there might have any problem in requestWakeLock('screen') and unlock? I'll change the screen unlock timing in gaia side, thanks.
Flags: needinfo?(gene.lian)
(In reply to Steve Chung [:steveck] from comment #9)
> Hi Gene, it seems that we will call "requestWakeLock('screen')" to keep the
> screen on while recieving an incoming call:
> https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/
> js/calls_handler.js#L264
> and unlock while call status change (hang up or pick up)
> https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/
> js/calls_handler.js#L275
> It should cause the screen get unlocked while speaking because user pick up
> the phone and screen might get dark in a period of time. But it should not
                                                           ^^^^^^^^^^^^^^^^^
> happen because screen should be always on while speaking, and 2nd incoming
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is wrong. The screen should automatically go off after speaking for a while, which doesn't affect the speaking behaviour.

> call will be displayed for sure.
> The interest thing is, we got 2 differernt results in this case:
> 1) If the phone is locked while dial in, requestWakeLock unlock is called
> while speaking and screen will off after few sec;
> 2) If the phone is unlocked while dial in, requestWakeLock unlock is called
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> while speaking but screen will always on; 
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think it will still go off after a while but with a longer period.

Please see the _reconfigScreenTimeout() function in the screen_manager.js.
Flags: needinfo?(gene.lian)
I had another interesting discover at [1]:

power.addWakeLockListener(function scm_handleWakeLock(topic, state) {
  if (topic == 'screen') {
    self._screenWakeLocked = (state == 'locked-foreground');

    if (self._screenWakeLocked)
      // Turn screen on if wake lock is acquire
      self.turnScreenOn();
    self._reconfigScreenTimeout();
  }
});

Supposing the first call is on going, then the second incoming call comes and calls requestWakeLock('screen') when

1. the screen is on, the |state| will be "locked-foreground", thus turning on the screen (again).
2. the screen is off, the |state| will be "locked-background", thus won't turn on the screen later.

[1] https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/screen_manager.js#L113
Hi Kanru, do you have any idea about comment #11? When it calls requestWakeLock('screen'), the state will have different results between screen on and off. It seems not a matter of foreground or background app. Instead, it depends on the screen was on or off.
Flags: needinfo?(kchen)
You got "locked-background" when the screen is off because we set all window to background while the screen is off. Maybe we should make the foreground app still has "locked-foreground" state..
Flags: needinfo?(kchen)
(In reply to Kan-Ru Chen [:kanru] from comment #13)
> You got "locked-background" when the screen is off because we set all window
> to background while the screen is off. Maybe we should make the foreground
> app still has "locked-foreground" state..

Just discussing around with Alive and Steve, the Gaia indeed makes every apps to be backgound when turning off the screen, which means it will fire "locked-background" event when any app wants to request screen wake lock under screen off.

I don't have a better solution than turning on the screen even for the "locked-background" event.

Thoughts?
Target Milestone: --- → 1.3 Sprint 4 - 11/8
Target Milestone: 1.3 Sprint 4 - 11/8 → 1.2 C4(Nov8)
(In reply to Gene Lian [:gene] (needinfo? encouraged) from comment #14)
> (In reply to Kan-Ru Chen [:kanru] from comment #13)
> > You got "locked-background" when the screen is off because we set all window
> > to background while the screen is off. Maybe we should make the foreground
> > app still has "locked-foreground" state..
> 
> Just discussing around with Alive and Steve, the Gaia indeed makes every
> apps to be backgound when turning off the screen, which means it will fire
> "locked-background" event when any app wants to request screen wake lock
> under screen off.
> 
> I don't have a better solution than turning on the screen even for the
> "locked-background" event.
> 
> Thoughts?

How about turn the screen on when there is a notification? This way the user will know why the screen was turned on.
(In reply to Kan-Ru Chen [:kanru] from comment #15)

> How about turn the screen on when there is a notification? This way the user
> will know why the screen was turned on.

For the 1st incoming call and the firing alarm, Gaia opens attention screen to light up the screen. For this case, we don't have that. Also, the Dialer App cannot use Screen Manager to turn on the screen, which can only be available by the System App.
Attached patch Patch (obsolete) — Splinter Review
Requiring CPU wake lock when handling CDMA call waiting. Also, rename some existing functions to make it clear.
Attachment #818412 - Attachment is obsolete: true
Attachment #823184 - Flags: review?(htsai)
Hi Steve and Alive,

Adding the codes for handling 'locked-background' in screen_manager.js

self._screenWakeLocked = (state == 'locked-foreground' ||
                           state == 'locked-background');

has some bad side-effect. Hope any of you Gaia guys can help take this to figure it out. I'll land the Gecko part first which is not really related to the Screen wake lock.
Comment on attachment 823184 [details] [diff] [review]
Patch

Review of attachment 823184 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me. Thanks!
Attachment #823184 - Flags: review?(htsai) → review+
Attached patch Patch, V1.1Splinter Review
Rebased and r=hsinyi.
Attachment #823184 - Attachment is obsolete: true
Attachment #823186 - Flags: review+
https://hg.mozilla.org/integration/b2g-inbound/rev/4aacf3bcff3c
Whiteboard: [FT:RIL] → [FT:RIL][leave_open]
https://hg.mozilla.org/mozilla-central/rev/4aacf3bcff3c
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
I used to put [leave_open] for this bug. Need Gaia guys' follow-up to figure out a better mechanism to turn on the screen for the 2nd incoming call.

Hi Alive, is that possible for you to find someone to take this?
Assignee: gene.lian → nobody
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: nobody → alive
FYI. The side effects of adding:

self._screenWakeLocked = (state == 'locked-foreground' ||
                           state == 'locked-background');

is:

1. When dialing out a phone call, the screen cannot switch to the connecting panel (stay in the number panel).
2. The 2nd in-coming call can successfully light up the screen. However, sometimes it will automatically turn off the 2nd in-coming call panel.
(In reply to Gene Lian [:gene] (needinfo? encouraged) from comment #25)
> FYI. The side effects of adding:
> 
> self._screenWakeLocked = (state == 'locked-foreground' ||
>                            state == 'locked-background');
> 
> is:
> 
> 1. When dialing out a phone call, the screen cannot switch to the connecting
> panel (stay in the number panel).
> 2. The 2nd in-coming call can successfully light up the screen. However,
> sometimes it will automatically turn off the 2nd in-coming call panel.

These sound like a dialer issue? Etienne?
(In reply to Alive Kuo [:alive] from comment #26)
> (In reply to Gene Lian [:gene] (needinfo? encouraged) from comment #25)
> > FYI. The side effects of adding:
> > 
> > self._screenWakeLocked = (state == 'locked-foreground' ||
> >                            state == 'locked-background');
> > 
> > is:
> > 
> > 1. When dialing out a phone call, the screen cannot switch to the connecting
> > panel (stay in the number panel).
> > 2. The 2nd in-coming call can successfully light up the screen. However,
> > sometimes it will automatically turn off the 2nd in-coming call panel.
> 
> These sound like a dialer issue? Etienne?

Well, not turning on the screen when a second call comes in was done on purpose, the rationale was:
* we had a _lot_ of "hanging up with your cheek" going on when the screen was turned on
* we now have an audible notification of the second call

So I'm not entirely sure why a gecko patch was landed for this bug... :/

That said, I don't think I fully understand the issue we're having now, maybe a video would help if it's not too much trouble.
:gene,:alive can you confirm what's left here to resolve this issue in 1.2 ?
Flags: needinfo?(gene.lian)
Flags: needinfo?(alive)
https://bugzilla.mozilla.org/show_bug.cgi?id=915071#c27 states this is not a bug but on purpose.
Assignee: alive → nobody
Flags: needinfo?(alive)
(In reply to Alive Kuo [:alive][NEEDINFO] from comment #29)
> https://bugzilla.mozilla.org/show_bug.cgi?id=915071#c27 states this is not a
> bug but on purpose.

That said, closing this issue.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Flags: needinfo?(gene.lian)
Would it be possible to detect the case by proximity sensor, meaning if the sensor detects object, then screen will not be on, if no(usually user is using device with earpiece), screen should be on. Wonder if this is doable. Well, let me open another bug for this.
Verified on Buri

Gaia:     ce276842c9ac1746073271fb736dfdb626a89240
Gecko:    http://hg.mozilla.org/releases/mozilla-b2g26_v1_2/rev/36c4c667b9f2
BuildID   20131121004002
Version   26.0

Also checked with earpiece case, screen will be on when 2nd call is dialing in.
Status: RESOLVED → VERIFIED
Assignee: nobody → gene.lian
You need to log in before you can comment on or make changes to this bug.