Revert "[flutter_tools] Reland enable fast-start by default for Android (#48851)" (#49227)
diff --git a/dev/devicelab/bin/tasks/commands_test.dart b/dev/devicelab/bin/tasks/commands_test.dart
index 19d6f64..c12b4db 100644
--- a/dev/devicelab/bin/tasks/commands_test.dart
+++ b/dev/devicelab/bin/tasks/commands_test.dart
@@ -26,8 +26,7 @@
print('run: starting...');
final Process run = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
- // Fast start is disabled due to https://github.com/flutter/flutter/issues/48971.
- <String>['run', '--verbose', '--disable-service-auth-codes', '-d', device.deviceId, 'lib/commands.dart', '--no-fast-start'],
+ <String>['run', '--verbose', '--disable-service-auth-codes', '-d', device.deviceId, 'lib/commands.dart'],
);
final StreamController<String> stdout = StreamController<String>.broadcast();
run.stdout
diff --git a/dev/devicelab/bin/tasks/named_isolates_test.dart b/dev/devicelab/bin/tasks/named_isolates_test.dart
index d038d17..ff2feb6 100644
--- a/dev/devicelab/bin/tasks/named_isolates_test.dart
+++ b/dev/devicelab/bin/tasks/named_isolates_test.dart
@@ -25,9 +25,8 @@
section('Compile and run the tester app');
Completer<void> firstNameFound = Completer<void>();
Completer<void> secondNameFound = Completer<void>();
- // Fast start is disabled due to https://github.com/flutter/flutter/issues/48971.
final Process runProcess = await _run(device: device, command:
- <String>['run', '--disable-service-auth-codes', '--no-fast-start'], stdoutListener: (String line) {
+ <String>['run', '--disable-service-auth-codes'], stdoutListener: (String line) {
if (line.contains(_kFirstIsolateName)) {
firstNameFound.complete();
} else if (line.contains(_kSecondIsolateName)) {
diff --git a/dev/devicelab/bin/tasks/run_machine_concurrent_hot_reload.dart b/dev/devicelab/bin/tasks/run_machine_concurrent_hot_reload.dart
index f60a2c2..80fb3fc 100644
--- a/dev/devicelab/bin/tasks/run_machine_concurrent_hot_reload.dart
+++ b/dev/devicelab/bin/tasks/run_machine_concurrent_hot_reload.dart
@@ -48,8 +48,6 @@
'run',
'--machine',
'--verbose',
- // Fast start is disabled due to https://github.com/flutter/flutter/issues/48971.
- '--no-fast-start',
'-d',
device.deviceId,
'lib/commands.dart',
diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart
index 06f02c6..9e9aaf0 100644
--- a/dev/devicelab/lib/tasks/perf_tests.dart
+++ b/dev/devicelab/lib/tasks/perf_tests.dart
@@ -719,8 +719,6 @@
print('launching $project$test on device...');
await flutter('run', options: <String>[
'--verbose',
- // Fast start is disabled due to https://github.com/flutter/flutter/issues/48971.
- '--no-fast-start',
'--${_reportedDurationTestToString(flavor)}',
'--no-resident',
'-d', device.deviceId,
diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart
index 10ae7f4..006d521 100644
--- a/packages/flutter_tools/lib/src/commands/run.dart
+++ b/packages/flutter_tools/lib/src/commands/run.dart
@@ -189,7 +189,8 @@
)
..addFlag('fast-start',
negatable: true,
- defaultsTo: true,
+ defaultsTo: false,
+ hide: true,
help: 'Whether to quickly bootstrap applications with a minimal app. '
'Currently this is only supported on Android devices. This option '
'cannot be paired with --use-application-binary.'
@@ -318,6 +319,10 @@
await super.validateCommand();
}
+ if (boolArg('fast-start') && runningWithPrebuiltApplication) {
+ throwToolExit('--fast-start is not supported with --use-application-binary');
+ }
+
devices = await findAllTargetDevices();
if (devices == null) {
throwToolExit(null);
@@ -360,9 +365,7 @@
vmserviceOutFile: stringArg('vmservice-out-file'),
// Allow forcing fast-start to off to prevent doing more work on devices that
// don't support it.
- fastStart: boolArg('fast-start')
- && !runningWithPrebuiltApplication
- && devices.every((Device device) => device.supportsFastStart),
+ fastStart: boolArg('fast-start') && devices.every((Device device) => device.supportsFastStart),
);
}
}
@@ -425,6 +428,12 @@
}
for (final Device device in devices) {
+ if (!device.supportsFastStart && boolArg('fast-start')) {
+ globals.printStatus(
+ 'Using --fast-start option with device ${device.name}, but this device '
+ 'does not support it. Overriding the setting to false.'
+ );
+ }
if (await device.isLocalEmulator) {
if (await device.supportsHardwareRendering) {
final bool enableSoftwareRendering = boolArg('enable-software-rendering') == true;
diff --git a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
index ccf8b2f..466f4c8 100644
--- a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
+++ b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
@@ -77,7 +77,7 @@
]);
fail('Expect exception');
} catch (e) {
- expect(e.toString(), isNot(contains('--fast-start is not supported with --use-application-binary')));
+ expect(e.toString(), contains('--fast-start is not supported with --use-application-binary'));
}
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
@@ -115,10 +115,10 @@
}
final BufferLogger bufferLogger = globals.logger as BufferLogger;
- expect(bufferLogger.statusText, isNot(contains(
+ expect(bufferLogger.statusText, contains(
'Using --fast-start option with device mockdevice, but this device '
'does not support it. Overriding the setting to false.'
- )));
+ ));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
ProcessManager: () => FakeProcessManager.any(),