@@ -41,13 +41,6 @@ static void UpdateNativeThreadLabelNames(const std::string& label,
4141 set_thread_name (runners.GetIOTaskRunner (), label, " .io" );
4242}
4343
44- static fml::RefPtr<flutter::PlatformMessage> MakeLocalizationPlatformMessage (
45- const fuchsia::intl::Profile& intl_profile) {
46- return fml::MakeRefCounted<flutter::PlatformMessage>(
47- " flutter/localization" , MakeLocalizationPlatformMessageData (intl_profile),
48- nullptr );
49- }
50-
5144Engine::Engine (Delegate& delegate,
5245 std::string thread_label,
5346 std::shared_ptr<sys::ServiceDirectory> svc,
@@ -263,49 +256,6 @@ Engine::Engine(Delegate& delegate,
263256 // notification. Fire one eagerly.
264257 shell_->GetPlatformView ()->NotifyCreated ();
265258
266- // Connect to the intl property provider.
267- {
268- intl_property_provider_.set_error_handler ([](zx_status_t status) {
269- FML_LOG (ERROR) << " Failed to connect to "
270- << fuchsia::intl::PropertyProvider::Name_ << " : "
271- << zx_status_get_string (status);
272- });
273-
274- // Note that we're using the runner's services, not the component's.
275- // Flutter locales should be updated regardless of whether the component has
276- // direct access to the fuchsia.intl.PropertyProvider service.
277- ZX_ASSERT (runner_services->Connect (intl_property_provider_.NewRequest ()) ==
278- ZX_OK);
279-
280- auto get_profile_callback = [flutter_runner_engine =
281- weak_factory_.GetWeakPtr ()](
282- const fuchsia::intl::Profile& profile) {
283- if (!flutter_runner_engine) {
284- return ;
285- }
286- if (!profile.has_locales ()) {
287- FML_LOG (WARNING) << " Got intl Profile without locales" ;
288- }
289- auto message = MakeLocalizationPlatformMessage (profile);
290- FML_VLOG (-1 ) << " Sending LocalizationPlatformMessage" ;
291- flutter_runner_engine->shell_ ->GetPlatformView ()->DispatchPlatformMessage (
292- message);
293- };
294-
295- FML_VLOG (-1 ) << " Requesting intl Profile" ;
296-
297- // Make the initial request
298- intl_property_provider_->GetProfile (get_profile_callback);
299-
300- // And register for changes
301- intl_property_provider_.events ().OnChange = [this , runner_services,
302- get_profile_callback]() {
303- FML_VLOG (-1 ) << fuchsia::intl::PropertyProvider::Name_ << " : OnChange" ;
304- runner_services->Connect (intl_property_provider_.NewRequest ());
305- intl_property_provider_->GetProfile (get_profile_callback);
306- };
307- }
308-
309259 // Launch the engine in the appropriate configuration.
310260 auto run_configuration = flutter::RunConfiguration::InferFromSettings (
311261 settings_, task_runners.GetIOTaskRunner ());
0 commit comments