From 7c4f6a68302fe3d51f82e40e2e145aead673e20f Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 19 Jun 2019 13:13:13 -0700 Subject: [PATCH] Wire intent args for observatory port (#9378) --- .../android/io/flutter/app/FlutterActivityDelegate.java | 7 +++++++ .../io/flutter/embedding/engine/FlutterShellArgs.java | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 001e1c530..55a323286 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -312,6 +312,13 @@ public final class FlutterActivityDelegate if (intent.getBooleanExtra("verbose-logging", false)) { args.add("--verbose-logging"); } + final int observatoryPort = intent.getIntExtra("observatory-port", 0); + if (observatoryPort > 0) { + args.add("--observatory-port=" + Integer.toString(observatoryPort)); + } + if (intent.getBooleanExtra("disable-service-auth-codes", false)) { + args.add("--disable-service-auth-codes"); + } // NOTE: all flags provided with this argument are subject to filtering // based on a whitelist in shell/common/switches.cc. If any flag provided // is not present in the whitelist, the process will immediately diff --git a/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java b/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java index c2fab9f03..45605cd28 100644 --- a/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java +++ b/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java @@ -43,6 +43,8 @@ public class FlutterShellArgs { public static final String ARG_DUMP_SHADER_SKP_ON_SHADER_COMPILATION = "--dump-skp-on-shader-compilation"; public static final String ARG_KEY_VERBOSE_LOGGING = "verbose-logging"; public static final String ARG_VERBOSE_LOGGING = "--verbose-logging"; + public static final String ARG_KEY_OBSERVATORY_PORT = "observatory-port"; + public static final String ARG_OBSERVATORY_PORT = "--observatory-port="; @NonNull public static FlutterShellArgs fromIntent(@NonNull Intent intent) { @@ -58,6 +60,10 @@ public class FlutterShellArgs { if (intent.getBooleanExtra(ARG_KEY_START_PAUSED, false)) { args.add(ARG_START_PAUSED); } + final int observatoryPort = intent.getIntExtra(ARG_KEY_OBSERVATORY_PORT, 0); + if (observatoryPort > 0) { + args.add(ARG_OBSERVATORY_PORT + Integer.toString(observatoryPort)); + } if (intent.getBooleanExtra(ARG_KEY_DISABLE_SERVICE_AUTH_CODES, false)) { args.add(ARG_DISABLE_SERVICE_AUTH_CODES); } -- GitLab