use of com.aviary.android.feather.library.plugins.PluginUpdaterTask in project mobile-android by photo.
the class FilterManager method updateInstalledPlugins.
private void updateInstalledPlugins(Bundle extras) {
logger.info("updateInstalledPlugins");
ThreadPoolService background = getService(ThreadPoolService.class);
if (background != null) {
final boolean externalItemsEnabled = Constants.getExternalPacksEnabled();
FutureListener<PluginFetchTask.Result> listener = new FutureListener<PluginFetchTask.Result>() {
@Override
public void onFutureDone(Future<PluginFetchTask.Result> future) {
PluginFetchTask.Result result;
try {
result = future.get();
} catch (Throwable t) {
logger.error(t.getMessage());
return;
}
mPluingsHandler.post(new PluginTaskCompletedRunnable(result));
}
};
BackgroundCallable<Bundle, PluginFetchTask.Result> task;
if (null == extras) {
// first time
task = new PluginFetchTask();
} else {
// when a plugin is changed
task = new PluginUpdaterTask(externalItemsEnabled ? mPluingsHandler : null);
}
background.submit(task, listener, extras);
} else {
logger.error("failed to retrieve ThreadPoolService");
}
}
Aggregations