Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 078E9D540 for ; Thu, 20 Sep 2012 20:57:09 +0000 (UTC) Received: (qmail 56600 invoked by uid 500); 20 Sep 2012 20:57:08 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 56569 invoked by uid 500); 20 Sep 2012 20:57:08 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 56518 invoked by uid 99); 20 Sep 2012 20:57:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2012 20:57:08 +0000 Date: Fri, 21 Sep 2012 07:57:08 +1100 (NCT) From: "Joe Bowser (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <573380498.104720.1348174628290.JavaMail.jiratomcat@arcas> In-Reply-To: <995343470.4680.1346121967893.JavaMail.jiratomcat@arcas> Subject: [jira] [Assigned] (CB-1286) Cordova 2.1 callbacks stops working after sleep/wake with jQuery Mobile + Android Transformer Pad MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Bowser reassigned CB-1286: ------------------------------ Assignee: Joe Bowser (was: Andrew Grieve) > Cordova 2.1 callbacks stops working after sleep/wake with jQuery Mobile + Android Transformer Pad > ------------------------------------------------------------------------------------------------- > > Key: CB-1286 > URL: https://issues.apache.org/jira/browse/CB-1286 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 2.0.0 > Environment: Android 4.0.3; Asus Transformer Pad, > Reporter: Walter Nicholls > Assignee: Joe Bowser > Attachments: TPadBug-debug.apk, TPadBug-src.zip > > > Using attached sample app, program works up until tablet goes to sleep. When the tablet wakes up, callback no longer functions > Full thread of original problem report: https://groups.google.com/forum/?fromgroups=#!topic/phonegap/ut3RqEgDx58 > I started with Cordova 2.0.0, then while investigating upgraded to development code from github and struck an introduced, now fixed, problem. SO I am now back to the original issue but with latest code (2.1 RC) > Steps to reproduce: > ------------------ > 1. Install attached APK file (I also include source in separate zip (includes cordova.jar file), and run program. > 2. Touch the "dialog" button > OBSERVED: Text says "mary had a little lamb..." ( result from plugin) > 3. Touch "Close" to return to front screen > 4. Wait for the tablet to go to sleep and disconnect from network etc - takes about 5 minutes with my tablet as it is configured. (screen going dark is not enough, it has to shut down into deep sleep) > 5. Wake the tablet and unlock screen > 6. Touch the "dialog" buitton again. > EXPECTED: Text "mary had a little lamb..." again > but OBSERVED: Text "if you are reading this something went wrong" > What seems to be happening > --------------------------- > The way the dialog works is that the "something wrong" message is the text in the HTML file, but the page show functions calls a plugin to get the text to show. This is all handled by jQuery Mobile with an ajax load. > Until the deep sleep point, everything works as expected, the plugin returns a result which is placed in the queue, then the setTimeout()-based Javascript side picks it up. > After deep sleep, the callback mechanism breaks, and although the plugin is called and produces a result, this is never collected from Javascript. > I watch the log with the command : > adb logcat -v time | grep -E "Cordova|Callback|DroidGap|TPadBug" > So while it is working... > 8-28 14:15:32.180 D/DroidGap(29867): onMessage(onPageFinished,file:///android_asset/www/index.html#/android_asset/www/index.html&ui-state=dialog) > 08-28 14:15:32.200 D/CordovaLog(29867): Dialog is about to call plugin > 08-28 14:15:32.200 D/CordovaLog(29867): file:///android_asset/www/tpadbug2.js: Line 44 : Dialog is about to call plugin > 08-28 14:15:32.200 D/TPadBugPlugin(29867): Enter plugin action:GetRandomText > 08-28 14:15:32.200 D/TPadBugPlugin(29867): Plugin successful > 08-28 14:15:32.200 D/TPadBugPlugin(29867): Plugin exiting > 08-28 14:15:32.250 D/CordovaLog(29867): Dialog has got results back from plugin: 102 chars > 08-28 14:15:32.250 D/CordovaLog(29867): file:///android_asset/www/tpadbug2.js: Line 47 : Dialog has got results back from plugin: 102 chars > 08-28 14:15:35.770 D/Cordova (29867): onPageFinished(file:///android_asset/www/index.html) > Note particular the "Dialog has got results back.." which shows the JS callback working. > After a sleep/resume cycle: > 08-28 14:23:05.880 D/DroidGap(29867): onMessage(onPageFinished,file:///android_asset/www/index.html#/android_asset/www/index.html&ui-state=dialog) > 08-28 14:23:05.900 D/CordovaLog(29867): Dialog is about to call plugin > 08-28 14:23:05.900 D/CordovaLog(29867): file:///android_asset/www/tpadbug2.js: Line 44 : Dialog is about to call plugin > 08-28 14:23:05.900 D/TPadBugPlugin(29867): Enter plugin action:GetRandomText > 08-28 14:23:05.900 D/TPadBugPlugin(29867): Plugin successful > 08-28 14:23:05.900 D/TPadBugPlugin(29867): Plugin exiting > .. and nothing more, no dialog handler. > (I did have a lot of console.log and Log.d calls as well, but these got lost in some of the test and updating to latest code. Read Google Groups thread for the agonizing detail). > Needless to say, this stops my app in its tracks. > I left an additional page for "test timeouts" which if you navigate to this, it shows that callbacks are once again working, and then when you go back (using the android back button) to the indexpage, the callbacks start working there again too .. until the next time it falls sleep. However this is not an acceptable solution for a production app. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira