Search in sources :

Example 1 with ExternalPacksTask

use of com.aviary.android.feather.library.plugins.ExternalPacksTask in project mobile-android by photo.

the class FilterManager method updateAvailablePlugins.

private void updateAvailablePlugins() {
    logger.info("updateAvailablePlugins");
    ThreadPoolService background = getService(ThreadPoolService.class);
    if (null != background) {
        if (Constants.getExternalPacksEnabled()) {
            FutureListener<Bundle> listener = new FutureListener<Bundle>() {

                @Override
                public void onFutureDone(Future<Bundle> future) {
                    logger.log("updateAvailablePlugins::completed");
                    Bundle result = null;
                    try {
                        result = future.get();
                    } catch (Throwable t) {
                        logger.error(t.getMessage());
                        return;
                    }
                    mPluingsHandler.post(new ExternalPluginTaskCompletedRunnable(result));
                }
            };
            // submit the task to download the list of external content
            background.submit(new ExternalPacksTask(), listener, null);
        }
    }
}
Also used : FutureListener(com.aviary.android.feather.library.services.FutureListener) ExternalPacksTask(com.aviary.android.feather.library.plugins.ExternalPacksTask) Bundle(android.os.Bundle) ThreadPoolService(com.aviary.android.feather.library.services.ThreadPoolService) Future(java.util.concurrent.Future)

Aggregations

Bundle (android.os.Bundle)1 ExternalPacksTask (com.aviary.android.feather.library.plugins.ExternalPacksTask)1 FutureListener (com.aviary.android.feather.library.services.FutureListener)1 ThreadPoolService (com.aviary.android.feather.library.services.ThreadPoolService)1 Future (java.util.concurrent.Future)1