use of com.android.tools.idea.sdk.progress.RepoProgressIndicatorAdapter in project android by JetBrains.
the class InstallComponentsPath method createComponentTree.
private ComponentTreeNode createComponentTree(@NotNull FirstRunWizardMode reason, @NotNull ScopedStateStore stateStore, boolean createAvd) {
List<ComponentTreeNode> components = Lists.newArrayList();
components.add(new AndroidSdk(stateStore, myInstallUpdates));
DynamicWizard wizard = getWizard();
ProgressWindow progressWindow = new ProgressWindow(false, false, null);
if (wizard != null) {
Disposer.register(wizard.getDisposable(), progressWindow);
}
com.android.repository.api.ProgressIndicator progress = new RepoProgressIndicatorAdapter(progressWindow);
RepoManager sdkManager = myLocalHandler.getSdkManager(new StudioLoggerProgressIndicator(getClass()));
sdkManager.loadSynchronously(RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, progress, new StudioDownloader(progressWindow), StudioSettingsController.getInstance());
Map<String, RemotePackage> remotePackages = sdkManager.getPackages().getRemotePackages();
ComponentTreeNode platforms = Platform.createSubtree(stateStore, remotePackages, myInstallUpdates);
if (platforms != null) {
components.add(platforms);
}
if (Haxm.canRun() && reason == FirstRunWizardMode.NEW_INSTALL) {
Haxm.HaxmInstallationIntention haxmInstallationIntention = myInstallUpdates ? Haxm.HaxmInstallationIntention.INSTALL_WITH_UPDATES : Haxm.HaxmInstallationIntention.INSTALL_WITHOUT_UPDATES;
components.add(new Haxm(haxmInstallationIntention, stateStore, FirstRunWizard.KEY_CUSTOM_INSTALL));
}
if (createAvd) {
components.add(new AndroidVirtualDevice(stateStore, remotePackages, myInstallUpdates, myFileOp));
}
return new ComponentCategory("Root", "Root node that is not supposed to appear in the UI", components);
}
use of com.android.tools.idea.sdk.progress.RepoProgressIndicatorAdapter in project android by JetBrains.
the class SdkComponentSource method initIfNecessary.
private void initIfNecessary(@Nullable ProgressIndicator indicator) {
RepoManager mgr = getRepoManager();
com.android.repository.api.ProgressIndicator progress;
if (indicator != null) {
progress = new RepoProgressIndicatorAdapter(indicator);
} else {
progress = LOGGER;
}
if (mgr.loadSynchronously(TimeUnit.MINUTES.toMillis(1), progress, getDownloader(indicator), getSettingsController())) {
myPackages = mgr.getPackages();
}
}
use of com.android.tools.idea.sdk.progress.RepoProgressIndicatorAdapter in project android by JetBrains.
the class SourcesTableModel method save.
/**
* Save any changes the user has made.
*/
public void save(@NotNull ProgressIndicator progress) {
if (isSourcesModified()) {
RepositorySourceProvider userSourceProvider = getUserSourceProvider();
// we know it won't be null since otherwise we shouldn't have been editable
assert userSourceProvider != null;
userSourceProvider.save(new RepoProgressIndicatorAdapter(progress));
reset();
}
}
Aggregations