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 SERVICES_SAMGR_NATIVE_INCLUDE_ABILITY_DEATH_RECIPIENT_H
17 #define SERVICES_SAMGR_NATIVE_INCLUDE_ABILITY_DEATH_RECIPIENT_H
18 
19 #include "iremote_object.h"
20 
21 namespace OHOS {
22 class AbilityDeathRecipient : public IRemoteObject::DeathRecipient {
23 public:
24     void OnRemoteDied(const wptr<IRemoteObject>& remote) override;
25     AbilityDeathRecipient() = default;
26     ~AbilityDeathRecipient() override = default;
27 };
28 
29 class SystemProcessDeathRecipient : public IRemoteObject::DeathRecipient {
30 public:
31     void OnRemoteDied(const wptr<IRemoteObject>& remote) override;
32     SystemProcessDeathRecipient() = default;
33     ~SystemProcessDeathRecipient() override = default;
34 };
35 
36 class AbilityStatusDeathRecipient : public IRemoteObject::DeathRecipient {
37 public:
38     void OnRemoteDied(const wptr<IRemoteObject>& remote) override;
39     AbilityStatusDeathRecipient() = default;
40     ~AbilityStatusDeathRecipient() override = default;
41 };
42 
43 class AbilityCallbackDeathRecipient : public IRemoteObject::DeathRecipient {
44 public:
45     void OnRemoteDied(const wptr<IRemoteObject>& remote) override;
46     AbilityCallbackDeathRecipient() = default;
47     ~AbilityCallbackDeathRecipient() override = default;
48 };
49 
50 class RemoteCallbackDeathRecipient : public IRemoteObject::DeathRecipient {
51 public:
52     void OnRemoteDied(const wptr<IRemoteObject>& remote) override;
53     RemoteCallbackDeathRecipient() = default;
54     ~RemoteCallbackDeathRecipient() override = default;
55 };
56 
57 class SystemProcessListenerDeathRecipient : public IRemoteObject::DeathRecipient {
58 public:
59     void OnRemoteDied(const wptr<IRemoteObject>& remote) override;
60     SystemProcessListenerDeathRecipient() = default;
61     ~SystemProcessListenerDeathRecipient() override = default;
62 };
63 } // namespace OHOS
64 
65 #endif // !defined(SERVICES_SAMGR_NATIVE_INCLUDE_ABILITY_DEATH_RECIPIENT_H)
66