vmServiceOpened method

void vmServiceOpened(
  1. VmService service,
  2. ConnectedApp connectedApp
)

Implementation

void vmServiceOpened(
  VmService service,
  ConnectedApp connectedApp,
) async {
  _checkForFirstFrameStarted = false;
  cancelStreamSubscriptions();
  cancelListeners();
  _connectedApp = connectedApp;
  _service = service;
  // TODO(kenz): do we want to listen with event history here?
  autoDisposeStreamSubscription(
    service.onExtensionEvent.listen(_handleExtensionEvent),
  );
  addAutoDisposeListener(
    hasServiceExtension(extensions.didSendFirstFrameEvent),
    _maybeCheckForFirstFlutterFrame,
  );
  addAutoDisposeListener(_isolateManager.mainIsolate, _onMainIsolateChanged);
  autoDisposeStreamSubscription(
    service.onDebugEvent.listen(_handleDebugEvent),
  );
  autoDisposeStreamSubscription(
    service.onIsolateEvent.listen(_handleIsolateEvent),
  );
  final mainIsolateRef = _isolateManager.mainIsolate.value;
  if (mainIsolateRef != null) {
    _checkForFirstFrameStarted = false;
    final mainIsolate =
        await _isolateManager.isolateState(mainIsolateRef).isolate;
    if (mainIsolate != null) {
      await _registerMainIsolate(mainIsolate, mainIsolateRef);
    }
  }
}