Closed Bug 1615498 Opened 6 years ago Closed 6 years ago

After navigating away from cnn.com, GeckoView keeps receiving sensor events and wasting battery, and becomes unquittable

Categories

(GeckoView :: General, defect, P1)

defect

Tracking

(Performance Impact:?, firefox75 fixed)

RESOLVED FIXED
mozilla75
Performance Impact ?
Tracking Status
firefox75 --- fixed

People

(Reporter: mstange, Assigned: esawin)

References

(Blocks 1 open bug)

Details

(Keywords: power, Whiteboard: [geckoview:m75])

Attachments

(1 file)

This one's a doozy.

Steps to reproduce:

  1. Open Firefox Preview Nightly or GeckoView-example.
  2. Navigate to cnn.com and wait for it to load.
  3. In the same tab, navigate to google.com.
  4. Press the device home button to leave the app.
  5. Attempt to shut down the app via the close button in Android's app switcher. The app is now gone from the app switcher.
  6. Switch off the screen with the power button.

Expected results:
The app should have shut down.

Actual results:
You can still see the browser on about:debugging. And here's a profile: https://perfht.ml/31QuWrY
We're waking up the CPU every 5ms to send NotifySensorChange events to our content processes! Even while the screen is off! What!

Blocks: 1604930
Priority: -- → P1
Whiteboard: [qf] → [qf] [geckoview:m75]
Assignee: nobody → esawin

cnn.com has THEOplayer as one of its dependencies, which iterates through all the sensor devices and attaches listeners.

When the session is set inactive, we suspend the window and remove all event listeners properly.

However, we miss to detach the sensor listeners when closing nsGlobalWindowInner on navigation.
We have to ensure that all device event listeners are removed when closing the window.

Pushed by esawin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d805e81bf04e [1.0] Remove all window event listener before disconnecting the manager. r=smaug
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Performance Impact: --- → ?
Whiteboard: [qf] [geckoview:m75] → [geckoview:m75]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: