1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "EvsDeathRecipient.h"
18 
19 #include <android-base/logging.h>
20 
21 using ::android::sp;
22 using ::android::wp;
23 using ::android::hardware::automotive::evs::V1_1::IEvsEnumerator;
24 using ::android::hidl::base::V1_0::IBase;
25 
26 namespace android {
27 namespace automotive {
28 namespace evs {
29 
EvsDeathRecipient(const sp<IEvsEnumerator> & svc,EvsServiceCallback * callback)30 EvsDeathRecipient::EvsDeathRecipient(const sp<IEvsEnumerator>& svc, EvsServiceCallback* callback) :
31       mService(svc), mCallback(callback) {}
32 
serviceDied(uint64_t,const wp<IBase> & who)33 void EvsDeathRecipient::serviceDied(uint64_t /*cookie*/, const wp<IBase>& who) {
34     LOG(ERROR) << "EVS service has died.";
35     if (mCallback != nullptr) {
36         mCallback->onServiceDied(who);
37     }
38 }
39 
40 }  // namespace evs
41 }  // namespace automotive
42 }  // namespace android
43