Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fuchsia] Temporarily disable intl provider #13696

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions shell/platform/fuchsia/flutter/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ static void UpdateNativeThreadLabelNames(const std::string& label,
set_thread_name(runners.GetIOTaskRunner(), label, ".io");
}

static fml::RefPtr<flutter::PlatformMessage> MakeLocalizationPlatformMessage(
const fuchsia::intl::Profile& intl_profile) {
return fml::MakeRefCounted<flutter::PlatformMessage>(
"flutter/localization", MakeLocalizationPlatformMessageData(intl_profile),
nullptr);
}

Engine::Engine(Delegate& delegate,
std::string thread_label,
std::shared_ptr<sys::ServiceDirectory> svc,
Expand Down Expand Up @@ -263,49 +256,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
1 change: 0 additions & 1 deletion shell/platform/fuchsia/flutter/meta/flutter_aot_runner.cmx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"fuchsia.device.NameProvider",
"fuchsia.feedback.CrashReporter",
"fuchsia.fonts.Provider",
"fuchsia.intl.PropertyProvider",
"fuchsia.net.NameLookup",
"fuchsia.netstack.Netstack",
"fuchsia.posix.socket.Provider",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"fuchsia.device.NameProvider",
"fuchsia.feedback.CrashReporter",
"fuchsia.fonts.Provider",
"fuchsia.intl.PropertyProvider",
"fuchsia.net.NameLookup",
"fuchsia.netstack.Netstack",
"fuchsia.posix.socket.Provider",
Expand Down
1 change: 0 additions & 1 deletion shell/platform/fuchsia/flutter/meta/flutter_jit_runner.cmx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"fuchsia.device.NameProvider",
"fuchsia.feedback.CrashReporter",
"fuchsia.fonts.Provider",
"fuchsia.intl.PropertyProvider",
"fuchsia.net.NameLookup",
"fuchsia.netstack.Netstack",
"fuchsia.posix.socket.Provider",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
],
"services": [
"fuchsia.accessibility.semantics.SemanticsManager",
"fuchsia.intl.PropertyProvider",
"fuchsia.sys.Launcher"
]
}
Expand Down