Search in sources :

Example 1 with UpdateSessionTasksProvider

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);
}
Also used : InstantRunBuildInfo(com.android.tools.fd.client.InstantRunBuildInfo) Project(com.intellij.openapi.project.Project) UpdateSessionTasksProvider(com.android.tools.idea.run.tasks.UpdateSessionTasksProvider) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

InstantRunBuildInfo (com.android.tools.fd.client.InstantRunBuildInfo)1 UpdateSessionTasksProvider (com.android.tools.idea.run.tasks.UpdateSessionTasksProvider)1 Project (com.intellij.openapi.project.Project)1 NotNull (org.jetbrains.annotations.NotNull)1