cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Warner (JIRA)" <>
Subject [jira] [Commented] (CB-6047) File plugin callback problem with android 4.4 kitkat
Date Wed, 23 Jul 2014 07:54:38 GMT


Werner Warner commented on CB-6047:

i am not sure if this is really correctly fixed yet in 3.5.0.
there still seems to be flaw in in class OnlineEventsBridgeMode.
occasionally webView.setNetworkAvailable will be set to the same value as before and the online/offline
event will not be fired, the message will not be passed, a callback will not be called.
(this results in indeterministic hangs of file transfers, unzip and others)
a possible direction towards a solution is to bind the toggling to the notification.
(maybe an even clearer design would be to refrain from using offline events and setNetworkAvailable
to false and true each time ?)

       private class OnlineEventsBridgeMode extends BridgeMode {
        boolean online = false;
        synchronized void notifyAndToggle() { webView.setNetworkAvailable(online); online
= !online; }
        final Runnable runnable = new Runnable() {
            public void run() {
                if (!queue.isEmpty()) {
        @Override void reset() {

> File plugin callback problem with android 4.4 kitkat
> ----------------------------------------------------
>                 Key: CB-6047
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.3.0
>         Environment: Android 4.4
> dev windows
> IDE Eclipse
> Cordova 3.3
>            Reporter: *robin
>            Assignee: Andrew Grieve
>             Fix For: 3.5.0
>         Attachments:
> I've try to use the file plugin on my android phone in 4.4 but I've got some strange
problem with the callback function, succeed or fail. 
> When I try to access fileSystem (window.requestFileSystem)
> The first time I don't receive the callback. But If I try a second time I've got 2 callBack.

> I've try to debug the case. I 've figure that the 2 thread executing in java (JavaBind
and file plugin) are synchronise on the NativeToJsMessageQueue. When the plugin enqueue Message
and the java bind pop Message. 
> But I think the javabind finished before the file plugin, and never see the message in
the queue. But the second time, I've got the 2 messages.
> I think this is the same problem describe here :
> Thx

This message was sent by Atlassian JIRA

View raw message