• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "injection_event_dispatch.h"
17 #include "error_multimodal.h"
18 #include "mmi_log.h"
19 
20 namespace {
21 constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, OHOS::MMI::MMI_LOG_DOMAIN, "MmiEventSimulateDemoMain" };
22 } // namespace
23 
main(int32_t argc,const char * argv[])24 int32_t main(int32_t argc, const char* argv[])
25 {
26     using namespace OHOS::MMI;
27     do {
28         SetThreadName("main");
29         if (argc < ARGV_VALID) {
30             MMI_HILOGI("Invalid Input Para, Please Check the validity of the para! errCode:%d", PARAM_INPUT_FAIL);
31             break;
32         }
33         std::vector<std::string> argvs;
34         for (int32_t i = 0; i < argc; i++) {
35             argvs.push_back(argv[i]);
36         }
37         InjectionEventDispatch injection;
38         injection.Init();
39         if (!(injection.VerifyArgvs(argc, argvs))) {
40             MMI_HILOGI("Invalid Input Para, Please Check the validity of the para! errCode:%d", PARAM_INPUT_FAIL);
41             break;
42         }
43         injection.Run();
44     } while (0);
45 
46     return RET_OK;
47 }
48