• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
17 #define OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
18 
19 #include <map>
20 
21 #include "iremote_object.h"
22 #include "iremote_stub.h"
23 #include "nocopyable.h"
24 #include "app_scheduler_interface.h"
25 #include "string_ex.h"
26 
27 namespace OHOS {
28 namespace AppExecFwk {
29 class AppSchedulerHost : public IRemoteStub<IAppScheduler> {
30 public:
31     AppSchedulerHost();
32     virtual ~AppSchedulerHost();
33 
34     virtual int OnRemoteRequest(
35         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
36 
37 private:
38     int32_t HandleScheduleForegroundApplication(MessageParcel &data, MessageParcel &reply);
39     int32_t HandleScheduleBackgroundApplication(MessageParcel &data, MessageParcel &reply);
40     int32_t HandleScheduleTerminateApplication(MessageParcel &data, MessageParcel &reply);
41     int32_t HandleScheduleLowMemory(MessageParcel &data, MessageParcel &reply);
42     int32_t HandleScheduleShrinkMemory(MessageParcel &data, MessageParcel &reply);
43     int32_t HandleScheduleMemoryLevel(MessageParcel &data, MessageParcel &reply);
44     int32_t HandleScheduleLaunchAbility(MessageParcel &data, MessageParcel &reply);
45     int32_t HandleScheduleCleanAbility(MessageParcel &data, MessageParcel &reply);
46     int32_t HandleScheduleLaunchApplication(MessageParcel &data, MessageParcel &reply);
47     int32_t HandleScheduleAbilityStage(MessageParcel &data, MessageParcel &reply);
48     int32_t HandleScheduleProfileChanged(MessageParcel &data, MessageParcel &reply);
49     int32_t HandleScheduleConfigurationUpdated(MessageParcel &data, MessageParcel &reply);
50     int32_t HandleScheduleProcessSecurityExit(MessageParcel &data, MessageParcel &reply);
51     int32_t HandleScheduleAcceptWant(MessageParcel &data, MessageParcel &reply);
52     int32_t HandleNotifyLoadRepairPatch(MessageParcel &data, MessageParcel &reply);
53     int32_t HandleNotifyHotReloadPage(MessageParcel &data, MessageParcel &reply);
54     int32_t HandleNotifyUnLoadRepairPatch(MessageParcel &data, MessageParcel &reply);
55     int32_t HandleScheduleUpdateApplicationInfoInstalled(MessageParcel &data, MessageParcel &reply);
56 
57     using AppSchedulerFunc = int32_t (AppSchedulerHost::*)(MessageParcel &data, MessageParcel &reply);
58     std::map<uint32_t, AppSchedulerFunc> memberFuncMap_;
59 
60     DISALLOW_COPY_AND_MOVE(AppSchedulerHost);
61 };
62 }  // namespace AppExecFwk
63 }  // namespace OHOS
64 #endif  // OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
65