Fix custom am start options regression in AS41.
Due to a merge the code for including custom am start options from
run configurations was accidentally removed.  This CL adds it back.
@@ -132,14 +132,12 @@ public class BlazeAndroidLaunchTasksProvider implements LaunchTasksProvider {
launchTasks.add(new CheckApkDebuggableTask(runContext.getBuildStep().getDeployInfo()));
}
- StringBuilder amStartOptions = new StringBuilder();
-
+ ImmutableList.Builder<String> amStartOptions = ImmutableList.builder();
+ amStartOptions.add(runContext.getAmStartOptions());
if (isProfilerLaunch(launchOptions)) {
- String amOptions =
+ amStartOptions.add(
AndroidProfilerLaunchTaskContributor.getAmStartOptions(
- project, packageName, launchOptions, device);
- amStartOptions.append(amStartOptions.length() == 0 ? "" : " ").append(amOptions);
-
+ project, packageName, launchOptions, device));
launchTasks.add(
new AndroidProfilerLaunchTaskContributor.AndroidProfilerToolWindowLaunchTask(
project, launchOptions, packageName));
@@ -151,7 +149,7 @@ public class BlazeAndroidLaunchTasksProvider implements LaunchTasksProvider {
runContext.getApplicationLaunchTask(
launchOptions,
userId,
- amStartOptions.toString(),
+ String.join(" ", amStartOptions.build()),
debuggerManager.getAndroidDebugger(),
debuggerManager.getAndroidDebuggerState(project),
processHandlerLaunchStatus);
