162b8cbc9Sopenharmony_ci/*
262b8cbc9Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
362b8cbc9Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
462b8cbc9Sopenharmony_ci * you may not use this file except in compliance with the License.
562b8cbc9Sopenharmony_ci * You may obtain a copy of the License at
662b8cbc9Sopenharmony_ci *
762b8cbc9Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
862b8cbc9Sopenharmony_ci *
962b8cbc9Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1062b8cbc9Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1162b8cbc9Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1262b8cbc9Sopenharmony_ci * See the License for the specific language governing permissions and
1362b8cbc9Sopenharmony_ci * limitations under the License.
1462b8cbc9Sopenharmony_ci */
1562b8cbc9Sopenharmony_ci
1662b8cbc9Sopenharmony_ci#include "hals/gfx_engines.h"
1762b8cbc9Sopenharmony_ci#include "gfx_utils/common_macros.h"
1862b8cbc9Sopenharmony_ci#include "gfx_utils/graphic_log.h"
1962b8cbc9Sopenharmony_ci#include "graphic_performance.h"
2062b8cbc9Sopenharmony_ci#include "hals/hi_fbdev.h"
2162b8cbc9Sopenharmony_ci#include "input_manager_service.h"
2262b8cbc9Sopenharmony_ci#include "samgr_lite.h"
2362b8cbc9Sopenharmony_ci
2462b8cbc9Sopenharmony_ci#include "lite_wm.h"
2562b8cbc9Sopenharmony_ci
2662b8cbc9Sopenharmony_ciextern "C" void UI_WEAK_SYMBOL HOS_SystemInit(void)
2762b8cbc9Sopenharmony_ci{
2862b8cbc9Sopenharmony_ci    SAMGR_Bootstrap();
2962b8cbc9Sopenharmony_ci}
3062b8cbc9Sopenharmony_ci
3162b8cbc9Sopenharmony_cinamespace {
3262b8cbc9Sopenharmony_ciconstexpr uint16_t US_PER_MILLISECOND = 1000;
3362b8cbc9Sopenharmony_ciconstexpr uint16_t WMS_MAIN_TASK_PERIOD_IN_US = OHOS::WMS_MAIN_TASK_PERIOD * US_PER_MILLISECOND;
3462b8cbc9Sopenharmony_ci}
3562b8cbc9Sopenharmony_ci
3662b8cbc9Sopenharmony_ciint main()
3762b8cbc9Sopenharmony_ci{
3862b8cbc9Sopenharmony_ci    DEBUG_PERFORMANCE_REGISTER_SIG();
3962b8cbc9Sopenharmony_ci    OHOS::HiFbdevInit();
4062b8cbc9Sopenharmony_ci    OHOS::GfxEngines::GetInstance()->InitDriver();
4162b8cbc9Sopenharmony_ci    HOS_SystemInit();
4262b8cbc9Sopenharmony_ci    OHOS::InputManagerService::GetInstance()->Run();
4362b8cbc9Sopenharmony_ci    while (1) {
4462b8cbc9Sopenharmony_ci        DEBUG_PERFORMANCE_PRINT_RESULT();
4562b8cbc9Sopenharmony_ci        OHOS::LiteWM::GetInstance()->MainTaskHandler();
4662b8cbc9Sopenharmony_ci        usleep(WMS_MAIN_TASK_PERIOD_IN_US);
4762b8cbc9Sopenharmony_ci    }
4862b8cbc9Sopenharmony_ci}