blob: a60f6b82c3ae86ea53f3ec2c3a47ee1b2ef93d2c [file] [log] [blame]
satayev95e9c5b2021-04-29 11:50:26 +01001// Copyright 2021 Google Inc. All rights reserved.
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 java
16
17import (
18 "android/soong/android"
satayev013485b2021-05-06 23:38:10 +010019 "android/soong/dexpreopt"
Colin Crossc33e5212021-05-25 18:16:02 -070020
satayev9366a052021-05-17 21:13:44 +010021 "github.com/google/blueprint"
Spandan Das7103c4f2024-11-11 22:31:55 +000022 "github.com/google/blueprint/proptools"
satayev95e9c5b2021-04-29 11:50:26 +010023)
24
25func init() {
26 registerSystemserverClasspathBuildComponents(android.InitRegistrationContext)
Jiakai Zhanga8d86602021-09-26 09:02:17 +000027
Paul Duffin4e7d1c42022-05-13 13:12:19 +000028 android.RegisterSdkMemberType(SystemServerClasspathFragmentSdkMemberType)
satayev95e9c5b2021-04-29 11:50:26 +010029}
30
31func registerSystemserverClasspathBuildComponents(ctx android.RegistrationContext) {
satayev95e9c5b2021-04-29 11:50:26 +010032 ctx.RegisterModuleType("platform_systemserverclasspath", platformSystemServerClasspathFactory)
satayevaa86bac2021-05-13 19:01:52 +010033 ctx.RegisterModuleType("systemserverclasspath_fragment", systemServerClasspathFactory)
Jiakai Zhangc9864272021-09-26 03:52:19 +000034 ctx.RegisterModuleType("prebuilt_systemserverclasspath_fragment", prebuiltSystemServerClasspathModuleFactory)
satayev95e9c5b2021-04-29 11:50:26 +010035}
36
Paul Duffin4e7d1c42022-05-13 13:12:19 +000037var SystemServerClasspathFragmentSdkMemberType = &systemServerClasspathFragmentMemberType{
38 SdkMemberTypeBase: android.SdkMemberTypeBase{
39 PropertyName: "systemserverclasspath_fragments",
40 SupportsSdk: true,
41
42 // Support for adding systemserverclasspath_fragments to the sdk snapshot was only added in
43 // Tiramisu.
44 SupportedBuildReleaseSpecification: "Tiramisu+",
45 },
46}
47
satayev95e9c5b2021-04-29 11:50:26 +010048type platformSystemServerClasspathModule struct {
49 android.ModuleBase
50
51 ClasspathFragmentBase
52}
53
54func platformSystemServerClasspathFactory() android.Module {
55 m := &platformSystemServerClasspathModule{}
56 initClasspathFragment(m, SYSTEMSERVERCLASSPATH)
57 android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
58 return m
59}
60
Colin Crosse5c7d7c2024-12-18 17:08:07 -080061func (m *platformSystemServerClasspathModule) UniqueApexVariations() bool {
62 return true
63}
64
satayevaa86bac2021-05-13 19:01:52 +010065func (p *platformSystemServerClasspathModule) AndroidMkEntries() (entries []android.AndroidMkEntries) {
66 return p.classpathFragmentBase().androidMkEntries()
satayev95e9c5b2021-04-29 11:50:26 +010067}
68
satayevaa86bac2021-05-13 19:01:52 +010069func (p *platformSystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
satayevb3090502021-06-15 17:49:10 +010070 configuredJars := p.configuredJars(ctx)
71 classpathJars := configuredJarListToClasspathJars(ctx, configuredJars, p.classpathType)
Jiakai Zhangcee9e192021-10-29 19:46:45 +000072 standaloneConfiguredJars := p.standaloneConfiguredJars(ctx)
73 standaloneClasspathJars := configuredJarListToClasspathJars(ctx, standaloneConfiguredJars, STANDALONE_SYSTEMSERVER_JARS)
Jiakai Zhang389a6472021-12-14 18:54:06 +000074 configuredJars = configuredJars.AppendList(&standaloneConfiguredJars)
Jiakai Zhangcee9e192021-10-29 19:46:45 +000075 classpathJars = append(classpathJars, standaloneClasspathJars...)
satayevb3090502021-06-15 17:49:10 +010076 p.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars, classpathJars)
Inseob Kimdd532492024-04-30 17:22:58 +090077 p.classpathFragmentBase().installClasspathProto(ctx)
satayev013485b2021-05-06 23:38:10 +010078}
79
satayev142ed272021-06-15 16:21:17 +010080func (p *platformSystemServerClasspathModule) configuredJars(ctx android.ModuleContext) android.ConfiguredJarList {
satayevb3090502021-06-15 17:49:10 +010081 // TODO(satayev): include any apex jars that don't populate their classpath proto config.
82 return dexpreopt.GetGlobalConfig(ctx).SystemServerJars
satayev95e9c5b2021-04-29 11:50:26 +010083}
satayevaa86bac2021-05-13 19:01:52 +010084
Jiakai Zhangcee9e192021-10-29 19:46:45 +000085func (p *platformSystemServerClasspathModule) standaloneConfiguredJars(ctx android.ModuleContext) android.ConfiguredJarList {
86 return dexpreopt.GetGlobalConfig(ctx).StandaloneSystemServerJars
87}
88
satayev333a1732021-05-17 21:35:26 +010089type SystemServerClasspathModule struct {
satayevaa86bac2021-05-13 19:01:52 +010090 android.ModuleBase
satayev333a1732021-05-17 21:35:26 +010091 android.ApexModuleBase
satayevaa86bac2021-05-13 19:01:52 +010092
93 ClasspathFragmentBase
satayev9366a052021-05-17 21:13:44 +010094
95 properties systemServerClasspathFragmentProperties
96}
97
Yu Liudf0b8392025-02-12 18:27:03 +000098var _ android.ApexModule = (*SystemServerClasspathModule)(nil)
99
100func (m *SystemServerClasspathModule) MinSdkVersionSupported(ctx android.BaseModuleContext) android.ApiLevel {
101 return android.MinApiLevel
satayev333a1732021-05-17 21:35:26 +0100102}
103
satayev9366a052021-05-17 21:13:44 +0100104type systemServerClasspathFragmentProperties struct {
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000105 // List of system_server classpath jars, could be either java_library, or java_sdk_library.
satayev9366a052021-05-17 21:13:44 +0100106 //
107 // The order of this list matters as it is the order that is used in the SYSTEMSERVERCLASSPATH.
Spandan Das7103c4f2024-11-11 22:31:55 +0000108 Contents proptools.Configurable[[]string] `android:"arch_variant"`
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000109
110 // List of jars that system_server loads dynamically using separate classloaders.
111 //
112 // The order does not matter.
Spandan Das7103c4f2024-11-11 22:31:55 +0000113 Standalone_contents proptools.Configurable[[]string] `android:"arch_variant"`
satayevaa86bac2021-05-13 19:01:52 +0100114}
115
116func systemServerClasspathFactory() android.Module {
satayev333a1732021-05-17 21:35:26 +0100117 m := &SystemServerClasspathModule{}
satayev9366a052021-05-17 21:13:44 +0100118 m.AddProperties(&m.properties)
satayev333a1732021-05-17 21:35:26 +0100119 android.InitApexModule(m)
satayevaa86bac2021-05-13 19:01:52 +0100120 initClasspathFragment(m, SYSTEMSERVERCLASSPATH)
121 android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
122 return m
123}
Colin Cross1cea5302024-12-03 16:40:08 -0800124
Colin Crosse5c7d7c2024-12-18 17:08:07 -0800125func (m *SystemServerClasspathModule) UniqueApexVariations() bool {
126 return true
127}
satayevaa86bac2021-05-13 19:01:52 +0100128
satayev333a1732021-05-17 21:35:26 +0100129func (s *SystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Spandan Das7103c4f2024-11-11 22:31:55 +0000130 if len(s.properties.Contents.GetOrDefault(ctx, nil)) == 0 && len(s.properties.Standalone_contents.GetOrDefault(ctx, nil)) == 0 {
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000131 ctx.PropertyErrorf("contents", "Either contents or standalone_contents needs to be non-empty")
satayev9366a052021-05-17 21:13:44 +0100132 }
133
satayevb3090502021-06-15 17:49:10 +0100134 configuredJars := s.configuredJars(ctx)
135 classpathJars := configuredJarListToClasspathJars(ctx, configuredJars, s.classpathType)
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000136 standaloneConfiguredJars := s.standaloneConfiguredJars(ctx)
137 standaloneClasspathJars := configuredJarListToClasspathJars(ctx, standaloneConfiguredJars, STANDALONE_SYSTEMSERVER_JARS)
Jiakai Zhang389a6472021-12-14 18:54:06 +0000138 configuredJars = configuredJars.AppendList(&standaloneConfiguredJars)
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000139 classpathJars = append(classpathJars, standaloneClasspathJars...)
satayevb3090502021-06-15 17:49:10 +0100140 s.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars, classpathJars)
Spandan Dasfbcd5fe2024-09-30 22:30:39 +0000141 s.setPartitionInfoOfLibraries(ctx)
142}
143
144// Map of java library name to their install partition.
145type LibraryNameToPartitionInfo struct {
146 LibraryNameToPartition map[string]string
147}
148
149// LibraryNameToPartitionInfoProvider will be used by the top-level apex to enforce that dexpreopt files
150// of apex system server jars are installed in the same partition as the top-level apex.
151var LibraryNameToPartitionInfoProvider = blueprint.NewProvider[LibraryNameToPartitionInfo]()
152
153func (s *SystemServerClasspathModule) setPartitionInfoOfLibraries(ctx android.ModuleContext) {
154 libraryNameToPartition := map[string]string{}
155 ctx.VisitDirectDepsWithTag(systemServerClasspathFragmentContentDepTag, func(m android.Module) {
156 libraryNameToPartition[m.Name()] = m.PartitionTag(ctx.DeviceConfig())
157 })
158 android.SetProvider(ctx, LibraryNameToPartitionInfoProvider, LibraryNameToPartitionInfo{
159 LibraryNameToPartition: libraryNameToPartition,
160 })
satayevaa86bac2021-05-13 19:01:52 +0100161}
162
satayev142ed272021-06-15 16:21:17 +0100163func (s *SystemServerClasspathModule) configuredJars(ctx android.ModuleContext) android.ConfiguredJarList {
satayev703c67a2021-05-20 21:33:41 +0100164 global := dexpreopt.GetGlobalConfig(ctx)
165
Spandan Das7103c4f2024-11-11 22:31:55 +0000166 possibleUpdatableModules := gatherPossibleApexModuleNamesAndStems(ctx, s.properties.Contents.GetOrDefault(ctx, nil), systemServerClasspathFragmentContentDepTag)
satayevd34eb0c2021-08-06 13:20:28 +0100167 jars, unknown := global.ApexSystemServerJars.Filter(possibleUpdatableModules)
168 // TODO(satayev): remove geotz ssc_fragment, since geotz is not part of SSCP anymore.
169 _, unknown = android.RemoveFromList("geotz", unknown)
Keun young Parkd64ab232021-10-18 08:42:23 -0700170 // This module only exists in car products.
171 // So ignore it even if it is not in PRODUCT_APEX_SYSTEM_SERVER_JARS.
172 // TODO(b/203233647): Add better mechanism to make it optional.
173 _, unknown = android.RemoveFromList("car-frameworks-service-module", unknown)
Samiul Islam7b385c52021-10-11 22:47:13 +0100174
Alan Stokesbcd567e2021-11-12 15:21:43 +0000175 // This module is optional, so it is not present in all products.
176 // (See PRODUCT_ISOLATED_COMPILATION_ENABLED.)
177 // So ignore it even if it is not in PRODUCT_APEX_SYSTEM_SERVER_JARS.
178 // TODO(b/203233647): Add better mechanism to make it optional.
179 _, unknown = android.RemoveFromList("service-compos", unknown)
180
Samiul Islam7b385c52021-10-11 22:47:13 +0100181 // TODO(satayev): for apex_test we want to include all contents unconditionally to classpaths
182 // config. However, any test specific jars would not be present in ApexSystemServerJars. Instead,
183 // we should check if we are creating a config for apex_test via ApexInfo and amend the values.
184 // This is an exception to support end-to-end test for ApexdUnitTests, until such support exists.
185 if android.InList("test_service-apexd", possibleUpdatableModules) {
186 jars = jars.Append("com.android.apex.test_package", "test_service-apexd")
Paul Duffin458a15b2022-11-25 12:18:24 +0000187 } else if global.ApexSystemServerJars.Len() > 0 && len(unknown) > 0 {
Samiul Islam7b385c52021-10-11 22:47:13 +0100188 // For non test apexes, make sure that all contents are actually declared in make.
Ulya Trafimoviche5b2b492021-10-04 15:42:53 +0100189 ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_SYSTEM_SERVER_JARS", unknown)
satayevd34eb0c2021-08-06 13:20:28 +0100190 }
191
192 return jars
satayevaa86bac2021-05-13 19:01:52 +0100193}
satayev9366a052021-05-17 21:13:44 +0100194
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000195func (s *SystemServerClasspathModule) standaloneConfiguredJars(ctx android.ModuleContext) android.ConfiguredJarList {
196 global := dexpreopt.GetGlobalConfig(ctx)
197
Spandan Das7103c4f2024-11-11 22:31:55 +0000198 possibleUpdatableModules := gatherPossibleApexModuleNamesAndStems(ctx, s.properties.Standalone_contents.GetOrDefault(ctx, nil), systemServerClasspathFragmentContentDepTag)
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000199 jars, _ := global.ApexStandaloneSystemServerJars.Filter(possibleUpdatableModules)
200
201 // TODO(jiakaiz): add a check to ensure that the contents are declared in make.
202
203 return jars
204}
205
satayev9366a052021-05-17 21:13:44 +0100206type systemServerClasspathFragmentContentDependencyTag struct {
207 blueprint.BaseDependencyTag
208}
209
Paul Duffin25322e42021-09-07 14:52:48 +0100210// The systemserverclasspath_fragment contents must never depend on prebuilts.
211func (systemServerClasspathFragmentContentDependencyTag) ReplaceSourceWithPrebuilt() bool {
212 return false
213}
214
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000215// SdkMemberType causes dependencies added with this tag to be automatically added to the sdk as if
216// they were specified using java_systemserver_libs or java_sdk_libs.
217func (b systemServerClasspathFragmentContentDependencyTag) SdkMemberType(child android.Module) android.SdkMemberType {
218 // If the module is a java_sdk_library then treat it as if it was specified in the java_sdk_libs
219 // property, otherwise treat if it was specified in the java_systemserver_libs property.
220 if javaSdkLibrarySdkMemberType.IsInstance(child) {
221 return javaSdkLibrarySdkMemberType
222 }
223
Spandan Das159b2642024-03-20 21:22:47 +0000224 return JavaSystemserverLibsSdkMemberType
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000225}
226
227func (b systemServerClasspathFragmentContentDependencyTag) ExportMember() bool {
228 return true
229}
230
Jiakai Zhang774dd302021-09-26 03:54:25 +0000231// Contents of system server fragments require files from prebuilt apex files.
232func (systemServerClasspathFragmentContentDependencyTag) RequiresFilesFromPrebuiltApex() {}
233
Paul Duffin25322e42021-09-07 14:52:48 +0100234var _ android.ReplaceSourceWithPrebuilt = systemServerClasspathFragmentContentDepTag
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000235var _ android.SdkMemberDependencyTag = systemServerClasspathFragmentContentDepTag
Jiakai Zhang774dd302021-09-26 03:54:25 +0000236var _ android.RequiresFilesFromPrebuiltApexTag = systemServerClasspathFragmentContentDepTag
Colin Crossc33e5212021-05-25 18:16:02 -0700237
satayev9366a052021-05-17 21:13:44 +0100238// The tag used for the dependency between the systemserverclasspath_fragment module and its contents.
239var systemServerClasspathFragmentContentDepTag = systemServerClasspathFragmentContentDependencyTag{}
240
241func IsSystemServerClasspathFragmentContentDepTag(tag blueprint.DependencyTag) bool {
242 return tag == systemServerClasspathFragmentContentDepTag
243}
244
Spandan Das746161d2024-08-21 22:47:53 +0000245// The dexpreopt artifacts of apex system server jars are installed onto system image.
246func (s systemServerClasspathFragmentContentDependencyTag) InstallDepNeeded() bool {
247 return true
248}
249
satayev333a1732021-05-17 21:35:26 +0100250func (s *SystemServerClasspathModule) ComponentDepsMutator(ctx android.BottomUpMutatorContext) {
satayev9366a052021-05-17 21:13:44 +0100251 module := ctx.Module()
Jiakai Zhangc9864272021-09-26 03:52:19 +0000252 _, isSourceModule := module.(*SystemServerClasspathModule)
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000253 var deps []string
Spandan Das7103c4f2024-11-11 22:31:55 +0000254 deps = append(deps, s.properties.Contents.GetOrDefault(ctx, nil)...)
255 deps = append(deps, s.properties.Standalone_contents.GetOrDefault(ctx, nil)...)
satayev9366a052021-05-17 21:13:44 +0100256
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000257 for _, name := range deps {
Jiakai Zhangc9864272021-09-26 03:52:19 +0000258 // A systemserverclasspath_fragment must depend only on other source modules, while the
259 // prebuilt_systemserverclasspath_fragment_fragment must only depend on other prebuilt modules.
260 if !isSourceModule {
261 name = android.PrebuiltNameFromSource(name)
262 }
satayev9366a052021-05-17 21:13:44 +0100263 ctx.AddDependency(module, systemServerClasspathFragmentContentDepTag, name)
264 }
265}
braleeb0c1f0c2021-06-07 22:49:13 +0800266
267// Collect information for opening IDE project files in java/jdeps.go.
Cole Faustb36d31d2024-08-27 16:04:28 -0700268func (s *SystemServerClasspathModule) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
Spandan Das7103c4f2024-11-11 22:31:55 +0000269 dpInfo.Deps = append(dpInfo.Deps, s.properties.Contents.GetOrDefault(ctx, nil)...)
270 dpInfo.Deps = append(dpInfo.Deps, s.properties.Standalone_contents.GetOrDefault(ctx, nil)...)
braleeb0c1f0c2021-06-07 22:49:13 +0800271}
Jiakai Zhangc9864272021-09-26 03:52:19 +0000272
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000273type systemServerClasspathFragmentMemberType struct {
274 android.SdkMemberTypeBase
275}
276
277func (s *systemServerClasspathFragmentMemberType) AddDependencies(ctx android.SdkDependencyContext, dependencyTag blueprint.DependencyTag, names []string) {
278 ctx.AddVariationDependencies(nil, dependencyTag, names...)
279}
280
281func (s *systemServerClasspathFragmentMemberType) IsInstance(module android.Module) bool {
282 _, ok := module.(*SystemServerClasspathModule)
283 return ok
284}
285
286func (s *systemServerClasspathFragmentMemberType) AddPrebuiltModule(ctx android.SdkMemberContext, member android.SdkMember) android.BpModule {
287 return ctx.SnapshotBuilder().AddPrebuiltModule(member, "prebuilt_systemserverclasspath_fragment")
288}
289
290func (s *systemServerClasspathFragmentMemberType) CreateVariantPropertiesStruct() android.SdkMemberProperties {
291 return &systemServerClasspathFragmentSdkMemberProperties{}
292}
293
294type systemServerClasspathFragmentSdkMemberProperties struct {
295 android.SdkMemberPropertiesBase
296
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000297 // List of system_server classpath jars, could be either java_library, or java_sdk_library.
298 //
299 // The order of this list matters as it is the order that is used in the SYSTEMSERVERCLASSPATH.
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000300 Contents []string
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000301
302 // List of jars that system_server loads dynamically using separate classloaders.
303 //
304 // The order does not matter.
305 Standalone_contents []string
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000306}
307
308func (s *systemServerClasspathFragmentSdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
309 module := variant.(*SystemServerClasspathModule)
310
Spandan Das7103c4f2024-11-11 22:31:55 +0000311 s.Contents = module.properties.Contents.GetOrDefault(ctx.SdkModuleContext(), nil)
312 s.Standalone_contents = module.properties.Standalone_contents.GetOrDefault(ctx.SdkModuleContext(), nil)
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000313}
314
315func (s *systemServerClasspathFragmentSdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) {
316 builder := ctx.SnapshotBuilder()
317 requiredMemberDependency := builder.SdkMemberReferencePropertyTag(true)
318
319 if len(s.Contents) > 0 {
320 propertySet.AddPropertyWithTag("contents", s.Contents, requiredMemberDependency)
321 }
Jiakai Zhangcee9e192021-10-29 19:46:45 +0000322
323 if len(s.Standalone_contents) > 0 {
324 propertySet.AddPropertyWithTag("standalone_contents", s.Standalone_contents, requiredMemberDependency)
325 }
Jiakai Zhanga8d86602021-09-26 09:02:17 +0000326}
327
328var _ android.SdkMemberType = (*systemServerClasspathFragmentMemberType)(nil)
329
Jiakai Zhangc9864272021-09-26 03:52:19 +0000330// A prebuilt version of the systemserverclasspath_fragment module.
331type prebuiltSystemServerClasspathModule struct {
332 SystemServerClasspathModule
333 prebuilt android.Prebuilt
334}
335
336func (module *prebuiltSystemServerClasspathModule) Prebuilt() *android.Prebuilt {
337 return &module.prebuilt
338}
339
340func (module *prebuiltSystemServerClasspathModule) Name() string {
341 return module.prebuilt.Name(module.ModuleBase.Name())
342}
343
Jiakai Zhang774dd302021-09-26 03:54:25 +0000344func (module *prebuiltSystemServerClasspathModule) RequiredFilesFromPrebuiltApex(ctx android.BaseModuleContext) []string {
345 return nil
346}
347
Spandan Das2ea84dd2024-01-25 22:12:50 +0000348func (module *prebuiltSystemServerClasspathModule) UseProfileGuidedDexpreopt() bool {
349 return false
350}
351
Jiakai Zhang774dd302021-09-26 03:54:25 +0000352var _ android.RequiredFilesFromPrebuiltApex = (*prebuiltSystemServerClasspathModule)(nil)
353
Jiakai Zhangc9864272021-09-26 03:52:19 +0000354func prebuiltSystemServerClasspathModuleFactory() android.Module {
355 m := &prebuiltSystemServerClasspathModule{}
356 m.AddProperties(&m.properties)
357 // This doesn't actually have any prebuilt files of its own so pass a placeholder for the srcs
358 // array.
359 android.InitPrebuiltModule(m, &[]string{"placeholder"})
360 android.InitApexModule(m)
361 android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
362 return m
363}