From 445364f1fce290e36fa8d73f88b25b116b82337e Mon Sep 17 00:00:00 2001 From: wuyunxun Date: Fri, 11 Jul 2025 15:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuyunxun Change-Id: Ie8006cc58c1e4fcf32415f210be6be0488125671 --- frameworks/js/ani/ets/@ohos.sensor.ets | 4 ++-- frameworks/js/ani/src/sensor_ani.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/js/ani/ets/@ohos.sensor.ets b/frameworks/js/ani/ets/@ohos.sensor.ets index 31b4c552..65d304cb 100644 --- a/frameworks/js/ani/ets/@ohos.sensor.ets +++ b/frameworks/js/ani/ets/@ohos.sensor.ets @@ -19,8 +19,8 @@ import { BusinessError } from '@ohos.base'; export default namespace sensor { loadLibrary("sensor_ani"); - export native function on(type: 'ORIENTATION', callback: Callback, options?: Options): void; - export native function off(type: 'ORIENTATION', callback?: Callback): void; + export native function on(type: 'orientationChange', callback: Callback, options?: Options): void; + export native function off(type: 'orientationChange', callback?: Callback): void; export type SensorFrequency = 'game' | 'ui' | 'normal'; export interface Options { interval?: number | SensorFrequency; diff --git a/frameworks/js/ani/src/sensor_ani.cpp b/frameworks/js/ani/src/sensor_ani.cpp index 6871e423..84f037ec 100644 --- a/frameworks/js/ani/src/sensor_ani.cpp +++ b/frameworks/js/ani/src/sensor_ani.cpp @@ -64,7 +64,7 @@ std::map> g_sensorAttributeList = { }; static std::unordered_map stringToNumberMap = { - {"ORIENTATION", 256}, + {"orientationChange", 256}, }; static std::map g_samplingPeriod = { -- Gitee