cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Bond-Caron" <>
Subject RE: [Android] Question about onPause vs pauseTimers()
Date Wed, 07 Nov 2012 15:51:47 GMT
On Tue Nov 6 01:41 PM, Joe Bowser wrote:
> Hey
> Apparently the pause and resume bug still exists, and I think it's 
> caused by the pause and resume timers not being executed properly.
> I'm looking at the Private API to see what this actually does so I can 
> try and write a JUnit test for this, but I'm not clear what the 
> difference between EventHub.ON_PAUSE and EventHub.PAUSE_TIMERS is 
> exactly?  Does anyone who is more familiar with the WebKit side of 
> things know? Do we need to pause the timers if we're actually calling 
> onPause on the WebViewClassic view?
> Any ideas?

Hi Joe, here are some of my notes. The only thing I understand about
resumeTimers() is there's a potential 'refcount' bug:

-- Pause WebViewCore

Create an illusion of pausing the webView by slowing down of DOM timers
(less cpu usage / lower battery usage)
Also disables geolocation & sends 'pause' event (kPause_ANPLifecycleAction)
to webkit plugins (e.g. flash).

onPause()  EventHub.ON_PAUSE
onResume() EventHub.ON_RESUME


The interesting part is that setMinDOMTimerInterval() changes TIMER to 1s
(paused) from 0.04s (resume)

viewImpl->sendPluginEvent() sends the 'pause' event to webkit plugins and
then back to JAVA (via plugin bindings).

-- Pause WebView timers

Tries to close network connections and temporarily disables javascript

resumeTimers() EventHub.RESUME_TIMERS
pauseTimers()  EventHub.PAUSE_TIMERS

Pausing changes the *thread* priority to THREAD_PRIORITY_BACKGROUND.

Don't understand what 'JWebCoreJavaBridge' does with timers and it looks

View raw message