use of com.google.idea.blaze.android.run.binary.BlazeAndroidBinaryLaunchMethodsProvider.AndroidBinaryLaunchMethod in project intellij by bazelbuild.
the class BlazeAndroidBinaryProgramRunner method canRun.
@Override
public boolean canRun(String executorId, RunProfile profile) {
BlazeAndroidRunConfigurationHandler handler = BlazeAndroidRunConfigurationHandler.getHandlerFrom(profile);
if (!(handler instanceof BlazeAndroidBinaryRunConfigurationHandler)) {
return false;
}
// In practice, the stock runner will probably handle all non-incremental-install configs.
if (DefaultDebugExecutor.EXECUTOR_ID.equals(executorId) || DefaultRunExecutor.EXECUTOR_ID.equals(executorId)) {
return true;
}
// Otherwise, the configuration must be a Blaze incremental install configuration running with
// an incremental install executor.
AndroidBinaryLaunchMethod launchMethod = ((BlazeAndroidBinaryRunConfigurationHandler) handler).getState().getLaunchMethod();
return (AndroidBinaryLaunchMethod.MOBILE_INSTALL.equals(launchMethod) || AndroidBinaryLaunchMethod.MOBILE_INSTALL_V2.equals(launchMethod)) && (IncrementalInstallDebugExecutor.EXECUTOR_ID.equals(executorId) || IncrementalInstallRunExecutor.EXECUTOR_ID.equals(executorId));
}
Aggregations