Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
io.flutter.embedding.engine.FlutterShellArgs Class Reference

Public Member Functions

 FlutterShellArgs (@NonNull String[] args)
 
 FlutterShellArgs (@NonNull List< String > args)
 
 FlutterShellArgs (@NonNull Set< String > args)
 
void add (@NonNull String arg)
 
void remove (@NonNull String arg)
 
String[] toArray ()
 

Static Public Member Functions

static FlutterShellArgs fromIntent (@NonNull Intent intent)
 

Static Public Attributes

static final String ARG_KEY_TRACE_STARTUP = "trace-startup"
 
static final String ARG_TRACE_STARTUP = "--trace-startup"
 
static final String ARG_KEY_START_PAUSED = "start-paused"
 
static final String ARG_START_PAUSED = "--start-paused"
 
static final String ARG_KEY_DISABLE_SERVICE_AUTH_CODES = "disable-service-auth-codes"
 
static final String ARG_DISABLE_SERVICE_AUTH_CODES = "--disable-service-auth-codes"
 
static final String ARG_KEY_ENDLESS_TRACE_BUFFER = "endless-trace-buffer"
 
static final String ARG_ENDLESS_TRACE_BUFFER = "--endless-trace-buffer"
 
static final String ARG_KEY_USE_TEST_FONTS = "use-test-fonts"
 
static final String ARG_USE_TEST_FONTS = "--use-test-fonts"
 
static final String ARG_KEY_ENABLE_DART_PROFILING = "enable-dart-profiling"
 
static final String ARG_ENABLE_DART_PROFILING = "--enable-dart-profiling"
 
static final String ARG_KEY_ENABLE_SOFTWARE_RENDERING = "enable-software-rendering"
 
static final String ARG_ENABLE_SOFTWARE_RENDERING = "--enable-software-rendering"
 
static final String ARG_KEY_SKIA_DETERMINISTIC_RENDERING = "skia-deterministic-rendering"
 
static final String ARG_SKIA_DETERMINISTIC_RENDERING = "--skia-deterministic-rendering"
 
static final String ARG_KEY_TRACE_SKIA = "trace-skia"
 
static final String ARG_TRACE_SKIA = "--trace-skia"
 
static final String ARG_KEY_TRACE_SKIA_ALLOWLIST = "trace-skia-allowlist"
 
static final String ARG_TRACE_SKIA_ALLOWLIST = "--trace-skia-allowlist="
 
static final String ARG_KEY_TRACE_SYSTRACE = "trace-systrace"
 
static final String ARG_TRACE_SYSTRACE = "--trace-systrace"
 
static final String ARG_KEY_TRACE_TO_FILE = "trace-to-file"
 
static final String ARG_TRACE_TO_FILE = "--trace-to-file"
 
static final String ARG_KEY_ENABLE_IMPELLER = "enable-impeller"
 
static final String ARG_ENABLE_IMPELLER = "--enable-impeller"
 
static final String ARG_KEY_ENABLE_VULKAN_VALIDATION = "enable-vulkan-validation"
 
static final String ARG_ENABLE_VULKAN_VALIDATION = "--enable-vulkan-validation"
 
static final String ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION
 
static final String ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION
 
static final String ARG_KEY_CACHE_SKSL = "cache-sksl"
 
static final String ARG_CACHE_SKSL = "--cache-sksl"
 
static final String ARG_KEY_PURGE_PERSISTENT_CACHE = "purge-persistent-cache"
 
static final String ARG_PURGE_PERSISTENT_CACHE = "--purge-persistent-cache"
 
static final String ARG_KEY_VERBOSE_LOGGING = "verbose-logging"
 
static final String ARG_VERBOSE_LOGGING = "--verbose-logging"
 
static final String ARG_KEY_VM_SERVICE_PORT = "vm-service-port"
 
static final String ARG_VM_SERVICE_PORT = "--vm-service-port="
 
static final String ARG_KEY_OBSERVATORY_PORT = "observatory-port"
 
static final String ARG_KEY_DART_FLAGS = "dart-flags"
 
static final String ARG_DART_FLAGS = "--dart-flags"
 

Detailed Description

Arguments that can be delivered to the Flutter shell when it is created.

The term "shell" refers to the native code that adapts Flutter to different platforms. Flutter's Android Java code initializes a native "shell" and passes these arguments to that native shell when it is initialized. See io.flutter.embedding.engine.loader.FlutterLoader#ensureInitializationComplete(Context, String[]) for more information.

Definition at line 22 of file FlutterShellArgs.java.

Constructor & Destructor Documentation

◆ FlutterShellArgs() [1/3]

io.flutter.embedding.engine.FlutterShellArgs.FlutterShellArgs ( @NonNull String[]  args)
inline

