From 23a7604829de819092fd57aeca8dc4152d88bea4 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 17 Mar 2016 10:17:47 -0700 Subject: [PATCH] Add a bool to indicate whether we're in MojoShell In MojoShell, we can connect to other applications. This patch adds a bool that clients can use to check whether that feature is available without needing to try to connect to an application. --- packages/flutter/lib/shell.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/flutter/lib/shell.dart b/packages/flutter/lib/shell.dart index 27256becc8..92ce9e2509 100644 --- a/packages/flutter/lib/shell.dart +++ b/packages/flutter/lib/shell.dart @@ -48,6 +48,9 @@ class MojoShell { } final ApplicationConnection _embedderConnection = _initEmbedderConnection(); + /// Whether [connectToApplication] is able to connect to other applications. + bool get canConnectToOtherApplications => _shell != null; + /// Attempts to connect to an application via the Mojo shell. ApplicationConnection connectToApplication(String url) { if (_shell == null)