• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 #ifndef OS_ACCOUNT_SERVICE_BUNDLE_MANAGER_ADAPTER_H
17 #define OS_ACCOUNT_SERVICE_BUNDLE_MANAGER_ADAPTER_H
18 
19 #include <mutex>
20 #include <string>
21 #include "ability_info.h"
22 #include "bundle_info.h"
23 #include "want.h"
24 
25 namespace OHOS {
26 namespace AccountSA {
27 class BundleManagerAdapter {
28 private:
29     BundleManagerAdapter();
30     virtual ~BundleManagerAdapter();
31     DISALLOW_COPY_AND_MOVE(BundleManagerAdapter);
32 
33 public:
34     static BundleManagerAdapter* GetInstance();
35 
36     ErrCode GetNameForUid(const int uid, std::string &bundleName);
37     bool GetBundleInfo(const std::string &bundleName, const AppExecFwk::BundleFlag flag,
38         AppExecFwk::BundleInfo &bundleInfo, int32_t userId);
39     int GetUidByBundleName(const std::string &bundleName, const int userId);
40     bool QueryAbilityInfos(const AAFwk::Want &want, int32_t flags, int32_t userId,
41         std::vector<AppExecFwk::AbilityInfo> &abilityInfos);
42     bool QueryExtensionAbilityInfos(const AAFwk::Want &want, const int32_t &flag,
43         const int32_t &userId, std::vector<AppExecFwk::ExtensionAbilityInfo> &extensionInfos);
44     bool QueryExtensionAbilityInfos(const AAFwk::Want &want, const AppExecFwk::ExtensionAbilityType &extensionType,
45         const int32_t &flag, const int32_t &userId, std::vector<AppExecFwk::ExtensionAbilityInfo> &extensionInfos);
46 };
47 }  // namespace AccountSA
48 }  // namespace OHOS
49 #endif  // OS_ACCOUNT_SERVICE_BUNDLE_MANAGER_ADAPTER_H
50