Creates a set of Flutter shell arguments from a given String[] array. The given arguments are automatically de-duplicated.

Definition at line 161 of file FlutterShellArgs.java.

161 {
162 this.args = new HashSet<>(Arrays.asList(args));
163 }

◆ FlutterShellArgs() [2/3]

io.flutter.embedding.engine.FlutterShellArgs.FlutterShellArgs ( @NonNull List< String >  args)
inline

Creates a set of Flutter shell arguments from a given List<String>. The given arguments are automatically de-duplicated.

Definition at line 169 of file FlutterShellArgs.java.

169 {
170 this.args = new HashSet<>(args);
171 }

◆ FlutterShellArgs() [3/3]

io.flutter.embedding.engine.FlutterShellArgs.FlutterShellArgs ( @NonNull Set< String >  args)
inline

Creates a set of Flutter shell arguments from a given Set<String>.

Definition at line 174 of file FlutterShellArgs.java.

174 {
175 this.args = new HashSet<>(args);
176 }

Member Function Documentation

◆ add()

void io.flutter.embedding.engine.FlutterShellArgs.add ( @NonNull String  arg)
inline

Adds the given arg to this set of arguments.

Parameters
argargument to add

Definition at line 183 of file FlutterShellArgs.java.

183 {
184 args.add(arg);
185 }

◆ fromIntent()

static FlutterShellArgs io.flutter.embedding.engine.FlutterShellArgs.fromIntent ( @NonNull Intent  intent)
inlinestatic

Definition at line 70 of file FlutterShellArgs.java.

70 {
71 // Before adding more entries to this list, consider that arbitrary
72 // Android applications can generate intents with extra data and that
73 // there are many security-sensitive args in the binary.
74 // TODO(mattcarroll): I left this warning as-is, but we should clarify what exactly this warning
75 // is warning against.
76 ArrayList<String> args = new ArrayList<>();
77
78 if (intent.getBooleanExtra(ARG_KEY_TRACE_STARTUP, false)) {
80 }
81 if (intent.getBooleanExtra(ARG_KEY_START_PAUSED, false)) {
83 }
84 int vmServicePort = intent.getIntExtra(ARG_KEY_VM_SERVICE_PORT, 0);
85 if (vmServicePort > 0) {
86 args.add(ARG_VM_SERVICE_PORT + Integer.toString(vmServicePort));
87 } else {
88 // TODO(bkonyi): remove once flutter_tools no longer uses this option.
89 // See https://github.com/dart-lang/sdk/issues/50233
90 vmServicePort = intent.getIntExtra(ARG_KEY_OBSERVATORY_PORT, 0);
91 if (vmServicePort > 0) {
92 args.add(ARG_VM_SERVICE_PORT + Integer.toString(vmServicePort));
93 }
94 }
95 if (intent.getBooleanExtra(ARG_KEY_DISABLE_SERVICE_AUTH_CODES, false)) {
97 }
98 if (intent.getBooleanExtra(ARG_KEY_ENDLESS_TRACE_BUFFER, false)) {
100 }
101 if (intent.getBooleanExtra(ARG_KEY_USE_TEST_FONTS, false)) {
103 }
104 if (intent.getBooleanExtra(ARG_KEY_ENABLE_DART_PROFILING, false)) {
106 }
107 if (intent.getBooleanExtra(ARG_KEY_ENABLE_SOFTWARE_RENDERING, false)) {
109 }
110 if (intent.getBooleanExtra(ARG_KEY_SKIA_DETERMINISTIC_RENDERING, false)) {
112 }
113 if (intent.getBooleanExtra(ARG_KEY_TRACE_SKIA, false)) {
114 args.add(ARG_TRACE_SKIA);
115 }
116 String traceSkiaAllowlist = intent.getStringExtra(ARG_KEY_TRACE_SKIA_ALLOWLIST);
117 if (traceSkiaAllowlist != null) {
118 args.add(ARG_TRACE_SKIA_ALLOWLIST + traceSkiaAllowlist);
119 }
120 if (intent.getBooleanExtra(ARG_KEY_TRACE_SYSTRACE, false)) {
122 }
123 if (intent.hasExtra(ARG_KEY_TRACE_TO_FILE)) {
124 args.add(ARG_TRACE_TO_FILE + "=" + intent.getStringExtra(ARG_KEY_TRACE_TO_FILE));
125 }
126 if (intent.getBooleanExtra(ARG_KEY_ENABLE_IMPELLER, false)) {
128 }
129 if (intent.getBooleanExtra(ARG_KEY_ENABLE_VULKAN_VALIDATION, false)) {
131 }
132 if (intent.getBooleanExtra(ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION, false)) {
134 }
135 if (intent.getBooleanExtra(ARG_KEY_CACHE_SKSL, false)) {
136 args.add(ARG_CACHE_SKSL);
137 }
138 if (intent.getBooleanExtra(ARG_KEY_PURGE_PERSISTENT_CACHE, false)) {
140 }
141 if (intent.getBooleanExtra(ARG_KEY_VERBOSE_LOGGING, false)) {
143 }
144
145 // NOTE: all flags provided with this argument are subject to filtering
146 // based on a list of allowed flags in shell/common/switches.cc. If any
147 // flag provided is not allowed, the process will immediately terminate.
148 if (intent.hasExtra(ARG_KEY_DART_FLAGS)) {
149 args.add(ARG_DART_FLAGS + "=" + intent.getStringExtra(ARG_KEY_DART_FLAGS));
150 }
151
152 return new FlutterShellArgs(args);
153 }
static final String ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ remove()

