[dart sdk] Remove ServiceProvider from startup context.

Users should use StartupContext.incoming instead.

MS-167 #done

Change-Id: Icf85516acc9bdca0e65bda893d954d81a7f01dd3
diff --git a/public/dart/fuchsia_services/lib/src/internal/_startup_context_impl.dart b/public/dart/fuchsia_services/lib/src/internal/_startup_context_impl.dart
index d6c272a..1cc21d9 100644
--- a/public/dart/fuchsia_services/lib/src/internal/_startup_context_impl.dart
+++ b/public/dart/fuchsia_services/lib/src/internal/_startup_context_impl.dart
@@ -22,12 +22,6 @@
 class StartupContextImpl implements StartupContext {
   static const String _serviceRootPath = '/svc';
 
-  /// The [fidl_sys.ServiceProvider] which can be used to connect to the
-  /// services exposed to the component on launch.
-  //  TODO(MF-167): Remove from this class
-  @override
-  final fidl_sys.ServiceProvider environmentServices;
-
   /// Services that are available to this component.
   ///
   /// These services have been offered to this component by its parent or are
@@ -46,10 +40,7 @@
   ///
   /// This constructor is rarely used directly. Instead, most clients create a
   /// startup context using [StartupContext.fromStartupInfo].
-  StartupContextImpl(
-      {@required this.incoming,
-      @required this.outgoing,
-      this.environmentServices})
+  StartupContextImpl({@required this.incoming, @required this.outgoing})
       : assert(incoming != null),
         assert(outgoing != null);
 
@@ -76,7 +67,6 @@
       return StartupContextImpl(
         incoming: incomingServices,
         outgoing: _getOutgoingFromHandle(outgoingServicesHandle),
-        environmentServices: _getServiceProvider(incomingServices),
       );
     }
 
@@ -84,7 +74,6 @@
     return StartupContextImpl(
       incoming: Incoming(directoryProxy),
       outgoing: Outgoing(),
-      environmentServices: fidl_sys.ServiceProviderProxy(),
     );
   }
 
@@ -119,7 +108,6 @@
     return StartupContextImpl(
       incoming: incomingSvc,
       outgoing: _getOutgoingFromChannel(dirRequestChannel),
-      environmentServices: _getServiceProvider(incomingSvc),
     );
   }
 
@@ -140,23 +128,4 @@
       ..serve(InterfaceRequest<fidl_io.Node>(directoryRequestChannel));
     return outgoingServices;
   }
-
-  //  TODO(MF-167): Remove from this class
-  static fidl_sys.ServiceProviderProxy _getServiceProvider(
-      Incoming incomingServices) {
-    final environmentProxy = _getEnvironment(incomingServices);
-
-    final serviceProviderProxy = fidl_sys.ServiceProviderProxy();
-    environmentProxy.getServices(serviceProviderProxy.ctrl.request());
-    return serviceProviderProxy;
-  }
-
-  static fidl_sys.EnvironmentProxy _getEnvironment(Incoming incomingServices) {
-    if (incomingServices == null) {
-      throw ArgumentError.notNull('incomingServices');
-    }
-    final environmentProxy = fidl_sys.EnvironmentProxy();
-    incomingServices.connectToService(environmentProxy);
-    return environmentProxy;
-  }
 }
diff --git a/public/dart/fuchsia_services/lib/src/startup_context.dart b/public/dart/fuchsia_services/lib/src/startup_context.dart
index 8fd522e..bafaa25 100644
--- a/public/dart/fuchsia_services/lib/src/startup_context.dart
+++ b/public/dart/fuchsia_services/lib/src/startup_context.dart
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:fidl_fuchsia_sys/fidl_async.dart' as fidl_sys;
-
 import 'incoming.dart';
 import 'internal/_startup_context_impl.dart';
 import 'outgoing.dart';
@@ -17,11 +15,6 @@
 abstract class StartupContext {
   static StartupContext _startupContext;
 
-  /// The [fidl_sys.ServiceProvider] which can be used to connect to the
-  /// services exposed to the component on launch.
-  //  TODO(MF-167): Remove from this class
-  final fidl_sys.ServiceProvider environmentServices;
-
   /// Services that are available to this component.
   ///
   /// These services have been offered to this component by its parent or are