1 /*
2  * Copyright (C) 2023 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 <android-base/properties.h>
18 #include <log/log.h>
19 
20 #include "debug.h"
21 #include "FakeRotatingCamera.h"
22 #include "list_fake_rotating_cameras.h"
23 
24 namespace android {
25 namespace hardware {
26 namespace camera {
27 namespace provider {
28 namespace implementation {
29 namespace hw {
30 namespace {
31 
32 } // namespace
33 
listFakeRotatingCameras(const std::function<void (HwCameraFactory)> & cameraSink)34 bool listFakeRotatingCameras(const std::function<void(HwCameraFactory)>& cameraSink) {
35     if (base::GetBoolProperty("ro.boot.qemu.legacy_fake_camera", false)) {
36         // only the `backfacing=true` camera is supported for now.
37         cameraSink([]() { return std::make_unique<FakeRotatingCamera>(true); });
38     }
39 
40     return true;
41 }
42 
43 }  // namespace hw
44 }  // namespace implementation
45 }  // namespace provider
46 }  // namespace camera
47 }  // namespace hardware
48 }  // namespace android
49