• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 <cstring>
17 #include <unistd.h>
18 
19 #include "ability_command.h"
20 #include "ability_tool_command.h"
21 #include "hilog_wrapper.h"
22 #ifdef A11Y_ENABLE
23 #include "accessibility_ability_command.h"
24 #endif // A11Y_ENABLE
main(int argc,char * argv[])25 int main(int argc, char* argv[])
26 {
27     if (strstr(argv[0], "aa") != nullptr) {
28         OHOS::AAFwk::AbilityManagerShellCommand cmd(argc, argv);
29         std::cout << cmd.ExecCommand();
30     } else if (strstr(argv[0], "ability_tool") != nullptr) {
31         OHOS::AAFwk::AbilityToolCommand cmd(argc, argv);
32         std::cout << cmd.ExecCommand();
33     } else {
34 #ifdef A11Y_ENABLE
35         if (strstr(argv[0], "accessibility") != nullptr) {
36             OHOS::AAFwk::AccessibilityAbilityShellCommand cmd(argc, argv);
37             std::cout << cmd.ExecCommand();
38         }
39 #endif // A11Y_ENABLE
40     }
41     fflush(stdout);
42     _exit(0);
43 }
44