From: Caisking <3449750381@qq.com> Date: Thu, 21 Mar 2024 01:37:19 +0000 (+0800) Subject: 增加开机充电检测 X-Git-Tag: release_V1.2.70_20241020_135402~1284 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.js?a=commitdiff_plain;h=97d1e6bfbd8bbdced745c62eba6d52f1e2cde800;p=mirrors%2FFD230.git 增加开机充电检测 --- 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(); }