1 /*
2 * Copyright (C) 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 "empty_device_cb.h"
18 #include <log/log.h>
19
notify(const std::vector<NotifyMsg> &)20 ScopedAStatus EmptyDeviceCb::notify(const std::vector<NotifyMsg>&) {
21 ALOGI("notify callback");
22 ADD_FAILURE(); // Empty callback should not reach here
23 return ndk::ScopedAStatus::ok();
24 }
processCaptureResult(const std::vector<CaptureResult> &)25 ScopedAStatus EmptyDeviceCb::processCaptureResult(const std::vector<CaptureResult>&) {
26 ALOGI("processCaptureResult callback");
27 ADD_FAILURE(); // Empty callback should not reach here
28 return ndk::ScopedAStatus::ok();
29 }
requestStreamBuffers(const std::vector<BufferRequest> &,std::vector<StreamBufferRet> *,BufferRequestStatus * _aidl_return)30 ScopedAStatus EmptyDeviceCb::requestStreamBuffers(const std::vector<BufferRequest>&,
31 std::vector<StreamBufferRet>*,
32 BufferRequestStatus* _aidl_return) {
33 ALOGI("requestStreamBuffers callback");
34 // HAL might want to request buffer after configureStreams, but tests with EmptyDeviceCb
35 // doesn't actually need to send capture requests, so just return an error.
36 *_aidl_return = BufferRequestStatus::FAILED_UNKNOWN;
37 return ndk::ScopedAStatus::ok();
38 }
returnStreamBuffers(const std::vector<StreamBuffer> &)39 ScopedAStatus EmptyDeviceCb::returnStreamBuffers(const std::vector<StreamBuffer>&) {
40 ALOGI("returnStreamBuffers");
41 ADD_FAILURE(); // Empty callback should not reach here
42 return ndk::ScopedAStatus::ok();
43 }
44