void io.flutter.embedding.engine.FlutterShellArgs.remove ( @NonNull String  arg)
inline

Removes the given arg from this set of arguments.

Parameters
argargument to remove

Definition at line 192 of file FlutterShellArgs.java.

192 {
193 args.remove(arg);
194 }

◆ toArray()

String[] io.flutter.embedding.engine.FlutterShellArgs.toArray ( )
inline

Returns a new String[] array which contains each of the arguments within this
FlutterShellArgs
.

Returns
array of arguments

Definition at line 203 of file FlutterShellArgs.java.

203 {
204 String[] argsArray = new String[args.size()];
205 return args.toArray(argsArray);
206 }

Member Data Documentation

◆ ARG_CACHE_SKSL

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_CACHE_SKSL = "--cache-sksl"
static

Definition at line 56 of file FlutterShellArgs.java.

◆ ARG_DART_FLAGS

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_DART_FLAGS = "--dart-flags"
static

Definition at line 67 of file FlutterShellArgs.java.

◆ ARG_DISABLE_SERVICE_AUTH_CODES

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_DISABLE_SERVICE_AUTH_CODES = "--disable-service-auth-codes"
static

Definition at line 28 of file FlutterShellArgs.java.

◆ ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION
static
Initial value:
=
"--dump-skp-on-shader-compilation"

Definition at line 53 of file FlutterShellArgs.java.

◆ ARG_ENABLE_DART_PROFILING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_ENABLE_DART_PROFILING = "--enable-dart-profiling"
static

Definition at line 34 of file FlutterShellArgs.java.

◆ ARG_ENABLE_IMPELLER

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_ENABLE_IMPELLER = "--enable-impeller"
static

Definition at line 48 of file FlutterShellArgs.java.

◆ ARG_ENABLE_SOFTWARE_RENDERING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_ENABLE_SOFTWARE_RENDERING = "--enable-software-rendering"
static

Definition at line 36 of file FlutterShellArgs.java.

◆ ARG_ENABLE_VULKAN_VALIDATION

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_ENABLE_VULKAN_VALIDATION = "--enable-vulkan-validation"
static

Definition at line 50 of file FlutterShellArgs.java.

◆ ARG_ENDLESS_TRACE_BUFFER

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_ENDLESS_TRACE_BUFFER = "--endless-trace-buffer"
static

Definition at line 30 of file FlutterShellArgs.java.

◆ ARG_KEY_CACHE_SKSL

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_CACHE_SKSL = "cache-sksl"
static

Definition at line 55 of file FlutterShellArgs.java.

◆ ARG_KEY_DART_FLAGS

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_DART_FLAGS = "dart-flags"
static

Definition at line 66 of file FlutterShellArgs.java.

◆ ARG_KEY_DISABLE_SERVICE_AUTH_CODES

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_DISABLE_SERVICE_AUTH_CODES = "disable-service-auth-codes"
static

Definition at line 27 of file FlutterShellArgs.java.

◆ ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION
static
Initial value:
=
"dump-skp-on-shader-compilation"

Definition at line 51 of file FlutterShellArgs.java.

◆ ARG_KEY_ENABLE_DART_PROFILING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_ENABLE_DART_PROFILING = "enable-dart-profiling"
static

Definition at line 33 of file FlutterShellArgs.java.

◆ ARG_KEY_ENABLE_IMPELLER

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_ENABLE_IMPELLER = "enable-impeller"
static

Definition at line 47 of file FlutterShellArgs.java.

◆ ARG_KEY_ENABLE_SOFTWARE_RENDERING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_ENABLE_SOFTWARE_RENDERING = "enable-software-rendering"
static

Definition at line 35 of file FlutterShellArgs.java.

