1 /*
2  * Copyright (c) 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_BUNDLEMANAGER_BUNDLE_FRAMEWORK_INNERKITS_APPEXECFWK_CORE_INCLUDE_QUICK_FIX_MANAGER_INTERFACE_H
17 #define FOUNDATION_BUNDLEMANAGER_BUNDLE_FRAMEWORK_INNERKITS_APPEXECFWK_CORE_INCLUDE_QUICK_FIX_MANAGER_INTERFACE_H
18 
19 #include "appexecfwk_errors.h"
20 #include "quick_fix_status_callback_interface.h"
21 #include "iremote_broker.h"
22 
23 #include <vector>
24 #include <string>
25 
26 namespace OHOS {
27 namespace AppExecFwk {
28 class IQuickFixManager : public IRemoteBroker {
29 public:
30     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.bundleManager.QuickFixManager");
31 
32     virtual ErrCode DeployQuickFix(const std::vector<std::string> &bundleFilePaths,
33         const sptr<IQuickFixStatusCallback> &statusCallback, bool isDebug = false, const std::string &targetPath = "")
34     {
35         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
36     }
37 
SwitchQuickFix(const std::string & bundleName,bool enable,const sptr<IQuickFixStatusCallback> & statusCallback)38     virtual ErrCode SwitchQuickFix(const std::string &bundleName, bool enable,
39         const sptr<IQuickFixStatusCallback> &statusCallback)
40     {
41         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
42     }
43 
DeleteQuickFix(const std::string & bundleName,const sptr<IQuickFixStatusCallback> & statusCallback)44     virtual ErrCode DeleteQuickFix(const std::string &bundleName,
45         const sptr<IQuickFixStatusCallback> &statusCallback)
46     {
47         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
48     }
49 
CreateFd(const std::string & fileName,int32_t & fd,std::string & path)50     virtual ErrCode CreateFd(const std::string &fileName, int32_t &fd, std::string &path)
51     {
52         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
53     }
54 
CopyFiles(const std::vector<std::string> & sourceFiles,std::vector<std::string> & destFiles)55     virtual ErrCode CopyFiles(const std::vector<std::string> &sourceFiles, std::vector<std::string> &destFiles)
56     {
57         return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR;
58     }
59 };
60 } // AppExecFwk
61 } // OHOS
62 #endif // FOUNDATION_BUNDLEMANAGER_BUNDLE_FRAMEWORK_INNERKITS_APPEXECFWK_CORE_INCLUDE_QUICK_FIX_MANAGER_INTERFACE_H