• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2018 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
19java_sdk_library {
20    name: "android.net.ipsec.ike",
21    installable: true,
22    defaults: ["framework-module-defaults"],
23
24    // ike is used as a shared library.
25    shared_library: true,
26    compile_dex: true,
27
28    aidl: {
29        local_include_dirs: ["src/java"],
30    },
31    srcs: [":ike-srcs"],
32
33    static_libs: [
34        "ike-internals",
35    ],
36
37    libs: [
38        "unsupportedappusage",
39        "framework-annotations-lib",
40        "conscrypt.module.public.api",
41        "framework-connectivity.stubs.module_lib",
42    ],
43    stub_only_libs: ["framework-connectivity.stubs.module_lib"],
44
45    api_packages: [
46        "android.net.eap",
47        "android.net.ipsec.ike",
48        "android.net.ipsec.ike.exceptions",
49        "android.net.ipsec.ike.exceptions.protocol",
50        "android.net.ipsec.ike.ike3gpp",
51    ],
52
53    hidden_api_packages: [
54        "com.android.internal.net",
55    ],
56
57    // Shared filegroups of BouncyCastle and frameworks are jar-jar'ed to avoid
58    // being overwritten by the frameworks class copies.
59    jarjar_rules: "jarjar-rules-shared.txt",
60
61    hostdex: true, // for hiddenapi check
62    apex_available: [
63        "com.android.ipsec",
64        "test_com.android.ipsec",
65    ],
66
67    permitted_packages: [
68       "com.android.internal.net",
69       "android.net.ipsec.ike",
70       "android.net.eap",
71    ],
72    min_sdk_version: "30",
73}
74
75filegroup {
76    name: "ike-srcs",
77    srcs: [
78        ":ike-internal-srcs",
79        ":framework-ike-shared-srcs",
80    ],
81}
82
83filegroup {
84    name: "ike-internal-srcs",
85    srcs: ["src/java/**/*.java"],
86    path: "src/java/",
87}
88
89filegroup {
90    name: "ike-aes-xcbc",
91    srcs: ["src/java/**/AesXCbcImpl.java"],
92}
93
94// Provides internal classes needed to build the ike sources.
95java_library {
96    name: "ike-internals",
97    apex_available: [
98        "com.android.ipsec",
99        "test_com.android.ipsec",
100    ],
101    static_libs: [
102        "bouncycastle_ike_digests",
103        "modules-utils-build",],
104    sdk_version: "module_current",
105}
106
107java_library {
108    name: "ike_test",
109    installable: false, // Used only for testing; never installed alone.
110    srcs: [":ike-srcs"],
111    libs: [
112        "unsupportedappusage",
113        "conscrypt.module.public.api"
114    ],
115    static_libs: ["ike-internals"],
116
117    // Shared filegroups of BouncyCastle and frameworks are jar-jar'ed to avoid
118    // being overwritten by the frameworks class copies and break code coverage
119    // reports. IKE source files are jarjared to avoid this test jar being
120    // overshadowed by the IKE jar in framework and bootclasspath which will
121    // cause compiling and runtime errors respectively.
122    jarjar_rules: "jarjar-rules-test.txt",
123}
124
125java_library {
126    name: "ike-test-utils-dependency",
127    installable: false, // Used only for building the "ike-test-utils"
128    srcs: ["src/java/**/IkeCertUtils.java"],
129    jarjar_rules: "jarjar-rules-test.txt",
130}
131
132java_library {
133    name: "ike-test-utils",
134    srcs: ["tests/iketests/src/java/**/CertUtils.java"],
135    static_libs: ["ike-test-utils-dependency"],
136    libs: ["androidx.test.rules"],
137    visibility: ["//packages/modules/IPsec/tests/cts"]
138}
139
140sdk {
141    name: "ipsec-module-sdk",
142    bootclasspath_fragments: ["com.android.ipsec-bootclasspath-fragment"],
143}
144