Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1948D1161B for ; Thu, 10 Jul 2014 20:39:05 +0000 (UTC) Received: (qmail 81401 invoked by uid 500); 10 Jul 2014 20:39:05 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 81382 invoked by uid 500); 10 Jul 2014 20:39:05 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 81324 invoked by uid 99); 10 Jul 2014 20:39:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jul 2014 20:39:04 +0000 Date: Thu, 10 Jul 2014 20:39:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-7104) Plugin results not transmitted back to devices (specially Samsung S4 and S5) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-7104?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1405792= 4#comment-14057924 ]=20 ASF GitHub Bot commented on CB-7104: ------------------------------------ Github user nolanlawson commented on the pull request: https://github.com/apache/cordova-android/pull/105#issuecomment-4866061= 8 =20 Hmm, sounds like you actually have a different issue. This isn't Samsun= g-only from what I saw (repro'd on LG Nexus 5). > Plugin results not transmitted back to devices (specially Samsung S4 and = S5) > -------------------------------------------------------------------------= --- > > Key: CB-7104 > URL: https://issues.apache.org/jira/browse/CB-7104 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 3.3.0 > Reporter: H=C3=A5kon Nilsen > Priority: Blocker > Labels: patch > > Our app relies heavily on Cordova plugins for communicating between JavaS= cript and native, and on certain devices these messages are not consistentl= y sent back to the JavaScript API. > I've tracked it down to a problem with webView.setNetworkAvailable()-usag= e in NativeToJsMessageQueue.java, and I have a suggestion for a fix. > The problem with the current setup of (3.3.0) of NativeToJsMessageQueue s= eems to be that the online flag is toggled every time a plugin is fired, wh= ile webView.setNetworkAvailable(online) is only fired if the queue has mess= ages. > Since not all plugins have messages, the online flag can be toggled twice= , and the online flag will be i.e. false for each time the command is run -= which means Cordova won't send any messages. > On Samsung S4 and S5 the hideKeyboard-event is slower or faster than othe= r devices, which results in a doble toggle of the online flag. This leads t= o the following command being sent when there is a message in the queue: > webView.setNetworkAvailable(false); // first message > webView.setNetworkAvailable(false); // second message, which is not being= sent > webView.setNetworkAvailable(false); // third message, which will be sent > For us it has been a terrible blocker, and I've made a change to the Onli= neEventsBridgeMode in NativeToJsMessageQueue.java that addresses this. -- This message was sent by Atlassian JIRA (v6.2#6252)