use of com.android.tools.idea.run.tasks.SpecificActivityLaunchTask in project intellij by bazelbuild.
the class BlazeAndroidBinaryApplicationLaunchTaskProvider method getApplicationLaunchTask.
public static LaunchTask getApplicationLaunchTask(Project project, ApplicationIdProvider applicationIdProvider, File mergedManifestFile, BlazeAndroidBinaryRunConfigurationState configState, StartActivityFlagsProvider startActivityFlagsProvider, ProcessHandlerLaunchStatus processHandlerLaunchStatus) {
try {
String applicationId = applicationIdProvider.getPackageName();
final LaunchTask launchTask;
switch(configState.getMode()) {
case BlazeAndroidBinaryRunConfigurationState.DO_NOTHING:
launchTask = null;
break;
case BlazeAndroidBinaryRunConfigurationState.LAUNCH_DEFAULT_ACTIVITY:
BlazeDefaultActivityLocator activityLocator = new BlazeDefaultActivityLocator(project, mergedManifestFile);
launchTask = new DefaultActivityLaunchTask(applicationId, activityLocator, startActivityFlagsProvider);
break;
case BlazeAndroidBinaryRunConfigurationState.LAUNCH_SPECIFIC_ACTIVITY:
launchTask = new SpecificActivityLaunchTask(applicationId, configState.getActivityClass(), startActivityFlagsProvider);
break;
case BlazeAndroidBinaryRunConfigurationState.LAUNCH_DEEP_LINK:
launchTask = new AndroidDeepLinkLaunchTask(configState.getDeepLink(), startActivityFlagsProvider);
break;
default:
launchTask = null;
break;
}
return launchTask;
} catch (ApkProvisionException e) {
LOG.error(e);
processHandlerLaunchStatus.terminateLaunch("Unable to identify application id");
return null;
}
}
Aggregations