onBackgroundMethodCall static method

Future<void> onBackgroundMethodCall(
  1. MethodCall call
)

Implementation

static Future<void> onBackgroundMethodCall(MethodCall call) async {
  log("onBackgroundMethodCall ${call.method}");
  switch (call.method) {
    case "onServiceConnected":
      log("accessibility service started");
      _running = true;
      for (var service in _serviceRegistry.values) {
        service.onServiceConnected();
      }
      break;
    case "onDestroyed":
      log("accessibility service destroyed");
      for (var service in _serviceRegistry.values) {
        service.onDestroy();
      }
      break;
    case "onAccessibilityEvent":
      // log("accessibility service event ${call.arguments}");
      var event = AccessibilityEvent.fromMap(call.arguments as Map);

      for (var service in _serviceRegistry.values) {
        service.onAccessibilityEvent(event);
      }
      break;
  }
}