1// Copyright (C) 2023 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19// Encapsulate the contributions made by the com.android.crashrecovery to the bootclasspath.
20bootclasspath_fragment {
21    // This fragment will be enabled using release_crashrecovery_module flag
22    enabled: select(release_flag("RELEASE_CRASHRECOVERY_MODULE"), {
23        true: true,
24        false: false,
25    }),
26
27    name: "com.android.crashrecovery-bootclasspath-fragment",
28    contents: ["framework-crashrecovery"],
29    apex_available: ["com.android.crashrecovery"],
30    hidden_api: {
31        split_packages: ["*"], // TODO(b/289203818) be more specific
32    },
33    // The bootclasspath_fragments that provide APIs on which this depends.
34    fragments: [
35
36        // Needed to access core java APIs.
37        {
38            apex: "com.android.art",
39            module: "art-bootclasspath-fragment",
40        },
41    ],
42
43    // Additional stubs libraries that this fragment's contents use which are
44    // not provided by another bootclasspath_fragment.
45    additional_stubs: [
46        // Needed to access platform APIs.
47        "android-non-updatable",
48    ],
49}
50
51// Encapsulate the contributions made by the com.android.crashrecovery to the systemserverclasspath.
52systemserverclasspath_fragment {
53    // This fragment will be enabled using release_crashrecovery_module flag
54    enabled: select(release_flag("RELEASE_CRASHRECOVERY_MODULE"), {
55        true: true,
56        false: false,
57    }),
58
59    name: "com.android.crashrecovery-systemserverclasspath-fragment",
60    contents: ["service-crashrecovery"],
61    apex_available: ["com.android.crashrecovery"],
62}
63
64apex_key {
65    name: "com.android.crashrecovery.key",
66    public_key: "com.android.crashrecovery.avbpubkey",
67    private_key: "com.android.crashrecovery.pem",
68}
69
70android_app_certificate {
71    name: "com.android.crashrecovery.certificate",
72    certificate: "com.android.crashrecovery",
73}
74
75apex {
76    // This apex will be enabled using release_crashrecovery_module flag
77    enabled: select(release_flag("RELEASE_CRASHRECOVERY_MODULE"), {
78        true: true,
79        false: false,
80    }),
81
82    name: "com.android.crashrecovery",
83    defaults: ["v-launched-apex-module"],
84    bootclasspath_fragments: ["com.android.crashrecovery-bootclasspath-fragment"],
85    systemserverclasspath_fragments: [
86        "com.android.crashrecovery-systemserverclasspath-fragment",
87    ],
88    file_contexts: ":com.android.crashrecovery-file_contexts",
89    prebuilts: [
90        "current_sdkinfo",
91    ],
92    key: "com.android.crashrecovery.key",
93    certificate: ":com.android.crashrecovery.certificate",
94    manifest: "manifest.json",
95    min_sdk_version: "34",
96}
97
98sdk {
99    // This sdk will be enabled using release_crashrecovery_module flag
100    enabled: select(release_flag("RELEASE_CRASHRECOVERY_MODULE"), {
101        true: true,
102        false: false,
103    }),
104
105    name: "crashrecovery-sdk",
106    apexes: ["com.android.crashrecovery"],
107}
108