1 /*
2  * Copyright (c) 2021-2022 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 FOUNDATION_EVENT_CESFWK_SERVICES_TEST_UNITTEST_MOCK_INCLUDE_MOCK_BUNDLE_MANAGER_H
17 #define FOUNDATION_EVENT_CESFWK_SERVICES_TEST_UNITTEST_MOCK_INCLUDE_MOCK_BUNDLE_MANAGER_H
18 
19 #include <vector>
20 
21 #include "ability_info.h"
22 #include "application_info.h"
23 #include "bundle_mgr_host.h"
24 #include "bundle_mgr_interface.h"
25 #include "iremote_proxy.h"
26 #include "iremote_stub.h"
27 #include "want.h"
28 
29 namespace OHOS {
30 namespace AppExecFwk {
31 class MockBundleMgrService : public BundleMgrHost {
32 public:
MockBundleMgrService()33     MockBundleMgrService()
34     {}
35 
~MockBundleMgrService()36     ~MockBundleMgrService()
37     {}
38 
39     /**
40      * @brief Check whether the app is system app by it's UID.
41      * @param uid Indicates the uid.
42      * @return Returns true if the bundle is a system application; returns false otherwise.
43      */
44     virtual bool CheckIsSystemAppByUid(const int uid) override;
45 
46     void MockSetIsSystemApp(bool isSystemApp);
47 
48 private:
49     bool isSystemApp_ = false;
50     bool isSystemAppMock_ = false;
51 };
52 }  // namespace AppExecFwk
53 }  // namespace OHOS
54 
55 #endif  // FOUNDATION_EVENT_CESFWK_SERVICES_TEST_UNITTEST_MOCK_INCLUDE_MOCK_BUNDLE_MANAGER_H
56