5#include "flutter/shell/platform/android/platform_message_handler_android.h"
10 const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade)
11 : jni_facade_(jni_facade) {}
15 std::unique_ptr<fml::Mapping> mapping) {
24 std::lock_guard lock(pending_responses_mutex_);
25 auto it = pending_responses_.find(response_id);
26 if (it == pending_responses_.end()) {
29 message_response = std::move(it->second);
30 pending_responses_.erase(it);
33 message_response->
Complete(std::move(mapping));
44 std::lock_guard lock(pending_responses_mutex_);
45 auto it = pending_responses_.find(response_id);
46 if (it == pending_responses_.end()) {
49 message_response = std::move(it->second);
50 pending_responses_.erase(it);
57 std::unique_ptr<flutter::PlatformMessage>
message) {
59 int response_id = next_response_id_.fetch_add(1);
60 if (
auto response =
message->response()) {
61 std::lock_guard lock(pending_responses_mutex_);
62 pending_responses_[response_id] = response;
65 jni_facade_->FlutterViewHandlePlatformMessage(std::move(
message),