5package io.flutter.embedding.engine;
9import androidx.annotation.NonNull;
21@SuppressWarnings({
"WeakerAccess",
"unused"})
23 public static final String ARG_KEY_TRACE_STARTUP =
"trace-startup";
24 public static final String ARG_TRACE_STARTUP =
"--trace-startup";
25 public static final String ARG_KEY_START_PAUSED =
"start-paused";
26 public static final String ARG_START_PAUSED =
"--start-paused";
27 public static final String ARG_KEY_DISABLE_SERVICE_AUTH_CODES =
"disable-service-auth-codes";
28 public static final String ARG_DISABLE_SERVICE_AUTH_CODES =
"--disable-service-auth-codes";
29 public static final String ARG_KEY_ENDLESS_TRACE_BUFFER =
"endless-trace-buffer";
30 public static final String ARG_ENDLESS_TRACE_BUFFER =
"--endless-trace-buffer";
31 public static final String ARG_KEY_USE_TEST_FONTS =
"use-test-fonts";
32 public static final String ARG_USE_TEST_FONTS =
"--use-test-fonts";
33 public static final String ARG_KEY_ENABLE_DART_PROFILING =
"enable-dart-profiling";
34 public static final String ARG_ENABLE_DART_PROFILING =
"--enable-dart-profiling";
35 public static final String ARG_KEY_ENABLE_SOFTWARE_RENDERING =
"enable-software-rendering";
36 public static final String ARG_ENABLE_SOFTWARE_RENDERING =
"--enable-software-rendering";
37 public static final String ARG_KEY_SKIA_DETERMINISTIC_RENDERING =
"skia-deterministic-rendering";
38 public static final String ARG_SKIA_DETERMINISTIC_RENDERING =
"--skia-deterministic-rendering";
39 public static final String ARG_KEY_TRACE_SKIA =
"trace-skia";
40 public static final String ARG_TRACE_SKIA =
"--trace-skia";
41 public static final String ARG_KEY_TRACE_SKIA_ALLOWLIST =
"trace-skia-allowlist";
42 public static final String ARG_TRACE_SKIA_ALLOWLIST =
"--trace-skia-allowlist=";
43 public static final String ARG_KEY_TRACE_SYSTRACE =
"trace-systrace";
44 public static final String ARG_TRACE_SYSTRACE =
"--trace-systrace";
45 public static final String ARG_KEY_TRACE_TO_FILE =
"trace-to-file";
46 public static final String ARG_TRACE_TO_FILE =
"--trace-to-file";
47 public static final String ARG_KEY_ENABLE_IMPELLER =
"enable-impeller";
48 public static final String ARG_ENABLE_IMPELLER =
"--enable-impeller";
49 public static final String ARG_KEY_ENABLE_VULKAN_VALIDATION =
"enable-vulkan-validation";
50 public static final String ARG_ENABLE_VULKAN_VALIDATION =
"--enable-vulkan-validation";
51 public static final String ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION =
52 "dump-skp-on-shader-compilation";
53 public static final String ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION =
54 "--dump-skp-on-shader-compilation";
55 public static final String ARG_KEY_CACHE_SKSL =
"cache-sksl";
56 public static final String ARG_CACHE_SKSL =
"--cache-sksl";
57 public static final String ARG_KEY_PURGE_PERSISTENT_CACHE =
"purge-persistent-cache";
58 public static final String ARG_PURGE_PERSISTENT_CACHE =
"--purge-persistent-cache";
59 public static final String ARG_KEY_VERBOSE_LOGGING =
"verbose-logging";
60 public static final String ARG_VERBOSE_LOGGING =
"--verbose-logging";
61 public static final String ARG_KEY_VM_SERVICE_PORT =
"vm-service-port";
62 public static final String ARG_VM_SERVICE_PORT =
"--vm-service-port=";
65 public static final String ARG_KEY_OBSERVATORY_PORT =
"observatory-port";
66 public static final String ARG_KEY_DART_FLAGS =
"dart-flags";
67 public static final String ARG_DART_FLAGS =
"--dart-flags";
76 ArrayList<String>
args =
new ArrayList<>();
78 if (intent.getBooleanExtra(ARG_KEY_TRACE_STARTUP,
false)) {
79 args.add(ARG_TRACE_STARTUP);
81 if (intent.getBooleanExtra(ARG_KEY_START_PAUSED,
false)) {
82 args.add(ARG_START_PAUSED);
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));
90 vmServicePort = intent.getIntExtra(ARG_KEY_OBSERVATORY_PORT, 0);
91 if (vmServicePort > 0) {
92 args.add(ARG_VM_SERVICE_PORT + Integer.toString(vmServicePort));
95 if (intent.getBooleanExtra(ARG_KEY_DISABLE_SERVICE_AUTH_CODES,
false)) {
96 args.add(ARG_DISABLE_SERVICE_AUTH_CODES);
98 if (intent.getBooleanExtra(ARG_KEY_ENDLESS_TRACE_BUFFER,
false)) {
99 args.add(ARG_ENDLESS_TRACE_BUFFER);
101 if (intent.getBooleanExtra(ARG_KEY_USE_TEST_FONTS,
false)) {
102 args.add(ARG_USE_TEST_FONTS);
104 if (intent.getBooleanExtra(ARG_KEY_ENABLE_DART_PROFILING,
false)) {
105 args.add(ARG_ENABLE_DART_PROFILING);
107 if (intent.getBooleanExtra(ARG_KEY_ENABLE_SOFTWARE_RENDERING,
false)) {
108 args.add(ARG_ENABLE_SOFTWARE_RENDERING);
110 if (intent.getBooleanExtra(ARG_KEY_SKIA_DETERMINISTIC_RENDERING,
false)) {
111 args.add(ARG_SKIA_DETERMINISTIC_RENDERING);
113 if (intent.getBooleanExtra(ARG_KEY_TRACE_SKIA,
false)) {
114 args.add(ARG_TRACE_SKIA);
116 String traceSkiaAllowlist = intent.getStringExtra(ARG_KEY_TRACE_SKIA_ALLOWLIST);
117 if (traceSkiaAllowlist !=
null) {
118 args.add(ARG_TRACE_SKIA_ALLOWLIST + traceSkiaAllowlist);
120 if (intent.getBooleanExtra(ARG_KEY_TRACE_SYSTRACE,
false)) {
121 args.add(ARG_TRACE_SYSTRACE);
123 if (intent.hasExtra(ARG_KEY_TRACE_TO_FILE)) {
124 args.add(ARG_TRACE_TO_FILE +
"=" + intent.getStringExtra(ARG_KEY_TRACE_TO_FILE));
126 if (intent.getBooleanExtra(ARG_KEY_ENABLE_IMPELLER,
false)) {
127 args.add(ARG_ENABLE_IMPELLER);
129 if (intent.getBooleanExtra(ARG_KEY_ENABLE_VULKAN_VALIDATION,
false)) {
130 args.add(ARG_ENABLE_VULKAN_VALIDATION);
132 if (intent.getBooleanExtra(ARG_KEY_DUMP_SHADER_SKP_ON_SHADER_COMPILATION,
false)) {
133 args.add(ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION);
135 if (intent.getBooleanExtra(ARG_KEY_CACHE_SKSL,
false)) {
136 args.add(ARG_CACHE_SKSL);
138 if (intent.getBooleanExtra(ARG_KEY_PURGE_PERSISTENT_CACHE,
false)) {
139 args.add(ARG_PURGE_PERSISTENT_CACHE);
141 if (intent.getBooleanExtra(ARG_KEY_VERBOSE_LOGGING,
false)) {
142 args.add(ARG_VERBOSE_LOGGING);
148 if (intent.hasExtra(ARG_KEY_DART_FLAGS)) {
149 args.add(ARG_DART_FLAGS +
"=" + intent.getStringExtra(ARG_KEY_DART_FLAGS));
155 @NonNull
private Set<String>
args;
162 this.args =
new HashSet<>(Arrays.asList(
args));
170 this.args =
new HashSet<>(
args);
175 this.args =
new HashSet<>(
args);
183 public void add(@NonNull String arg) {
192 public void remove(@NonNull String arg) {
204 String[] argsArray =
new String[
args.size()];
205 return args.toArray(argsArray);
FlutterShellArgs(@NonNull String[] args)
void add(@NonNull String arg)
FlutterShellArgs(@NonNull List< String > args)
static FlutterShellArgs fromIntent(@NonNull Intent intent)
FlutterShellArgs(@NonNull Set< String > args)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args