1 /*
2  * Copyright (c) 2020 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 #ifndef OHOS_ABILITY_HELPER_H
17 #define OHOS_ABILITY_HELPER_H
18 
19 #include <sched.h>
20 
21 #include "abilityms_log.h"
22 #include "abilityms_status.h"
23 #include "ability_state.h"
24 #include "bundle_info.h"
25 #include "want.h"
26 
27 namespace OHOS {
28 class AbilityMsHelper {
29 public:
30     static bool IsLauncherAbility(const char *bundleName);
31     static bool IsAceAbility(const char *abilityName);
32     static AbilityMsStatus SetLauncherWant(Want &want);
33     static AbilityMsStatus SetKeepAliveWant(const BundleInfo &bundleInfo, Want &want);
34 #ifdef OHOS_DEBUG
35     static std::string AbilityStateToString(State state);
36 #endif
37     static bool IsLegalBundleName(const char *bundleName);
38     static bool CheckVisiblePermission(pid_t callingUid, pid_t targetUid, bool isVisible);
39 
40     static const pid_t SYSTEM_UID = 0;
41     static const pid_t HUKS_UID = 19;
42 };
43 }
44 #endif // OHOS_ABILITY_HELPER_H
45