Fix the incorrect orientation of the gravity sensor and JSVM crash issue in HarmonyOS Next (#18041)

* 1.Fix the problem of incorrect rotation direction of openharmony screen
2.Remove redundant files

# Conflicts:
#	templates/harmonyos-next/entry/src/main/ets/cocos/jsb-adapter/sys-ability-polyfill.js

* Fix the issue of JSVM running crash

---------

Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
This commit is contained in:
qiuguohua
2024-12-17 10:43:39 +08:00
committed by GitHub
parent 86aed391c1
commit 2e4a9d57e0
13 changed files with 26 additions and 275 deletions
@@ -52,7 +52,6 @@ enum ContextType {
ENGINE_UTILS,
EDITBOX_UTILS,
WEBVIEW_UTILS,
SYSTEM_UTILS,
DISPLAY_UTILS,
UV_ASYNC_SEND,
VIDEO_UTILS
@@ -226,13 +225,13 @@ static void napiOnDisplayChange(const Napi::CallbackInfo &info) {
orientation = static_cast<int>(cc::IScreen::Orientation::PORTRAIT);
break;
case 1: // ROTATION_90
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_RIGHT);
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_LEFT);
break;
case 2: // ROTATION_180
orientation = static_cast<int>(cc::IScreen::Orientation::PORTRAIT_UPSIDE_DOWN);
break;
case 3: // ROTATION_270
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_LEFT);
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_RIGHT);
break;
}
cc::events::Orientation::broadcast(orientation);