use of com.android.tools.idea.run.tasks.UpdateSessionTasksProvider in project android by JetBrains.
the class AndroidLaunchTasksProviderFactory method get.
@NotNull
@Override
public LaunchTasksProvider get() {
Project project = myEnv.getProject();
InstantRunStatsService.get(project).notifyDeployStarted();
InstantRunBuildAnalyzer analyzer = null;
InstantRunBuildInfo instantRunBuildInfo = myInstantRunContext != null ? myInstantRunContext.getInstantRunBuildInfo() : null;
if (instantRunBuildInfo != null) {
analyzer = new InstantRunBuildAnalyzer(project, myInstantRunContext, myPreviousSessionProcessHandler);
if (InstantRunSettings.isRecorderEnabled()) {
if (!myDeviceFutures.getDevices().isEmpty()) {
// Instant Run is guaranteed to be for exactly 1 device
FlightRecorder.get(project).setLaunchTarget(myDeviceFutures.getDevices().get(0));
}
FlightRecorder.get(project).saveBuildInfo(instantRunBuildInfo);
}
}
if (analyzer != null && analyzer.canReuseProcessHandler()) {
return new UpdateSessionTasksProvider(analyzer);
}
return new AndroidLaunchTasksProvider(myRunConfig, myEnv, myFacet, analyzer, myApplicationIdProvider, myApkProvider, myLaunchOptions);
}
Aggregations