From 8c98e2dccc07756600b10485584c45a914926172 Mon Sep 17 00:00:00 2001 From: chengshichang Date: Wed, 15 Jan 2025 15:43:45 +0800 Subject: [PATCH] Signed-off-by: csc --- .../engine/systemchannels/NativeVsyncChannel.ets | 2 +- shell/platform/ohos/ohos_shell_holder.h | 2 +- shell/platform/ohos/vsync_waiter_ohos.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/NativeVsyncChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/NativeVsyncChannel.ets index 0afc63c245..2876b6fbb8 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/NativeVsyncChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/NativeVsyncChannel.ets @@ -34,7 +34,7 @@ export default class NativeVsyncChannel implements MessageHandler { onMessage(message: object, reply: Reply): void { let data: HashMap = message as HashMap; let isEnable: boolean = data.get("isEnable"); - this.flutterNapi.setDVsyncSwitch(isEnable); + this.flutterNapi.SetDVsyncSwitch(isEnable); Log.d(NativeVsyncChannel.TAG, `Received message: isEnable:$isEnable`); reply.reply(StringUtils.stringToArrayBuffer("")); diff --git a/shell/platform/ohos/ohos_shell_holder.h b/shell/platform/ohos/ohos_shell_holder.h index 6fba882739..e18c7e88de 100644 --- a/shell/platform/ohos/ohos_shell_holder.h +++ b/shell/platform/ohos/ohos_shell_holder.h @@ -68,7 +68,7 @@ class OHOSShellHolder { return shell_->GetPlatformMessageHandler(); } - const std::weak_ptr& GetVsyncWaiter() const { + const std::weak_ptr GetVsyncWaiter() const { return shell_->GetVsyncWaiter(); } diff --git a/shell/platform/ohos/vsync_waiter_ohos.cpp b/shell/platform/ohos/vsync_waiter_ohos.cpp index 88d1208f5e..7c60239e2d 100644 --- a/shell/platform/ohos/vsync_waiter_ohos.cpp +++ b/shell/platform/ohos/vsync_waiter_ohos.cpp @@ -22,10 +22,10 @@ namespace flutter { static std::atomic_uint g_refresh_rate_ = 60; -static constexpr uint32_t SUPPORT_API_VERSION = 14; +static constexpr int32_t SUPPORT_API_VERSION = 14; const char* flutterSyncName = "flutter_connect"; -const char* NATIVE_DVSYNC_SO = "libnative_vsync.so" +const char* NATIVE_DVSYNC_SO = "libnative_vsync.so"; thread_local bool VsyncWaiterOHOS::firstCall = true; @@ -119,7 +119,7 @@ void VsyncWaiterOHOS::SetDvsyncSwitch(bool enableDvsync) { apiVersion_ = OH_GetSdkApiVersion(); } if (apiVersion_ < SUPPORT_API_VERSION) { - LOGI("current api version not support native dvsync!") + LOGI("current api version not support native dvsync!"); return; } if (!handle_) { @@ -131,7 +131,7 @@ void VsyncWaiterOHOS::SetDvsyncSwitch(bool enableDvsync) { } if (!nativeDvsyncFunc_) { - nativeDvsyncFunc_ = reinterpret_cast(dlsm(handle_, "OH_NativeVSync_DVSyncSwitch")); + nativeDvsyncFunc_ = reinterpret_cast(dlsym(handle_, "OH_NativeVSync_DVSyncSwitch")); } if (!nativeDvsyncFunc_) { LOGE("SetDvsyncSwitch load OH_NativeVSync_DVSyncSwitch failed!"); -- Gitee