Skip to content

Commit

Permalink
[fuchsia] Temporarily disable intl provider
Browse files Browse the repository at this point in the history
The intention of the property provider is to try to connect, not
bail out if connection is not possible.

This code tried to connect unconditionally, which is not what we wanted.
Removing this initialization code to enable a roll, and will fix in a
followup.
  • Loading branch information
filmil committed Nov 5, 2019
1 parent 0928c1a commit c0a4f82
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions shell/platform/fuchsia/flutter/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,49 +263,6 @@ Engine::Engine(Delegate& delegate,
// notification. Fire one eagerly.
shell_->GetPlatformView()->NotifyCreated();

// Connect to the intl property provider.
{
intl_property_provider_.set_error_handler([](zx_status_t status) {
FML_LOG(ERROR) << "Failed to connect to "
<< fuchsia::intl::PropertyProvider::Name_ << ": "
<< zx_status_get_string(status);
});

// Note that we're using the runner's services, not the component's.
// Flutter locales should be updated regardless of whether the component has
// direct access to the fuchsia.intl.PropertyProvider service.
ZX_ASSERT(runner_services->Connect(intl_property_provider_.NewRequest()) ==
ZX_OK);

auto get_profile_callback = [flutter_runner_engine =
weak_factory_.GetWeakPtr()](
const fuchsia::intl::Profile& profile) {
if (!flutter_runner_engine) {
return;
}
if (!profile.has_locales()) {
FML_LOG(WARNING) << "Got intl Profile without locales";
}
auto message = MakeLocalizationPlatformMessage(profile);
FML_VLOG(-1) << "Sending LocalizationPlatformMessage";
flutter_runner_engine->shell_->GetPlatformView()->DispatchPlatformMessage(
message);
};

FML_VLOG(-1) << "Requesting intl Profile";

// Make the initial request
intl_property_provider_->GetProfile(get_profile_callback);

// And register for changes
intl_property_provider_.events().OnChange = [this, runner_services,
get_profile_callback]() {
FML_VLOG(-1) << fuchsia::intl::PropertyProvider::Name_ << ": OnChange";
runner_services->Connect(intl_property_provider_.NewRequest());
intl_property_provider_->GetProfile(get_profile_callback);
};
}

// Launch the engine in the appropriate configuration.
auto run_configuration = flutter::RunConfiguration::InferFromSettings(
settings_, task_runners.GetIOTaskRunner());
Expand Down

0 comments on commit c0a4f82

Please sign in to comment.