Commit c59b35b1 authored by Leo Zhang's avatar Leo Zhang Committed by Chromium LUCI CQ

Fix M17N broken connection.

Skip decoder check for the ime_spec when it's M17N request.



Bug: 1166064
Change-Id: Ib02db10805d5c222c9767e54c46367b00096587d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626864Reviewed-by: default avatarLeo Zhang <googleo@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: Leo Zhang <googleo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843879}
parent 6ad6c2ae
...@@ -100,6 +100,10 @@ bool DecoderEngine::BindRequest( ...@@ -100,6 +100,10 @@ bool DecoderEngine::BindRequest(
} }
bool DecoderEngine::IsImeSupportedByDecoder(const std::string& ime_spec) { bool DecoderEngine::IsImeSupportedByDecoder(const std::string& ime_spec) {
// M17N request will always fallback to built-in rulebased IMEs.
if (InputEngine::IsImeSupportedByRulebased(ime_spec)) {
return false;
}
if (decoder_entry_points_) { if (decoder_entry_points_) {
return decoder_entry_points_->supports(ime_spec.c_str()); return decoder_entry_points_->supports(ime_spec.c_str());
} }
......
...@@ -133,6 +133,10 @@ bool SystemEngine::BindRequest( ...@@ -133,6 +133,10 @@ bool SystemEngine::BindRequest(
} }
bool SystemEngine::IsImeSupportedByDecoder(const std::string& ime_spec) { bool SystemEngine::IsImeSupportedByDecoder(const std::string& ime_spec) {
// M17N request will always fallback to built-in rulebased IMEs.
if (InputEngine::IsImeSupportedByRulebased(ime_spec)) {
return false;
}
return decoder_entry_points_ && return decoder_entry_points_ &&
decoder_entry_points_->supports(ime_spec.c_str()); decoder_entry_points_->supports(ime_spec.c_str());
} }
......
...@@ -73,10 +73,11 @@ class InputEngine : public mojom::InputChannel { ...@@ -73,10 +73,11 @@ class InputEngine : public mojom::InputChannel {
// TODO(https://crbug.com/837156): Implement a state for the interface. // TODO(https://crbug.com/837156): Implement a state for the interface.
private: protected:
// Returns whether the given ime_spec is supported by rulebased engine. // Returns whether the given ime_spec is supported by rulebased engine.
bool IsImeSupportedByRulebased(const std::string& ime_spec); bool IsImeSupportedByRulebased(const std::string& ime_spec);
private:
mojo::ReceiverSet<mojom::InputChannel, std::unique_ptr<InputEngineContext>> mojo::ReceiverSet<mojom::InputChannel, std::unique_ptr<InputEngineContext>>
channel_receivers_; channel_receivers_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment