From 97d1e6bfbd8bbdced745c62eba6d52f1e2cde800 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Thu, 21 Mar 2024 09:37:19 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E6=9C=BA=E5=85=85?= =?utf8?q?=E7=94=B5=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativelauncher/src/NativeLauncher.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 5b4f8d4c1..a41f9e081 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "battery_service.h" +#include "DialModelCharge.h" #include "NativeLauncher.h" #include "SliceProxy.h" @@ -314,7 +316,7 @@ namespace OHOS void NativeLauncher::InitNativeLauncher() { - + // 初始化语言 GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "NativeLauncher::InitNativeLauncher"); @@ -328,6 +330,11 @@ namespace OHOS #endif /* ------------------------------- ConfigModel ------------------------------ */ ConfigModel::GetInstance()->Init(); + // 开机检测充电状态 + if (get_charge_stat() == 1) + { + DialModelCharge::GetInstance()->UpdateChargeStuaut(1); + } /* -------------------------------------------------------------------------- */ // 初始化所有预加载slice @@ -344,7 +351,7 @@ namespace OHOS // 初始化默认首页 ScreenModels::GetInstance()->PreLoadAppimages(); NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN); - //注册长按重启或关机事件 + // 注册长按重启或关机事件 RebootModel::GetInstance()->RegisterLongPressEvents(); } -- 2.17.1