Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 1 | /* |
| 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. |
Bob Badour | 56786ac | 2021-02-25 15:24:36 -0800 | [diff] [blame] | 32 | package { |
| 33 | // See: http://go/android-license-faq |
| 34 | // A large-scale-change added 'default_applicable_licenses' to import |
| 35 | // all of the 'license_kinds' from "frameworks_av_license" |
| 36 | // to get the below license kinds: |
| 37 | // SPDX-license-identifier-Apache-2.0 |
| 38 | default_applicable_licenses: ["frameworks_av_license"], |
| 39 | } |
| 40 | |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 41 | cc_binary { |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 42 | name: "android.hardware.media.c2@1.2-default-service", |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 43 | vendor: true, |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 44 | relative_install_path: "hw", |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 45 | |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 46 | init_rc: ["android.hardware.media.c2@1.2-default-service.rc"], |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 47 | |
| 48 | defaults: ["libcodec2-hidl-defaults"], |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 49 | srcs: [ |
| 50 | "vendor.cpp", |
| 51 | ], |
| 52 | |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 53 | // minijail is used to protect against unexpected system calls. |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 54 | shared_libs: [ |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 55 | "libavservices_minijail_vendor", |
| 56 | "libbinder", |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 57 | ], |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 58 | required: ["android.hardware.media.c2@1.2-default-seccomp_policy"], |
Pawin Vongmasa | 5e3b767 | 2020-02-12 03:11:06 -0800 | [diff] [blame] | 59 | |
| 60 | // The content in manifest_media_c2_V1_1_default.xml can be included |
| 61 | // directly in the main device manifest.xml file or via vintf_fragments. |
| 62 | // (Remove the line below if the entry is already in the main manifest.) |
| 63 | vintf_fragments: ["manifest_media_c2_V1_1_default.xml"], |
Yo Chiang | 3902d8d | 2020-07-12 20:38:26 +0800 | [diff] [blame] | 64 | |
| 65 | // Remove this line to enable this module. |
| 66 | enabled: false, |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 67 | } |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 68 | |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 69 | // seccomp policy file. |
| 70 | // |
| 71 | // This should be modified to suit the target device and architecture. |
| 72 | // |
| 73 | // Files in the "seccomp_policy" subdirectory are only provided as examples. |
| 74 | // They may not work on some devices and/or architectures without modification. |
| 75 | prebuilt_etc { |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 76 | name: "android.hardware.media.c2@1.2-default-seccomp_policy", |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 77 | vendor: true, |
| 78 | sub_dir: "seccomp_policy", |
| 79 | |
| 80 | // If a specific architecture is targeted, multiple choices are not needed. |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 81 | arch: { |
| 82 | arm: { |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 83 | src: "seccomp_policy/android.hardware.media.c2@1.2-default-arm.policy", |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 84 | }, |
| 85 | arm64: { |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 86 | src: "seccomp_policy/android.hardware.media.c2@1.2-default-arm64.policy", |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 87 | }, |
| 88 | x86: { |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 89 | src: "seccomp_policy/android.hardware.media.c2@1.2-default-x86.policy", |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 90 | }, |
| 91 | x86_64: { |
Sungtak Lee | 8577dab | 2021-03-12 02:25:50 -0800 | [diff] [blame] | 92 | src: "seccomp_policy/android.hardware.media.c2@1.2-default-x86_64.policy", |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 93 | }, |
| 94 | }, |
| 95 | |
Pawin Vongmasa | bf69de9 | 2019-10-29 06:21:27 -0700 | [diff] [blame] | 96 | // This may be removed. |
| 97 | required: ["crash_dump.policy"], |
Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 98 | } |