You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/03/26 03:08:01 UTC

android commit: Notify plugins of pause/resume before queing JS event (no-op)

Repository: cordova-android
Updated Branches:
  refs/heads/master 38a8d7742 -> 0669eddda


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.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/0669eddd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/0669eddd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/0669eddd

Branch: refs/heads/master
Commit: 0669edddaea6db17f4678c53df120cb2a3ce4e16
Parents: 38a8d77
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Mar 25 22:01:57 2015 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Mar 25 22:07:50 2015 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaWebViewImpl.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/0669eddd/framework/src/org/apache/cordova/CordovaWebViewImpl.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java
index ed9d9da..04bc1dd 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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org