cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-7109) exec() call to plugin blocked the main thread
Date Mon, 05 Jan 2015 19:53:34 GMT


ASF GitHub Bot commented on CB-7109:

GitHub user clelland opened a pull request:

    CB-7109: Android: Parse arguments off of the main thread


You can merge this pull request into a Git repository by running:

    $ git pull CB-7109

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #97
commit f9f10fdffff6fdf200c2d99adc82ff7261e8e72a
Author: Ian Clelland <>
Date:   2015-01-05T19:52:40Z

    CB-7109: Android: Parse arguments off of the main thread


> exec() call to plugin blocked the main thread
> ---------------------------------------------
>                 Key: CB-7109
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin File
>    Affects Versions: 3.5.0
>            Reporter: Rajesh Kumar
>            Priority: Minor
> In the file plugin of v3.5.0, I constantly see a warning in logcat in eclipse when I
try to write to a file. The warning is:
> THREAD WARNING: exec() call to File.write blocked the main thread for 117ms. Plugin should
use CordovaInterface.getThreadPool().
> Similar issue is when I try to exit app. I guess this issue is present for all the plugins.
I checked the part of File plugin code:
> final String fname=args.getString(0);
>             final String data=args.getString(1);
>             final int offset=args.getInt(2);
>             final Boolean isBinary=args.getBoolean(3);
>             threadhelper( new FileOp( ){
>                 public void run() throws FileNotFoundException, IOException, NoModificationAllowedException
>                     long fileSize = write(fname, data, offset, isBinary);
>                     callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK,
>                 }
>             }, callbackContext);
> And, threadhelper uses: 
> cordova.getThreadPool().execute(new Runnable() {
>     public void run() {}
> });
> This means, the plugin is using a thread to do some async task, but logcat throws the
block warning. We need to fix this.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message