Skip to content

Commit

Permalink
[mobile]expose onNetworkTypeChanged API to Engine (#36504)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
RenjieTang authored Oct 9, 2024
1 parent 5773309 commit 4b07991
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mobile/library/cc/engine.cc
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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
2 changes: 2 additions & 0 deletions mobile/library/cc/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <functional>

#include "library/cc/stream_client.h"
#include "library/common/engine_types.h"
#include "library/common/types/c_types.h"

namespace Envoy {
Expand All @@ -20,6 +21,7 @@ class Engine : public std::enable_shared_from_this<Engine> {

std::string dumpStats();
StreamClientSharedPtr streamClient();
void onDefaultNetworkChanged(NetworkType network);

envoy_status_t terminate();
Envoy::InternalEngine* engine() { return engine_; }
Expand Down

0 comments on commit 4b07991

Please sign in to comment.