• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "torch_provider_cb.h"
18 
TorchProviderCb(CameraAidlTest * parent)19 TorchProviderCb::TorchProviderCb(CameraAidlTest* parent) {
20     mParent = parent;
21 }
22 
torchModeStatusChange(const std::string &,TorchModeStatus newStatus)23 ndk::ScopedAStatus TorchProviderCb::torchModeStatusChange(const std::string&,
24                                                           TorchModeStatus newStatus) {
25     std::lock_guard<std::mutex> l(mParent->mTorchLock);
26     mParent->mTorchStatus = newStatus;
27     mParent->mTorchCond.notify_one();
28     return ndk::ScopedAStatus::ok();
29 }
cameraDeviceStatusChange(const std::string &,::aidl::android::hardware::camera::common::CameraDeviceStatus)30 ScopedAStatus TorchProviderCb::cameraDeviceStatusChange(
31         const std::string&, ::aidl::android::hardware::camera::common::CameraDeviceStatus) {
32     // Should not be called
33     return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
34 }
physicalCameraDeviceStatusChange(const std::string &,const std::string &,::aidl::android::hardware::camera::common::CameraDeviceStatus)35 ScopedAStatus TorchProviderCb::physicalCameraDeviceStatusChange(
36         const std::string&, const std::string&,
37         ::aidl::android::hardware::camera::common::CameraDeviceStatus) {
38     // Should not be called
39     return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
40 }
41