• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 "ability_manager_helper.h"
17 #include "system_ability_definition.h"
18 #include "iservice_registry.h"
19 
20 #include "standby_service_log.h"
21 #include "standby_service_errors.h"
22 
23 namespace OHOS {
24 namespace DevStandbyMgr {
25 IMPLEMENT_SINGLE_INSTANCE(AbilityManagerHelper);
AbilityManagerHelper()26 AbilityManagerHelper::AbilityManagerHelper()
27 {
28 }
29 
~AbilityManagerHelper()30 AbilityManagerHelper::~AbilityManagerHelper()
31 {
32 }
33 
GetRunningSystemProcess(std::list<SystemProcessInfo> & systemProcessInfos)34 bool WEAK_FUNC AbilityManagerHelper::GetRunningSystemProcess(std::list<SystemProcessInfo>& systemProcessInfos)
35 {
36     std::lock_guard<std::mutex> lock(mutex_);
37     auto ret = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager()->
38         GetRunningSystemProcess(systemProcessInfos);
39     if (ret != ERR_OK)  {
40         STANDBYSERVICE_LOGE("failed to GetRunningSystemProcess");
41         return false;
42     }
43     return true;
44 }
45 }  // namespace DevStandbyMgr
46 }  // namespace OHOS