blob: 46bea2e5839e8a4dc2edd5327b54c43490951543 [file] [log] [blame]
Pawin Vongmasabf69de92019-10-29 06:21:27 -07001/*
2 * Copyright 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// This is an example of an empty Codec2.0 service.
18//
19// To use this, make a copy of this whole directory and rename modules
20// accordingly. The contents of "vendor.cpp" and files in the subdirectory
21// "seccomp_policy" may also need to be modified.
22
23// Binary file for the service.
24//
25// The init_rc file contains the absolute path to this binary on the device.
26// If the name of this module is modified, the content of the init_rc file has
27// to be modified accordingly.
28//
29// The seccomp_policy file name and its content can be modified, but note that
30// vendor.cpp also needs to be updated because it needs the absolute path to the
31// seccomp policy file on the device.
Pawin Vongmasa36653902018-11-15 00:10:25 -080032cc_binary {
Pawin Vongmasabf69de92019-10-29 06:21:27 -070033 name: "android.hardware.media.c2@1.1-default-service",
34 vendor: true,
Pawin Vongmasa36653902018-11-15 00:10:25 -080035 relative_install_path: "hw",
Pawin Vongmasabf69de92019-10-29 06:21:27 -070036
37 init_rc: ["android.hardware.media.c2@1.1-default-service.rc"],
38
39 defaults: ["libcodec2-hidl-defaults"],
Pawin Vongmasa36653902018-11-15 00:10:25 -080040 srcs: [
41 "vendor.cpp",
42 ],
43
Pawin Vongmasabf69de92019-10-29 06:21:27 -070044 // minijail is used to protect against unexpected system calls.
Pawin Vongmasa36653902018-11-15 00:10:25 -080045 shared_libs: [
Pawin Vongmasa36653902018-11-15 00:10:25 -080046 "libavservices_minijail_vendor",
47 "libbinder",
Pawin Vongmasa36653902018-11-15 00:10:25 -080048 ],
Pawin Vongmasabf69de92019-10-29 06:21:27 -070049 required: ["android.hardware.media.c2@1.1-default-seccomp_policy"],
50}
Pawin Vongmasa36653902018-11-15 00:10:25 -080051
Pawin Vongmasabf69de92019-10-29 06:21:27 -070052// seccomp policy file.
53//
54// This should be modified to suit the target device and architecture.
55//
56// Files in the "seccomp_policy" subdirectory are only provided as examples.
57// They may not work on some devices and/or architectures without modification.
58prebuilt_etc {
59 name: "android.hardware.media.c2@1.1-default-seccomp_policy",
60 vendor: true,
61 sub_dir: "seccomp_policy",
62
63 // If a specific architecture is targeted, multiple choices are not needed.
Pawin Vongmasa36653902018-11-15 00:10:25 -080064 arch: {
65 arm: {
Pawin Vongmasabf69de92019-10-29 06:21:27 -070066 src: "seccomp_policy/android.hardware.media.c2@1.1-default-arm.policy",
67 },
68 arm64: {
69 src: "seccomp_policy/android.hardware.media.c2@1.1-default-arm64.policy",
Pawin Vongmasa36653902018-11-15 00:10:25 -080070 },
71 x86: {
Pawin Vongmasabf69de92019-10-29 06:21:27 -070072 src: "seccomp_policy/android.hardware.media.c2@1.1-default-x86.policy",
73 },
74 x86_64: {
75 src: "seccomp_policy/android.hardware.media.c2@1.1-default-x86_64.policy",
Pawin Vongmasa36653902018-11-15 00:10:25 -080076 },
77 },
78
Pawin Vongmasabf69de92019-10-29 06:21:27 -070079 // This may be removed.
80 required: ["crash_dump.policy"],
Pawin Vongmasa36653902018-11-15 00:10:25 -080081}
82