• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 OHOS_FILEMGMT_BACKUP_SERVICE_H
17 #define OHOS_FILEMGMT_BACKUP_SERVICE_H
18 
19 #include <vector>
20 #include <string>
21 
22 #include "b_error/b_error.h"
23 #include "i_service_reverse.h"
24 #include "iremote_stub.h"
25 #include "service_stub.h"
26 
27 namespace OHOS::FileManagement::Backup {
28 class Service : public ServiceStub {
29 public:
InitRestoreSession(sptr<IServiceReverse>)30     ErrCode InitRestoreSession(sptr<IServiceReverse>) { return BError(BError::Codes::OK); }
InitRestoreSession(sptr<IServiceReverse>,std::string &)31     ErrCode InitRestoreSession(sptr<IServiceReverse>, std::string&) { return BError(BError::Codes::OK); }
InitBackupSession(sptr<IServiceReverse>)32     ErrCode InitBackupSession(sptr<IServiceReverse>) { return BError(BError::Codes::OK); }
InitBackupSession(sptr<IServiceReverse>,std::string &)33     ErrCode InitBackupSession(sptr<IServiceReverse>, std::string&) { return BError(BError::Codes::OK); }
Start()34     ErrCode Start() { return BError(BError::Codes::OK); }
GetLocalCapabilities()35     UniqueFd GetLocalCapabilities() {  return UniqueFd(-1); }
GetLocalCapabilitiesForBundleInfos()36     UniqueFd GetLocalCapabilitiesForBundleInfos() {  return UniqueFd(-1); }
PublishFile(const BFileInfo &)37     ErrCode PublishFile(const BFileInfo&) { return BError(BError::Codes::OK); }
AppFileReady(const std::string &,UniqueFd,int32_t)38     ErrCode AppFileReady(const std::string&, UniqueFd, int32_t) { return BError(BError::Codes::OK); }
AppDone(ErrCode)39     ErrCode AppDone(ErrCode) { return BError(BError::Codes::OK); }
ServiceResultReport(const std::string,BackupRestoreScenario,ErrCode)40     ErrCode ServiceResultReport(const std::string,
41         BackupRestoreScenario, ErrCode) { return BError(BError::Codes::OK); }
GetFileHandle(const std::string &,const std::string &)42     ErrCode GetFileHandle(const std::string&, const std::string&) { return BError(BError::Codes::OK); }
43     ErrCode AppendBundlesRestoreSession(UniqueFd,
44                                         const std::vector<BundleName>&,
45                                         const std::vector<std::string>&,
46                                         RestoreTypeEnum restoreType = RestoreTypeEnum::RESTORE_DATA_WAIT_SEND,
47                                         int32_t userId = DEFAULT_INVAL_VALUE) { return BError(BError::Codes::OK); }
48     ErrCode AppendBundlesRestoreSession(UniqueFd,
49                                         const std::vector<BundleName>&,
50                                         RestoreTypeEnum restoreType = RestoreTypeEnum::RESTORE_DATA_WAIT_SEND,
51                                         int32_t userId = DEFAULT_INVAL_VALUE) { return BError(BError::Codes::OK); }
AppendBundlesBackupSession(const std::vector<BundleName> &)52     ErrCode AppendBundlesBackupSession(const std::vector<BundleName>&) { return BError(BError::Codes::OK); }
AppendBundlesDetailsBackupSession(const std::vector<BundleName> &,const std::vector<std::string> &)53     ErrCode AppendBundlesDetailsBackupSession(const std::vector<BundleName>&,
54                                               const std::vector<std::string>&) { return BError(BError::Codes::OK); }
Finish()55     ErrCode Finish() { return BError(BError::Codes::OK); }
Release()56     ErrCode Release() { return BError(BError::Codes::OK); }
Cancel(std::string,int32_t &)57     ErrCode Cancel(std::string, int32_t&) { return BError(BError::Codes::OK); }
GetLocalCapabilitiesIncremental(const std::vector<BIncrementalData> &)58     UniqueFd GetLocalCapabilitiesIncremental(const std::vector<BIncrementalData>&) { return UniqueFd(-1); }
GetAppLocalListAndDoIncrementalBackup()59     ErrCode GetAppLocalListAndDoIncrementalBackup() { return BError(BError::Codes::OK); }
InitIncrementalBackupSession(sptr<IServiceReverse>)60     ErrCode InitIncrementalBackupSession(sptr<IServiceReverse>) { return BError(BError::Codes::OK); }
InitIncrementalBackupSession(sptr<IServiceReverse>,std::string &)61     ErrCode InitIncrementalBackupSession(sptr<IServiceReverse>, std::string&) { return BError(BError::Codes::OK); }
AppendBundlesIncrementalBackupSession(const std::vector<BIncrementalData> &)62     ErrCode AppendBundlesIncrementalBackupSession(const std::vector<BIncrementalData>&)
63         { return BError(BError::Codes::OK); }
AppendBundlesIncrementalBackupSession(const std::vector<BIncrementalData> &,const std::vector<std::string> &)64     ErrCode AppendBundlesIncrementalBackupSession(const std::vector<BIncrementalData>&, const std::vector<std::string>&)
65         { return BError(BError::Codes::OK); }
PublishIncrementalFile(const BFileInfo &)66     ErrCode PublishIncrementalFile(const BFileInfo&) { return BError(BError::Codes::OK); }
PublishSAIncrementalFile(const BFileInfo &,UniqueFd)67     ErrCode PublishSAIncrementalFile(const BFileInfo&, UniqueFd) { return BError(BError::Codes::OK); }
AppIncrementalFileReady(const std::string &,UniqueFd,UniqueFd,int32_t)68     ErrCode AppIncrementalFileReady(const std::string&, UniqueFd, UniqueFd, int32_t)
69         { return BError(BError::Codes::OK); }
AppIncrementalDone(ErrCode)70     ErrCode AppIncrementalDone(ErrCode) { return BError(BError::Codes::OK); }
GetIncrementalFileHandle(const std::string &,const std::string &)71     ErrCode GetIncrementalFileHandle(const std::string&, const std::string&) { return BError(BError::Codes::OK); }
GetBackupInfo(BundleName &,std::string &)72     ErrCode GetBackupInfo(BundleName&, std::string&) { return BError(BError::Codes::OK); }
UpdateTimer(BundleName &,uint32_t,bool &)73     ErrCode UpdateTimer(BundleName&, uint32_t, bool&) { return BError(BError::Codes::OK); }
UpdateSendRate(std::string &,int32_t,bool &)74     ErrCode UpdateSendRate(std::string&, int32_t, bool&) { return BError(BError::Codes::OK); }
ReportAppProcessInfo(const std::string,const BackupRestoreScenario)75     ErrCode ReportAppProcessInfo(const std::string, const BackupRestoreScenario) { return BError(BError::Codes::OK); }
StartExtTimer(bool &)76     ErrCode StartExtTimer(bool&) { return BError(BError::Codes::OK); }
StartFwkTimer(bool &)77     ErrCode StartFwkTimer(bool&) { return BError(BError::Codes::OK); }
StopExtTimer(bool &)78     ErrCode StopExtTimer(bool&) { return BError(BError::Codes::OK); }
RefreshDataSize(int64_t)79     ErrCode RefreshDataSize(int64_t) { return BError(BError::Codes::OK); }
80 
SAResultReport(const std::string,const std::string,const ErrCode,const BackupRestoreScenario)81     ErrCode SAResultReport(const std::string, const std::string,
82                            const ErrCode, const BackupRestoreScenario) { return BError(BError::Codes::OK); }
GetBackupDataSize(bool,std::vector<BIncrementalData>)83     ErrCode GetBackupDataSize(bool, std::vector<BIncrementalData>) { return BError(BError::Codes::OK); }
84 };
85 } // namespace OHOS::FileManagement::Backup
86 
87 #endif // OHOS_FILEMGMT_BACKUP_SERVICE_H