• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 
17 #ifndef UPDATE_SERVICE_MODULE_H
18 #define UPDATE_SERVICE_MODULE_H
19 
20 #include <string>
21 
22 #include "message_option.h"
23 #include "message_parcel.h"
24 #include "parcel.h"
25 #include "refbase.h"
26 #include "system_ability_ondemand_reason.h"
27 
28 #ifdef __cplusplus
29 #if __cplusplus
30 extern "C" {
31 #endif
32 #endif
33 
34 using RequestFuncType = int32_t (*)(uint32_t code,
35     OHOS::MessageParcel &data, OHOS::MessageParcel &reply, OHOS::MessageOption &option);
36 
37 using LifeCycleFuncType = void (*)(const OHOS::SystemAbilityOnDemandReason &reason);
38 using LifeCycleFuncReturnType = int32_t (*)(const OHOS::SystemAbilityOnDemandReason &reason);
39 
40 void RegisterFunc(std::vector<uint32_t> codes, RequestFuncType handleRemoteRequest);
41 
42 void RegisterOnStartOnStopFunc(std::string phase, LifeCycleFuncType handlePhase);
43 void RegisterOnIdleFunc(std::string phase, LifeCycleFuncReturnType handlePhase);
44 
45 #ifdef __cplusplus
46 #if __cplusplus
47 }
48 #endif
49 #endif
50 #endif // UPDATE_SERVICE_MODULE_H
51