diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index ebf4ad59fa..56aba7abe3 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/BUILD.gn @@ -86,19 +86,14 @@ android_library("java") { "//flutter/services/editing:editing_lib", "//flutter/services/editing:interfaces_java", "//flutter/services/engine:interfaces_java", - "//flutter/services/media:interfaces_java", - "//flutter/services/media:media_lib", "//flutter/services/platform:interfaces_java", - "//flutter/services/platform:platform_lib", "//flutter/services/raw_keyboard:interfaces_java", "//flutter/services/raw_keyboard:raw_keyboard_lib", - "//flutter/services/sensors:sensors_lib", "//flutter/services/vsync:vsync_lib", "//mojo/android:system_java", "//mojo/public/interfaces/application:application_java", "//mojo/public/java:bindings", "//mojo/public/java:system", - "//mojo/services/sensors/interfaces:interfaces_java", "//mojo/services/vsync/interfaces:interfaces_java", ] } diff --git a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java index 2beeb0d483..ab5547a106 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java @@ -31,28 +31,14 @@ import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.mojo.bindings.Interface.Binding; -import org.chromium.mojo.sensors.SensorServiceImpl; import org.chromium.mojo.system.Core; import org.chromium.mojo.system.impl.CoreImpl; import org.chromium.mojo.system.MessagePipeHandle; import org.chromium.mojom.activity.Activity; import org.chromium.mojom.editing.Clipboard; -import org.chromium.mojom.flutter.platform.HapticFeedback; -import org.chromium.mojom.flutter.platform.PathProvider; -import org.chromium.mojom.flutter.platform.SystemChrome; -import org.chromium.mojom.flutter.platform.SystemSound; -import org.chromium.mojom.flutter.platform.UrlLauncher; -import org.chromium.mojom.media.MediaService; -import org.chromium.mojom.sensors.SensorService; import org.chromium.mojom.vsync.VSyncProvider; import org.domokit.activity.ActivityImpl; import org.domokit.editing.ClipboardImpl; -import org.domokit.media.MediaServiceImpl; -import org.domokit.platform.HapticFeedbackImpl; -import org.domokit.platform.PathProviderImpl; -import org.domokit.platform.SystemChromeImpl; -import org.domokit.platform.SystemSoundImpl; -import org.domokit.platform.UrlLauncherImpl; import org.domokit.vsync.VSyncProviderImpl; /** @@ -212,63 +198,12 @@ public class FlutterMain { } }); - registry.register(MediaService.MANAGER.getName(), new ServiceFactory() { - @Override - public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { - return MediaService.MANAGER.bind(new MediaServiceImpl(view.getContext(), core), pipe); - } - }); - - registry.register(SensorService.MANAGER.getName(), new ServiceFactory() { - @Override - public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { - return SensorService.MANAGER.bind(new SensorServiceImpl(view.getContext()), pipe); - } - }); - registry.register(VSyncProvider.MANAGER.getName(), new ServiceFactory() { @Override public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { return VSyncProvider.MANAGER.bind(new VSyncProviderImpl(pipe), pipe); } }); - - registry.register(HapticFeedback.MANAGER.getName(), new ServiceFactory() { - @Override - public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { - return HapticFeedback.MANAGER.bind(new HapticFeedbackImpl((android.app.Activity) view.getContext()), pipe); - } - }); - - registry.register(PathProvider.MANAGER.getName(), new ServiceFactory() { - @Override - public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { - return PathProvider.MANAGER.bind(new PathProviderImpl(view.getContext()), pipe); - } - }); - - registry.register(SystemChrome.MANAGER.getName(), new ServiceFactory() { - @Override - public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { - SystemChromeImpl chrome = new SystemChromeImpl((android.app.Activity) view.getContext()); - view.addActivityLifecycleListener(chrome); - return SystemChrome.MANAGER.bind(chrome, pipe); - } - }); - - registry.register(SystemSound.MANAGER.getName(), new ServiceFactory() { - @Override - public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { - return SystemSound.MANAGER.bind(new SystemSoundImpl((android.app.Activity) view.getContext()), pipe); - } - }); - - registry.register(UrlLauncher.MANAGER.getName(), new ServiceFactory() { - @Override - public Binding connectToService(FlutterView view, Core core, MessagePipeHandle pipe) { - return UrlLauncher.MANAGER.bind(new UrlLauncherImpl((android.app.Activity) view.getContext()), pipe); - } - }); } /** diff --git a/engine/src/flutter/shell/platform/darwin/common/BUILD.gn b/engine/src/flutter/shell/platform/darwin/common/BUILD.gn index 9f9ce302cd..d303c16bba 100644 --- a/engine/src/flutter/shell/platform/darwin/common/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/common/BUILD.gn @@ -24,7 +24,6 @@ source_set("common") { "//flutter/services/activity", "//flutter/services/editing", "//flutter/services/engine:interfaces", - "//flutter/services/media", "//flutter/services/platform", "//flutter/services/vsync", "//flutter/shell/common", diff --git a/engine/src/flutter/shell/platform/darwin/common/platform_service_provider.cc b/engine/src/flutter/shell/platform/darwin/common/platform_service_provider.cc index 7d53dc2aa3..539211d223 100644 --- a/engine/src/flutter/shell/platform/darwin/common/platform_service_provider.cc +++ b/engine/src/flutter/shell/platform/darwin/common/platform_service_provider.cc @@ -7,13 +7,6 @@ #if TARGET_OS_IPHONE #include "flutter/services/activity/ios/activity_impl.h" #include "flutter/services/editing/ios/clipboard_impl.h" -#include "flutter/services/media/ios/media_player_impl.h" -#include "flutter/services/media/ios/media_service_impl.h" -#include "flutter/services/platform/ios/haptic_feedback_impl.h" -#include "flutter/services/platform/ios/path_provider_impl.h" -#include "flutter/services/platform/ios/system_chrome_impl.h" -#include "flutter/services/platform/ios/system_sound_impl.h" -#include "flutter/services/platform/ios/url_launcher_impl.h" #include "flutter/services/vsync/ios/vsync_provider_ios_impl.h" #else #include "flutter/services/vsync/mac/vsync_provider_mac_impl.h" @@ -31,16 +24,6 @@ void PlatformServiceProvider::ConnectToService( const mojo::String& service_name, mojo::ScopedMessagePipeHandle client_handle) { #if TARGET_OS_IPHONE - if (service_name == ::media::MediaPlayer::Name_) { - new sky::services::media::MediaPlayerImpl( - mojo::InterfaceRequest<::media::MediaPlayer>(client_handle.Pass())); - return; - } - if (service_name == ::media::MediaService::Name_) { - new sky::services::media::MediaServiceImpl( - mojo::InterfaceRequest<::media::MediaService>(client_handle.Pass())); - return; - } if (service_name == ::activity::Activity::Name_) { new sky::services::activity::ActivityImpl( mojo::InterfaceRequest<::activity::Activity>(client_handle.Pass())); @@ -51,36 +34,6 @@ void PlatformServiceProvider::ConnectToService( mojo::InterfaceRequest<::editing::Clipboard>(client_handle.Pass())); return; } - if (service_name == flutter::platform::HapticFeedback::Name_) { - new flutter::platform::HapticFeedbackImpl( - mojo::InterfaceRequest( - client_handle.Pass())); - return; - } - if (service_name == flutter::platform::PathProvider::Name_) { - new flutter::platform::PathProviderImpl( - mojo::InterfaceRequest( - client_handle.Pass())); - return; - } - if (service_name == flutter::platform::SystemChrome::Name_) { - new flutter::platform::SystemChromeImpl( - mojo::InterfaceRequest( - client_handle.Pass())); - return; - } - if (service_name == flutter::platform::SystemSound::Name_) { - new flutter::platform::SystemSoundImpl( - mojo::InterfaceRequest( - client_handle.Pass())); - return; - } - if (service_name == flutter::platform::URLLauncher::Name_) { - new flutter::platform::URLLauncherImpl( - mojo::InterfaceRequest( - client_handle.Pass())); - return; - } if (service_name == ::vsync::VSyncProvider::Name_) { new sky::services::vsync::VsyncProviderIOSImpl( mojo::InterfaceRequest<::vsync::VSyncProvider>(client_handle.Pass())); diff --git a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn index e120b7eaee..c724275d31 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn @@ -52,7 +52,6 @@ shared_library("flutter_framework_dylib") { "//flutter/services/activity", "//flutter/services/editing", "//flutter/services/engine:interfaces", - "//flutter/services/media", "//flutter/services/platform", "//flutter/services/vsync", "//flutter/shell/common", diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h index 7b6163bd02..acd6d92739 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h @@ -2,8 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERPLATFORM_PLUGIN_H_ +#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERPLATFORM_PLUGIN_H_ + #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterJSONMessageListener.h" @interface FlutterPlatformPlugin : FlutterJSONMessageListener @end + +namespace shell { + +extern const char* const kOrientationUpdateNotificationName; +extern const char* const kOrientationUpdateNotificationKey; +extern const char* const kOverlayStyleUpdateNotificationName; +extern const char* const kOverlayStyleUpdateNotificationKey; + +} // namespace shell + +#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERPLATFORM_PLUGIN_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index 28c94648e8..7e07e7f4db 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -17,19 +17,21 @@ static NSDictionary* GetDirectoryOfType(NSSearchPathDirectory dir) { return @{ @"path": paths.firstObject }; } -namespace flutter { -namespace platform { +namespace shell { // TODO(abarth): Move these definitions from system_chrome_impl.cc to here. -extern const char* const kOrientationUpdateNotificationName; -extern const char* const kOrientationUpdateNotificationKey; -extern const char* const kOverlayStyleUpdateNotificationName; -extern const char* const kOverlayStyleUpdateNotificationKey; +const char* const kOrientationUpdateNotificationName = + "io.flutter.plugin.platform.SystemChromeOrientationNotificationName"; +const char* const kOrientationUpdateNotificationKey = + "io.flutter.plugin.platform.SystemChromeOrientationNotificationKey"; +const char* const kOverlayStyleUpdateNotificationName = + "io.flutter.plugin.platform.SystemChromeOverlayNotificationName"; +const char* const kOverlayStyleUpdateNotificationKey = + "io.flutter.plugin.platform.SystemChromeOverlayNotificationKey"; -} // namespace platform -} // namespace flutter +} // namespace shell -using namespace flutter::platform; +using namespace shell; @implementation FlutterPlatformPlugin diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 908d106a92..71d6b3fcd2 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -10,13 +10,12 @@ #include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "flutter/common/threads.h" -#include "flutter/services/platform/ios/system_chrome_impl.h" #include "flutter/shell/gpu/gpu_rasterizer.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h" #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" #include "lib/ftl/functional/make_copyable.h" #include "lib/ftl/time/time_delta.h" @@ -97,12 +96,12 @@ void FlutterInit(int argc, const char* argv[]) { NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; [center addObserver:self selector:@selector(onOrientationPreferencesUpdated:) - name:@(flutter::platform::kOrientationUpdateNotificationName) + name:@(shell::kOrientationUpdateNotificationName) object:nil]; [center addObserver:self selector:@selector(onPreferredStatusBarStyleUpdated:) - name:@(flutter::platform::kOverlayStyleUpdateNotificationName) + name:@(shell::kOverlayStyleUpdateNotificationName) object:nil]; [center addObserver:self @@ -339,7 +338,7 @@ static inline PointerChangeMapperPhase PointerChangePhaseFromUITouchPhase( NSDictionary* info = notification.userInfo; NSNumber* update = - info[@(flutter::platform::kOrientationUpdateNotificationKey)]; + info[@(shell::kOrientationUpdateNotificationKey)]; if (update == nil) { return; @@ -430,7 +429,7 @@ static inline PointerChangeMapperPhase PointerChangePhaseFromUITouchPhase( NSDictionary* info = notification.userInfo; NSNumber* update = - info[@(flutter::platform::kOverlayStyleUpdateNotificationKey)]; + info[@(shell::kOverlayStyleUpdateNotificationKey)]; if (update == nil) { return; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/media.dart b/engine/src/flutter/sky/packages/flutter_services/lib/media.dart deleted file mode 100644 index 4e974005d3..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/media.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:sky_services/media/media.mojom.dart'; -export 'package:sky_services/media/media.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/mojo/geometry.dart b/engine/src/flutter/sky/packages/flutter_services/lib/mojo/geometry.dart deleted file mode 100644 index 6127755dcb..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/mojo/geometry.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:mojo_services/mojo/geometry.mojom.dart'; -export 'package:mojo_services/mojo/geometry.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/mojo/network_service.dart b/engine/src/flutter/sky/packages/flutter_services/lib/mojo/network_service.dart deleted file mode 100644 index 13bc33eff2..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/mojo/network_service.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:mojo_services/mojo/network_service.mojom.dart'; -export 'package:mojo_services/mojo/network_service.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/mojo/url_loader.dart b/engine/src/flutter/sky/packages/flutter_services/lib/mojo/url_loader.dart deleted file mode 100644 index e3ef694a85..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/mojo/url_loader.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:mojo_services/mojo/url_loader.mojom.dart'; -export 'package:mojo_services/mojo/url_loader.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/platform/haptic_feedback.dart b/engine/src/flutter/sky/packages/flutter_services/lib/platform/haptic_feedback.dart deleted file mode 100644 index 3129b24c72..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/platform/haptic_feedback.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:sky_services/flutter/platform/haptic_feedback.mojom.dart'; -export 'package:sky_services/flutter/platform/haptic_feedback.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/platform/path_provider.dart b/engine/src/flutter/sky/packages/flutter_services/lib/platform/path_provider.dart deleted file mode 100644 index d24bf08816..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/platform/path_provider.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:sky_services/flutter/platform/path_provider.mojom.dart'; -export 'package:sky_services/flutter/platform/path_provider.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/platform/system_chrome.dart b/engine/src/flutter/sky/packages/flutter_services/lib/platform/system_chrome.dart deleted file mode 100644 index 33ee9e6073..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/platform/system_chrome.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:sky_services/flutter/platform/system_chrome.mojom.dart'; -export 'package:sky_services/flutter/platform/system_chrome.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/platform/system_sound.dart b/engine/src/flutter/sky/packages/flutter_services/lib/platform/system_sound.dart deleted file mode 100644 index 117d495ad5..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/platform/system_sound.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:sky_services/flutter/platform/system_sound.mojom.dart'; -export 'package:sky_services/flutter/platform/system_sound.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/flutter_services/lib/platform/url_launcher.dart b/engine/src/flutter/sky/packages/flutter_services/lib/platform/url_launcher.dart deleted file mode 100644 index 863dccd6ae..0000000000 --- a/engine/src/flutter/sky/packages/flutter_services/lib/platform/url_launcher.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Copyright 2016 The Chromium Authors. All rights reserved. -/// Use of this source code is governed by a BSD-style license that can be -/// found in the LICENSE file. - -import 'package:sky_services/flutter/platform/url_launcher.mojom.dart'; -export 'package:sky_services/flutter/platform/url_launcher.mojom.dart'; diff --git a/engine/src/flutter/sky/packages/sky_services/BUILD.gn b/engine/src/flutter/sky/packages/sky_services/BUILD.gn index 862d7af79d..1000ec339a 100644 --- a/engine/src/flutter/sky/packages/sky_services/BUILD.gn +++ b/engine/src/flutter/sky/packages/sky_services/BUILD.gn @@ -25,7 +25,6 @@ dart_pkg("sky_services") { ":copy_sky_services_license", "//flutter/services/activity:interfaces", "//flutter/services/editing:interfaces", - "//flutter/services/media:interfaces", "//flutter/services/platform:interfaces", "//flutter/services/raw_keyboard:interfaces", ]