• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 #ifndef OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
17 #define OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
18 
19 #include <cstdint>
20 #include <map>
21 
22 #include "iremote_object.h"
23 #include "iremote_stub.h"
24 #include "nocopyable.h"
25 #include "app_scheduler_interface.h"
26 #include "string_ex.h"
27 
28 namespace OHOS {
29 namespace AppExecFwk {
30 class AppSchedulerHost : public IRemoteStub<IAppScheduler> {
31 public:
32     AppSchedulerHost();
33     virtual ~AppSchedulerHost();
34     void InitMemberFuncMap();
35     virtual int OnRemoteRequest(
36         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
37 
38 private:
39     int32_t HandleScheduleForegroundApplication(MessageParcel &data, MessageParcel &reply);
40     int32_t HandleScheduleBackgroundApplication(MessageParcel &data, MessageParcel &reply);
41     int32_t HandleScheduleTerminateApplication(MessageParcel &data, MessageParcel &reply);
42     int32_t HandleScheduleLowMemory(MessageParcel &data, MessageParcel &reply);
43     int32_t HandleScheduleShrinkMemory(MessageParcel &data, MessageParcel &reply);
44     int32_t HandleScheduleMemoryLevel(MessageParcel &data, MessageParcel &reply);
45     int32_t HandleScheduleLaunchAbility(MessageParcel &data, MessageParcel &reply);
46     int32_t HandleScheduleCleanAbility(MessageParcel &data, MessageParcel &reply);
47     int32_t HandleScheduleLaunchApplication(MessageParcel &data, MessageParcel &reply);
48     int32_t HandleScheduleAbilityStage(MessageParcel &data, MessageParcel &reply);
49     int32_t HandleScheduleProfileChanged(MessageParcel &data, MessageParcel &reply);
50     int32_t HandleScheduleConfigurationUpdated(MessageParcel &data, MessageParcel &reply);
51     int32_t HandleScheduleProcessSecurityExit(MessageParcel &data, MessageParcel &reply);
52     int32_t HandleScheduleClearPageStack(MessageParcel &data, MessageParcel &reply);
53     int32_t HandleScheduleAcceptWant(MessageParcel &data, MessageParcel &reply);
54     int32_t HandleSchedulePrepareTerminate(MessageParcel &data, MessageParcel &reply);
55     int32_t HandleScheduleNewProcessRequest(MessageParcel &data, MessageParcel &reply);
56     int32_t HandleNotifyLoadRepairPatch(MessageParcel &data, MessageParcel &reply);
57     int32_t HandleNotifyHotReloadPage(MessageParcel &data, MessageParcel &reply);
58     int32_t HandleNotifyUnLoadRepairPatch(MessageParcel &data, MessageParcel &reply);
59     int32_t HandleScheduleUpdateApplicationInfoInstalled(MessageParcel &data, MessageParcel &reply);
60     int32_t HandleScheduleHeapMemory(MessageParcel &data, MessageParcel &reply);
61     int32_t HandleScheduleJsHeapMemory(MessageParcel &data, MessageParcel &reply);
62     int32_t HandleScheduleCjHeapMemory(MessageParcel &data, MessageParcel &reply);
63     int32_t HandleNotifyAppFault(MessageParcel &data, MessageParcel &reply);
64     int32_t HandleScheduleChangeAppGcState(MessageParcel &data, MessageParcel &reply);
65     int32_t HandleAttachAppDebug(MessageParcel &data, MessageParcel &reply);
66     int32_t HandleDetachAppDebug(MessageParcel &data, MessageParcel &reply);
67     int32_t HandleScheduleDumpIpcStart(MessageParcel &data, MessageParcel &reply);
68     int32_t HandleScheduleDumpIpcStop(MessageParcel &data, MessageParcel &reply);
69     int32_t HandleScheduleDumpIpcStat(MessageParcel &data, MessageParcel &reply);
70     int32_t HandleScheduleCacheProcess(MessageParcel &data, MessageParcel &reply);
71     int32_t HandleScheduleDumpFfrt(MessageParcel &data, MessageParcel &reply);
72     int32_t HandleSetWatchdogBackgroundStatus(MessageParcel &data, MessageParcel &reply);
73     int32_t OnRemoteRequestInner(uint32_t code, MessageParcel &data,
74         MessageParcel &reply, MessageOption &option);
75     int32_t OnRemoteRequestInnerFirst(uint32_t code, MessageParcel &data,
76         MessageParcel &reply, MessageOption &option);
77     int32_t OnRemoteRequestInnerSecond(uint32_t code, MessageParcel &data,
78         MessageParcel &reply, MessageOption &option);
79     int32_t OnRemoteRequestInnerThird(uint32_t code, MessageParcel &data,
80         MessageParcel &reply, MessageOption &option);
81     DISALLOW_COPY_AND_MOVE(AppSchedulerHost);
82 };
83 }  // namespace AppExecFwk
84 }  // namespace OHOS
85 #endif  // OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
86