1 /* 2 * Copyright 2022 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 "MockEvsServiceFactory.h" 18 19 namespace { 20 21 using ::aidl::android::automotive::evs::implementation::MockEvsHal; 22 23 // Number of mock hardware components 24 inline constexpr int kNumberOfMockCameras = 3; 25 inline constexpr int kNumberOfMockDisplays = 1; 26 27 } // namespace 28 29 namespace android::automotive::evs { 30 init()31bool MockEvsServiceFactory::init() { 32 mMockEvs = std::make_unique<MockEvsHal>(kNumberOfMockCameras, kNumberOfMockDisplays); 33 if (!mMockEvs) { 34 return false; 35 } 36 37 mMockEvs->initialize(); 38 mService = mMockEvs->getEnumerator(); 39 return true; 40 } 41 linkToDeath(AIBinder *,AIBinder_DeathRecipient *,void * cookie)42binder_status_t MockLinkUnlinkToDeath::linkToDeath(AIBinder*, AIBinder_DeathRecipient*, 43 void* cookie) { 44 mCookie = cookie; 45 return STATUS_OK; 46 } 47 unlinkToDeath(AIBinder *)48binder_status_t MockLinkUnlinkToDeath::unlinkToDeath(AIBinder*) { 49 // Do nothing. 50 return STATUS_OK; 51 } 52 53 } // namespace android::automotive::evs 54