From 0669edddaea6db17f4678c53df120cb2a3ce4e16 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Wed, 25 Mar 2015 22:01:57 -0400 Subject: [PATCH] Notify plugins of pause/resume before queing JS event (no-op) This is actually already the order things happen in since JS events are async. Might as well be clearer about it. --- framework/src/org/apache/cordova/CordovaWebViewImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java index ed9d9da1..04bc1dd4 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java +++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java @@ -426,9 +426,8 @@ public class CordovaWebViewImpl implements CordovaWebView { if (!isInitialized()) { return; } - LOG.d(TAG, "Handle the pause"); - sendJavascriptEvent("pause"); pluginManager.onPause(keepRunning); + sendJavascriptEvent("pause"); // If app doesn't want to run in background if (!keepRunning) { @@ -444,8 +443,8 @@ public class CordovaWebViewImpl implements CordovaWebView { // Resume JavaScript timers. This affects all webviews within the app! engine.setPaused(false); - sendJavascriptEvent("resume"); this.pluginManager.onResume(keepRunning); + sendJavascriptEvent("resume"); } @Override