@@ -282,78 +282,50 @@ class CustomDeviceAppSession {
282282 /// For example, `_getEngineOptions(null, false, null)` will return
283283 /// `['enable-dart-profiling=true']`
284284 List <String > _getEngineOptions (DebuggingOptions debuggingOptions, bool traceStartup, String ? route) {
285- final List <String > options = < String > [];
286-
287- void addFlag (String value) {
288- options.add (value);
289- }
290-
291- addFlag ('enable-dart-profiling=true' );
292-
293- if (traceStartup) {
294- addFlag ('trace-startup=true' );
295- }
296- if (route != null ) {
297- addFlag ('route=$route ' );
298- }
299- if (debuggingOptions != null ) {
300- if (debuggingOptions.enableSoftwareRendering) {
301- addFlag ('enable-software-rendering=true' );
302- }
303- if (debuggingOptions.skiaDeterministicRendering) {
304- addFlag ('skia-deterministic-rendering=true' );
305- }
306- if (debuggingOptions.traceSkia) {
307- addFlag ('trace-skia=true' );
308- }
309- if (debuggingOptions.traceAllowlist != null ) {
310- addFlag ('trace-allowlist=${debuggingOptions .traceAllowlist }' );
311- }
312- if (debuggingOptions.traceSystrace) {
313- addFlag ('trace-systrace=true' );
314- }
315- if (debuggingOptions.endlessTraceBuffer) {
316- addFlag ('endless-trace-buffer=true' );
317- }
318- if (debuggingOptions.dumpSkpOnShaderCompilation) {
319- addFlag ('dump-skp-on-shader-compilation=true' );
320- }
321- if (debuggingOptions.cacheSkSL) {
322- addFlag ('cache-sksl=true' );
323- }
324- if (debuggingOptions.purgePersistentCache) {
325- addFlag ('purge-persistent-cache=true' );
326- }
327- // Options only supported when there is a VM Service connection between the
328- // tool and the device, usually in debug or profile mode.
329- if (debuggingOptions.debuggingEnabled) {
330- if (debuggingOptions.deviceVmServicePort != null ) {
331- addFlag ('observatory-port=${debuggingOptions .deviceVmServicePort }' );
332- }
333- if (debuggingOptions.buildInfo.isDebug) {
334- addFlag ('enable-checked-mode=true' );
335- addFlag ('verify-entry-points=true' );
336- }
337- if (debuggingOptions.startPaused) {
338- addFlag ('start-paused=true' );
339- }
340- if (debuggingOptions.disableServiceAuthCodes) {
341- addFlag ('disable-service-auth-codes=true' );
342- }
343- final String dartVmFlags = computeDartVmFlags (debuggingOptions);
344- if (dartVmFlags.isNotEmpty) {
345- addFlag ('dart-flags=$dartVmFlags ' );
346- }
347- if (debuggingOptions.useTestFonts) {
348- addFlag ('use-test-fonts=true' );
349- }
350- if (debuggingOptions.verboseSystemLogs) {
351- addFlag ('verbose-logging=true' );
352- }
353- }
354- }
355-
356- return options;
285+ final String dartVmFlags = computeDartVmFlags (debuggingOptions);
286+ return < String > [
287+ if (traceStartup)
288+ 'trace-startup=true' ,
289+ if (route != null )
290+ 'route=$route ' ,
291+ if (debuggingOptions.enableDartProfiling)
292+ 'enable-dart-profiling=true' ,
293+ if (debuggingOptions.enableSoftwareRendering)
294+ 'enable-software-rendering=true' ,
295+ if (debuggingOptions.skiaDeterministicRendering)
296+ 'skia-deterministic-rendering=true' ,
297+ if (debuggingOptions.traceSkia)
298+ 'trace-skia=true' ,
299+ if (debuggingOptions.traceAllowlist != null )
300+ 'trace-allowlist=${debuggingOptions .traceAllowlist }' ,
301+ if (debuggingOptions.traceSystrace)
302+ 'trace-systrace=true' ,
303+ if (debuggingOptions.endlessTraceBuffer)
304+ 'endless-trace-buffer=true' ,
305+ if (debuggingOptions.dumpSkpOnShaderCompilation)
306+ 'dump-skp-on-shader-compilation=true' ,
307+ if (debuggingOptions.cacheSkSL) 'cache-sksl=true' ,
308+ if (debuggingOptions.purgePersistentCache)
309+ 'purge-persistent-cache=true' ,
310+ if (debuggingOptions.debuggingEnabled) ...< String > [
311+ if (debuggingOptions.deviceVmServicePort != null )
312+ 'observatory-port=${debuggingOptions .deviceVmServicePort }' ,
313+ if (debuggingOptions.buildInfo.isDebug) ...< String > [
314+ 'enable-checked-mode=true' ,
315+ 'verify-entry-points=true' ,
316+ ],
317+ if (debuggingOptions.startPaused)
318+ 'start-paused=true' ,
319+ if (debuggingOptions.disableServiceAuthCodes)
320+ 'disable-service-auth-codes=true' ,
321+ if (dartVmFlags.isNotEmpty)
322+ 'dart-flags=$dartVmFlags ' ,
323+ if (debuggingOptions.useTestFonts)
324+ 'use-test-fonts=true' ,
325+ if (debuggingOptions.verboseSystemLogs)
326+ 'verbose-logging=true' ,
327+ ],
328+ ];
357329 }
358330
359331 /// Get the engine options for the given [debuggingOptions] ,
0 commit comments