◆ ARG_KEY_ENABLE_VULKAN_VALIDATION

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_ENABLE_VULKAN_VALIDATION = "enable-vulkan-validation"
static

Definition at line 49 of file FlutterShellArgs.java.

◆ ARG_KEY_ENDLESS_TRACE_BUFFER

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_ENDLESS_TRACE_BUFFER = "endless-trace-buffer"
static

Definition at line 29 of file FlutterShellArgs.java.

◆ ARG_KEY_OBSERVATORY_PORT

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_OBSERVATORY_PORT = "observatory-port"
static

Definition at line 65 of file FlutterShellArgs.java.

◆ ARG_KEY_PURGE_PERSISTENT_CACHE

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_PURGE_PERSISTENT_CACHE = "purge-persistent-cache"
static

Definition at line 57 of file FlutterShellArgs.java.

◆ ARG_KEY_SKIA_DETERMINISTIC_RENDERING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_SKIA_DETERMINISTIC_RENDERING = "skia-deterministic-rendering"
static

Definition at line 37 of file FlutterShellArgs.java.

◆ ARG_KEY_START_PAUSED

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_START_PAUSED = "start-paused"
static

Definition at line 25 of file FlutterShellArgs.java.

◆ ARG_KEY_TRACE_SKIA

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_TRACE_SKIA = "trace-skia"
static

Definition at line 39 of file FlutterShellArgs.java.

◆ ARG_KEY_TRACE_SKIA_ALLOWLIST

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_TRACE_SKIA_ALLOWLIST = "trace-skia-allowlist"
static

Definition at line 41 of file FlutterShellArgs.java.

◆ ARG_KEY_TRACE_STARTUP

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_TRACE_STARTUP = "trace-startup"
static

Definition at line 23 of file FlutterShellArgs.java.

◆ ARG_KEY_TRACE_SYSTRACE

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_TRACE_SYSTRACE = "trace-systrace"
static

Definition at line 43 of file FlutterShellArgs.java.

◆ ARG_KEY_TRACE_TO_FILE

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_TRACE_TO_FILE = "trace-to-file"
static

Definition at line 45 of file FlutterShellArgs.java.

◆ ARG_KEY_USE_TEST_FONTS

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_USE_TEST_FONTS = "use-test-fonts"
static

Definition at line 31 of file FlutterShellArgs.java.

◆ ARG_KEY_VERBOSE_LOGGING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_VERBOSE_LOGGING = "verbose-logging"
static

Definition at line 59 of file FlutterShellArgs.java.

◆ ARG_KEY_VM_SERVICE_PORT

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_VM_SERVICE_PORT = "vm-service-port"
static

Definition at line 61 of file FlutterShellArgs.java.

◆ ARG_PURGE_PERSISTENT_CACHE

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_PURGE_PERSISTENT_CACHE = "--purge-persistent-cache"
static

Definition at line 58 of file FlutterShellArgs.java.

◆ ARG_SKIA_DETERMINISTIC_RENDERING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_SKIA_DETERMINISTIC_RENDERING = "--skia-deterministic-rendering"
static

Definition at line 38 of file FlutterShellArgs.java.

◆ ARG_START_PAUSED

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_START_PAUSED = "--start-paused"
static

Definition at line 26 of file FlutterShellArgs.java.

◆ ARG_TRACE_SKIA

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_TRACE_SKIA = "--trace-skia"
static

Definition at line 40 of file FlutterShellArgs.java.

◆ ARG_TRACE_SKIA_ALLOWLIST

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_TRACE_SKIA_ALLOWLIST = "--trace-skia-allowlist="
static

Definition at line 42 of file FlutterShellArgs.java.

◆ ARG_TRACE_STARTUP

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_TRACE_STARTUP = "--trace-startup"
static

Definition at line 24 of file FlutterShellArgs.java.

◆ ARG_TRACE_SYSTRACE

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_TRACE_SYSTRACE = "--trace-systrace"
static

Definition at line 44 of file FlutterShellArgs.java.

◆ ARG_TRACE_TO_FILE

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_TRACE_TO_FILE = "--trace-to-file"
static

Definition at line 46 of file FlutterShellArgs.java.

◆ ARG_USE_TEST_FONTS

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_USE_TEST_FONTS = "--use-test-fonts"
static

Definition at line 32 of file FlutterShellArgs.java.

◆ ARG_VERBOSE_LOGGING

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_VERBOSE_LOGGING = "--verbose-logging"
static

Definition at line 60 of file FlutterShellArgs.java.

◆ ARG_VM_SERVICE_PORT

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_VM_SERVICE_PORT = "--vm-service-port="
static

Definition at line 62 of file FlutterShellArgs.java.


The documentation for this class was generated from the following file: