From 4b07991211eb9262656ee209decac749c57124dc Mon Sep 17 00:00:00 2001 From: RenjieTang Date: Tue, 8 Oct 2024 17:15:50 -0700 Subject: [PATCH] [mobile]expose onNetworkTypeChanged API to Engine (#36504) Commit Message: expose onNetworkTypeChanged API to Engine Additional Description: This prevents applications from directly depending on InternalEngine. Risk Level: low Testing: n/a Docs Changes: n/a Release Notes: n/a Platform Specific Features: mobile only Signed-off-by: Renjie Tang --- mobile/library/cc/engine.cc | 5 +++++ mobile/library/cc/engine.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/mobile/library/cc/engine.cc b/mobile/library/cc/engine.cc index d94ce7480fe8..b4aa819cb121 100644 --- a/mobile/library/cc/engine.cc +++ b/mobile/library/cc/engine.cc @@ -1,5 +1,6 @@ #include "engine.h" +#include "library/common/engine_types.h" #include "library/common/internal_engine.h" #include "library/common/types/c_types.h" @@ -26,5 +27,9 @@ std::string Engine::dumpStats() { return engine_->dumpStats(); } envoy_status_t Engine::terminate() { return engine_->terminate(); } +void Engine::onDefaultNetworkChanged(NetworkType network) { + engine_->onDefaultNetworkChanged(network); +} + } // namespace Platform } // namespace Envoy diff --git a/mobile/library/cc/engine.h b/mobile/library/cc/engine.h index 172985a08a34..12302e178300 100644 --- a/mobile/library/cc/engine.h +++ b/mobile/library/cc/engine.h @@ -3,6 +3,7 @@ #include #include "library/cc/stream_client.h" +#include "library/common/engine_types.h" #include "library/common/types/c_types.h" namespace Envoy { @@ -20,6 +21,7 @@ class Engine : public std::enable_shared_from_this { std::string dumpStats(); StreamClientSharedPtr streamClient(); + void onDefaultNetworkChanged(NetworkType network); envoy_status_t terminate(); Envoy::InternalEngine* engine() { return engine_; }