From: Caisking Date: Tue, 29 Jul 2025 02:13:58 +0000 (+0800) Subject: applist增加心率充电判断 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~210^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2016%2Fhead;p=mirrors%2FFD230.git applist增加心率充电判断 --- 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();