use of com.android.tools.idea.run.RetryingInstaller in project android by JetBrains.
the class SplitApkDeployTask method perform.
@Override
public boolean perform(@NotNull IDevice device, @NotNull LaunchStatus launchStatus, @NotNull ConsolePrinter printer) {
InstantRunBuildInfo buildInfo = myInstantRunContext.getInstantRunBuildInfo();
assert buildInfo != null;
List<InstantRunArtifact> artifacts = buildInfo.getArtifacts();
// TODO: should we pass in pm install options?
List<String> installOptions = Lists.newArrayList();
if (buildInfo.isPatchBuild()) {
// partial install
installOptions.add("-p");
installOptions.add(myInstantRunContext.getApplicationId());
}
List<File> apks = Lists.newArrayListWithExpectedSize(artifacts.size());
for (InstantRunArtifact artifact : artifacts) {
if (artifact.type == InstantRunArtifactType.SPLIT_MAIN || artifact.type == InstantRunArtifactType.SPLIT) {
apks.add(artifact.file);
}
}
RetryingInstaller.Installer installer = new SplitApkInstaller(printer, apks, installOptions);
RetryingInstaller retryingInstaller = new RetryingInstaller(myProject, device, installer, myInstantRunContext.getApplicationId(), printer, launchStatus);
boolean status = retryingInstaller.install();
if (status) {
printer.stdout("Split APKs installed");
}
assert myInstantRunContext.getBuildSelection() != null;
InstantRunStatsService.get(myProject).notifyDeployType(DeployType.SPLITAPK, myInstantRunContext, device);
return status;
}
Aggregations