Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
 
static final String ARG_KEY_MSAA_SAMPLES = "msaa-samples"
 
static final String ARG_MSAA_SAMPLES = "--msaa-samples"
 

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 167 of file FlutterShellArgs.java.

167 {
168 this.args = new HashSet<>(Arrays.asList(args));
169 }

◆ 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 175 of file FlutterShellArgs.java.

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

◆ 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 180 of file FlutterShellArgs.java.

180 {
181 this.args = new HashSet<>(args);
182 }

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 189 of file FlutterShellArgs.java.

189 {
190 args.add(arg);
191 }

◆ fromIntent()

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

Definition at line 72 of file FlutterShellArgs.java.

72 {
73 // Before adding more entries to this list, consider that arbitrary
74 // Android applications can generate intents with extra data and that
75 // there are many security-sensitive args in the binary.
76 // TODO(mattcarroll): I left this warning as-is, but we should clarify what exactly this warning
77 // is warning against.
78 ArrayList<String> args = new ArrayList<>();
79
80 if (intent.getBooleanExtra(ARG_KEY_TRACE_STARTUP, false)) {
82 }
83 if (intent.getBooleanExtra(ARG_KEY_START_PAUSED, false)) {
85 }
86 int vmServicePort = intent.getIntExtra(ARG_KEY_VM_SERVICE_PORT, 0);
87 if (vmServicePort > 0) {
88 args.add(ARG_VM_SERVICE_PORT + Integer.toString(vmServicePort));
89 } else {
90 // TODO(bkonyi): remove once flutter_tools no longer uses this option.
91 // See https://github.com/dart-lang/sdk/issues/50233
92 vmServicePort = intent.getIntExtra(ARG_KEY_OBSERVATORY_PORT, 0);
93 if (vmServicePort > 0) {
94 args.add(ARG_VM_SERVICE_PORT + Integer.toString(vmServicePort));
95 }
96 }
97 if (intent.getBooleanExtra(ARG_KEY_DISABLE_SERVICE_AUTH_CODES, false)) {
99 }
100 if (intent.getBooleanExtra(ARG_KEY_ENDLESS_TRACE_BUFFER, false)) {
102 }
103 if (intent.getBooleanExtra(ARG_KEY_USE_TEST_FONTS, false)) {
105 }
106 if (intent.getBooleanExtra(ARG_KEY_ENABLE_DART_PROFILING, false)) {
108 }
109 if (intent.getBooleanExtra(ARG_KEY_ENABLE_SOFTWARE_RENDERING, false)) {
111 }
112 if (intent.getBooleanExtra(ARG_KEY_SKIA_DETERMINISTIC_RENDERING, false)) {
114 }
115 if (intent.getBooleanExtra(ARG_KEY_TRACE_SKIA, false)) {
116 args.add(ARG_TRACE_SKIA);
117 }
118 String traceSkiaAllowlist = intent.getStringExtra(ARG_KEY_TRACE_SKIA_ALLOWLIST);
119 if (traceSkiaAllowlist != null) {
120 args.add(ARG_TRACE_SKIA_ALLOWLIST + traceSkiaAllowlist);
121 }
122 if (intent.getBooleanExtra(ARG_KEY_TRACE_SYSTRACE, false)) {
124 }
125 if (intent.hasExtra(ARG_KEY_TRACE_TO_FILE)) {
126 args.add(ARG_TRACE_TO_FILE + "=" + intent.getStringExtra(ARG_KEY_TRACE_TO_FILE));
127 }
128 if (intent.getBooleanExtra(ARG_KEY_ENABLE_IMPELLER, false)) {
130 }
131 if (intent.getBooleanExtra(ARG_KEY_ENABLE_VULKAN_VALIDATION, false)) {
133 }
134 if (intent.getBooleanExtra(ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION, false)) {
136 }
137 if (intent.getBooleanExtra(ARG_KEY_CACHE_SKSL, false)) {
138 args.add(ARG_CACHE_SKSL);
139 }
140 if (intent.getBooleanExtra(ARG_KEY_PURGE_PERSISTENT_CACHE, false)) {
142 }
143 if (intent.getBooleanExtra(ARG_KEY_VERBOSE_LOGGING, false)) {
145 }
146 final int msaaSamples = intent.getIntExtra("msaa-samples", 0);
147 if (msaaSamples > 1) {
148 args.add("--msaa-samples=" + Integer.toString(msaaSamples));
149 }
150
151 // NOTE: all flags provided with this argument are subject to filtering
152 // based on a list of allowed flags in shell/common/switches.cc. If any
153 // flag provided is not allowed, the process will immediately terminate.
154 if (intent.hasExtra(ARG_KEY_DART_FLAGS)) {
155 args.add(ARG_DART_FLAGS + "=" + intent.getStringExtra(ARG_KEY_DART_FLAGS));
156 }
157
158 return new FlutterShellArgs(args);
159 }
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 198 of file FlutterShellArgs.java.

198 {
199 args.remove(arg);
200 }

◆ 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 209 of file FlutterShellArgs.java.

209 {
210 String[] argsArray = new String[args.size()];
211 return args.toArray(argsArray);
212 }

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_MSAA_SAMPLES

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_KEY_MSAA_SAMPLES = "msaa-samples"
static

Definition at line 68 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_MSAA_SAMPLES

final String io.flutter.embedding.engine.FlutterShellArgs.ARG_MSAA_SAMPLES = "--msaa-samples"
static

Definition at line 69 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: