1/*
2 * Copyright (C) 2019 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//TODO: b/196432585
18//Change the service names to match AIDL instead of HIDL major, minor versioning. Currently
19//left alone to avoid accidentally breaking targets.
20
21package {
22    default_applicable_licenses: ["Android-Apache-2.0"],
23}
24
25soong_config_module_type {
26    name: "gch_lazy_hal_cc_defaults",
27    module_type: "cc_defaults",
28    config_namespace: "gch",
29    bool_variables: ["use_lazy_hal"],
30    properties: ["enabled"],
31}
32
33gch_lazy_hal_cc_defaults {
34    name: "camera_service_eager_hal_defaults",
35    enabled: true,
36    soong_config_variables: {
37        use_lazy_hal: {
38            enabled: false,
39        },
40    },
41}
42
43gch_lazy_hal_cc_defaults {
44    name: "camera_service_lazy_hal_defaults",
45    enabled: false,
46    soong_config_variables: {
47        use_lazy_hal: {
48            enabled: true,
49        },
50    },
51}
52
53// Exported for use in vendor/google/services/LyricCameraHAL/src/
54python_binary_host {
55    name: "camera_hal_version_script",
56    main: "version_script.py",
57    srcs: ["version_script.py"],
58}
59
60cc_genrule {
61    name: "aidl_camera_build_version",
62    tools: ["camera_hal_version_script"],
63    cmd: "$(location camera_hal_version_script) $(in) $(out)",
64    uses_order_only_build_number_file: true,
65    vendor: true,
66    srcs: [
67        "aidl_camera_build_version.inl",
68    ],
69    out: ["aidl_camera_build_version.h"],
70}
71
72cc_defaults {
73    name: "camera_service_defaults_common",
74    defaults: [
75        "google_camera_hal_defaults",
76        "apex_update_listener_cc_defaults_static",
77    ],
78    vendor: true,
79    relative_install_path: "hw",
80    srcs: [
81        "aidl_camera_device.cc",
82        "aidl_camera_device_session.cc",
83        "aidl_camera_provider.cc",
84        "aidl_thermal_utils.cc",
85        "aidl_utils.cc",
86        "libc_wrappers.cc",
87    ],
88    generated_headers: [
89        "aidl_camera_build_version",
90    ],
91    compile_multilib: "first",
92    shared_libs: [
93        "android.hardware.camera.device-V3-ndk",
94        "android.hardware.camera.common-V1-ndk",
95        "android.hardware.camera.provider-V3-ndk",
96        "android.hardware.thermal-V1-ndk",
97        "libbinder_ndk",
98        "libbase",
99        "libcamera_metadata",
100        "libcutils",
101        "libfmq",
102        "libgooglecamerahal",
103        "libgooglecamerahalprofiling",
104        "libgooglecamerahalutils",
105        "libhidlbase",
106        "liblog",
107        "libui",
108        "libutils",
109        "lib_profiler",
110    ],
111    export_shared_lib_headers: [
112        "lib_profiler",
113    ],
114    static_libs: [
115        "libaidlcommonsupport",
116    ],
117}
118
119cc_defaults {
120    name: "hardware_camera_service_defaults",
121    defaults: [
122        "camera_service_defaults_common",
123    ],
124    srcs: [
125        "aidl_service.cc",
126    ],
127    vintf_fragments: [":[email protected]"],
128}
129
130cc_binary {
131    name: "[email protected]",
132    defaults: [
133        "hardware_camera_service_defaults",
134        "camera_service_eager_hal_defaults",
135    ],
136    init_rc: ["[email protected]"],
137}
138
139cc_binary {
140    name: "[email protected]",
141    defaults: [
142        "hardware_camera_service_defaults",
143        "camera_service_lazy_hal_defaults",
144    ],
145    init_rc: ["[email protected]"],
146    cflags: ["-DLAZY_SERVICE"],
147}
148
149filegroup {
150    name: "[email protected]",
151    srcs: ["[email protected]"],
152}
153