[B2G][Helix][camera][dingyu]The video icon(which show video recording work in background) is will not disappear after a crash in video recording

RESOLVED WONTFIX

Status

P2
normal
RESOLVED WONTFIX
5 years ago
a year ago

People

(Reporter: lecky.wanglei, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

Steps to reproduce:

1. open a camera and toggle to the video mode
2. press the capture button and then press the home button many times quickly 


Actual results:

1. a dialog box show "camera just crash" and the video icon is always show and will not disappear after 5s


Expected results:

1. the video icon(which show video recording work in background) should disappear after 5s.

Analyze the code shell.js
---------------------------------------------------------------------
(function recordingStatusTracker() {
  let gRecordingActiveCount = 0;

  Services.obs.addObserver(function(aSubject, aTopic, aData) {
    let oldCount = gRecordingActiveCount;
    if (aData == "starting") {
      gRecordingActiveCount += 1;
    } else if (aData == "shutdown") {
      gRecordingActiveCount -= 1;
    }
    
    // We need to track changes from 1 <-> 0
    if (gRecordingActiveCount + oldCount == 1) {
      shell.sendChromeEvent({
        type: 'recording-status',
        active: (gRecordingActiveCount == 1)
      });
    }
}, "recording-device-events", false);
})();
-----------------------------------------------------------------
when startRecording happens, gRecordingActiveCount will add one, and if the stopRecording happens, gRecordingActiveCount  will delete one. so if a crash happen, there is only startRecording event but have no stopRecording event, the video icon will always exist. and If i startRecording again, the gRecordingActiveCount will become 2 and can not be recovery. 

So if the camera work fine, there is no problem, but if there is a abnormal in camera, the video can not recover to normal unless rebooting the phone. so I think the following code is more  reasonable than original code.
---------------------------------------------
if (aData == "starting") {
      gRecordingActiveCount = 1;
    } else if (aData == "shutdown") {
      gRecordingActiveCount = 1;
    }
----------------------------------------------
But the above code still have a bug, if the crash happen, we need to restart a video recording to recover the video icon status
(Reporter)

Updated

5 years ago
blocking-b2g: --- → hd?
Flags: needinfo?(wchang)
Priority: -- → P2
Not blocking, but should be investigated and fixed in a future release.
blocking-b2g: hd? → ---
Flags: needinfo?(wchang)
Keywords: qawanted
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Keywords: qawanted
Resolution: --- → DUPLICATE
Duplicate of bug: 898917
(Reporter)

Comment 3

5 years ago
Jason, the bug is not a duplicate of bug 898917. we have merge the change bug 898917 in our code. Please look carefully at the Comment 0 Description.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
(Reporter)

Updated

5 years ago
blocking-b2g: --- → hd?
Flags: needinfo?(jsmith)
(In reply to lecky from comment #3)
> Jason, the bug is not a duplicate of bug 898917. we have merge the change
> bug 898917 in our code. Please look carefully at the Comment 0 Description.

No actually it is. The patch fixes the issue to ensure that we only show the video recording icon for 5 seconds after the content process is killed. The crash indicated here is irrelevant to the bug filed here - the issue is being talked about the persistent notification.
Status: UNCONFIRMED → RESOLVED
blocking-b2g: hd? → ---
Last Resolved: 5 years ago5 years ago
Flags: needinfo?(jsmith)
Resolution: --- → DUPLICATE
Duplicate of bug: 898917
Oh wait, now I understand. This is a persistent notification on a crash from using the camera recording.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
Component: Gaia::Camera → Gaia::System

Comment 6

a year ago
Firefox OS is not being worked on
Status: REOPENED → RESOLVED
Last Resolved: 5 years agoa year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.