Open Bug 712396 Opened 9 years ago Updated 9 years ago
Filter battery change notifications centrally
From https://bugzilla.mozilla.org/show_bug.cgi?id=696042#c25 "We're going to want to filter these change notifications. There's code in the android backend to do this, but it should be centralized. Let's file a followup to centralize it."
FWIW, when there is a notification sent from hal to the DOM, there is no DOM event sent if there is no real change. Filtering will only prevent doing the hal to DOM path. I did filter that on Android because it goes trough JNI and IPC. I don't know how critical this path is for B2G.
Let's try to share this code centrally in hal if possible, so the logic is the same. Same with estimating remaining battery, if the system doesn't do it for us. The dispatch path on android is more expensive than the gonk path so we may be forced to filter earlier on android. But let's measure.
Summary: Filter battery change notifications on gonk → Filter battery change notifications centrally
s/dispatch path/platform-to-hal path/
Should be easy to do: we should just compare the data we get in NotifyFooInformation with the currently cached data (in Hal.cpp).
Yep. Same for remaining time estimation; if the incoming data has a sentinel value for remainingTime, then we compute it in Hal.cpp.
You need to log in before you can comment on or make changes to this bug.