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 "bundle_mgr_proxy.h"
17
18 #include "ipc_types.h"
19 #include "parcel.h"
20 #include "string_ex.h"
21
22 #include "appexecfwk_errors.h"
23 #include "bundle_constants.h"
24
25 namespace OHOS {
26 namespace AppExecFwk {
27 namespace {
28 bool distributedNotificationEnabled = true;
29 }
MockSetDistributedNotificationEnabled(bool enable)30 void MockSetDistributedNotificationEnabled(bool enable)
31 {
32 distributedNotificationEnabled = enable;
33 }
34
BundleMgrProxy(const sptr<IRemoteObject> & impl)35 BundleMgrProxy::BundleMgrProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IBundleMgr>(impl)
36 {}
37
~BundleMgrProxy()38 BundleMgrProxy::~BundleMgrProxy()
39 {}
40
GetBundleInfo(const std::string & bundleName,const BundleFlag flag,BundleInfo & bundleInfo,int32_t userId)41 bool BundleMgrProxy::GetBundleInfo(
42 const std::string &bundleName, const BundleFlag flag, BundleInfo &bundleInfo, int32_t userId)
43 {
44 bundleInfo.uid = 1;
45 return true;
46 }
47
GetAppIdByBundleName(const std::string & bundleName,const int userId)48 std::string BundleMgrProxy::GetAppIdByBundleName(const std::string &bundleName, const int userId)
49 {
50 return "appId";
51 }
52
GetBundleNameForUid(const int uid,std::string & bundleName)53 bool BundleMgrProxy::GetBundleNameForUid(const int uid, std::string &bundleName)
54 {
55 bundleName = "bundleName";
56 return true;
57 }
58
GetAppType(const std::string & bundleName)59 std::string BundleMgrProxy::GetAppType(const std::string &bundleName)
60 {
61 return "Constants::EMPTY_STRING";
62 }
63 } // namespace AppExecFwk
64 } // namespace OHOS
65