• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_MGR_SERVICE_EVENT_HANDLER_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_MGR_SERVICE_EVENT_HANDLER_H
18 
19 #include "event_handler.h"
20 #include "bundle_constants.h"
21 
22 namespace OHOS {
23 namespace AppExecFwk {
24 
25 class BundleMgrService;
26 
27 class BMSEventHandler : public EventHandler {
28 public:
29     explicit BMSEventHandler(const std::shared_ptr<EventRunner> &runner);
30     virtual ~BMSEventHandler() override;
31     /**
32      * @brief Process the event of install system bundles.
33      * @param event Indicates the event to be processed.
34      * @return
35      */
36     virtual void ProcessEvent(const InnerEvent::Pointer &event) override;
37 
38     enum {
39         BUNDLE_SCAN_START = 1,
40         BUNDLE_SCAN_FINISHED,
41         BMS_START_FINISHED,
42     };
43 
44 private:
45     /**
46      * @brief Install system and system vendor bundles.
47      * @param appType Indicates the bundle type.
48      * @return
49      */
50     void ProcessSystemBundleInstall(Constants::AppType appType) const;
51     /**
52      * @brief Set the flag indicates that all system and vendor applications installed.
53      * @return
54      */
55     void SetAllInstallFlag() const;
56 };
57 
58 }  // namespace AppExecFwk
59 }  // namespace OHOS
60 #endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_MGR_SERVICE_EVENT_HANDLER_H
61