Show call icon when outside in-call screen
To suppress icon flicker in in-call screen we had
I43625f4f69ce75c662c211dadc7292fb14641073, while it may
dismiss the icon when we definitely need it.
The problem happens when:
- the user bails out of the in-call screen during making an outgoing
call.
- the screen becomes turned off (maybe by prox sensor)
- the call is answered at that moment
- the user starts seeing the screen again
With this sequence there becomes almost no way to go back to in-call
screen (though there's only one unintuitive way to do that; go to
dialer and choose "go back to in-call screen" choice from dialpad
chooser)
In the sequence above, updateInCallNotification() is called (per
telephony's call back) while the screen is actually turned off.
mPowerManager#isScreenOn() returns false, which makes NotificationMgr
choose not to show the notification.
.. But wait, we *should* show the icon anyway even when the screen is
off, because the user is logically outside the in-call screen.
The new (and hacky) method isShowingCallScreenForProximity() allows
the app to detect if the user is in in-call screen or not, so let's
use the method instead of isShowingCallScreen().
TESTED (based on the tests described in the change above):
- While on a call, with in-call UI visible, trigger prox sensor several
times
==> no glitches; icon is never visible.
- While on a call, bail out to Home screen, then, trigger prox sensor
several times
==> no glitches; icon is steadily visible whenever the screen is on.
- Launched an outgoing call
==> no glitches; icon doesn't appear at all (even as a brief flicker)
during the transition from the dialer to the InCallScreen.
- Incoming call
==> no glitches; icon is visible while ringing (which is WAI),
disappears cleanly when you answer the call.
(new sequence)
- Make an outgoing call, before it being answered, bail out of the
screen. Then turn off the screen using prox sensor (the device must be
put vertically to enable the sensor). See the screen after the phone
is answered.
==> the icon should be shown there.
Bug: 6303484
Change-Id: Id5f7dd711037b28a4dc5b431ec02dbb819fcefe8
1 file changed