From 9a62bd797268a8fafb654dee00f989326c74db35 Mon Sep 17 00:00:00 2001 From: Caisking Date: Tue, 29 Jul 2025 10:13:58 +0800 Subject: [PATCH] =?utf8?q?applist=E5=A2=9E=E5=8A=A0=E5=BF=83=E7=8E=87?= =?utf8?q?=E5=85=85=E7=94=B5=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/applist/src/ApplistPresenter.cpp | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp index 673315a0e..dfcaccc3f 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp @@ -13,6 +13,12 @@ #include "TransitionType.h" #include "NativeRegisterManager.h" +#include "health/health_service/health_service.h" +#include "battery_hal.h" +#include "ConfigModelC.h" +#include "ConfigModel.h" +#include +#include "custom_runtime.h" namespace OHOS { REGIST_SLICE(VIEW_APPLIST, ApplistView, ApplistPresenter); @@ -137,15 +143,27 @@ REGIST_SLICE(VIEW_APPLIST, ApplistView, ApplistPresenter); uid = (char *)itemView->GetAppUid(); } WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnClick viewid = %d", viewId); - if (viewId < VIEW_MAX_INTER_APP) { - if (viewId == VIEW_SETTING && style == AppListStyle::APPLIST_STYLE) { - // NativeAbility::GetInstance().EnterSlice(viewId, type, gSliceDefaultPriority, true); - NativeAbility::GetInstance().EnterSlice(viewId, type); - } else { - NativeAbility::GetInstance().EnterSlice(viewId, type); + if (viewId < VIEW_MAX_INTER_APP) + { + /*心率Slice需要增加特殊配置*/ + bool isCharging = get_charge_stat(); // 获取充电状态 + if (isCharging && viewId == VIEW_HEART_CHART) + { + HealthState highHealthState; + highHealthState.checkType = CHARGE; + HealthService::GetInstance()->SetHealthCurrent(highHealthState); + viewId = VIEW_CHECK_INVALID; } + if(uapi_sleep_mode_flag_get()) + { + if(VIEW_DNOTDISTURB == viewId) + return false; + } + NativeAbility::GetInstance().EnterSlice(viewId, type); return true; - } else if (viewId == VIEW_EXTERN_APP) { + } + else if (viewId == VIEW_EXTERN_APP) + { #ifdef JS_ENABLE WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnClick bundleName = %s", uid); Want *want = new Want(); -- 2.17.1