blob: 5859fc199c45baf59b130c8312d256b1b4088005 [file] [log] [blame]
Inseob Kimb554e592019-04-15 20:10:46 +09001// Copyright (C) 2019 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 selinux
16
17import (
18 "fmt"
19 "io"
20 "strings"
21
Inseob Kimcd616492020-03-24 23:06:40 +090022 "github.com/google/blueprint"
Inseob Kimb554e592019-04-15 20:10:46 +090023 "github.com/google/blueprint/proptools"
24
25 "android/soong/android"
Inseob Kimcd616492020-03-24 23:06:40 +090026 "android/soong/sysprop"
Inseob Kimb554e592019-04-15 20:10:46 +090027)
28
Inseob Kimb554e592019-04-15 20:10:46 +090029type selinuxContextsProperties struct {
30 // Filenames under sepolicy directories, which will be used to generate contexts file.
31 Srcs []string `android:"path"`
32
33 Product_variables struct {
34 Debuggable struct {
35 Srcs []string
36 }
37
38 Address_sanitize struct {
39 Srcs []string
40 }
41 }
42
43 // Whether reqd_mask directory is included to sepolicy directories or not.
44 Reqd_mask *bool
45
46 // Whether the comments in generated contexts file will be removed or not.
47 Remove_comment *bool
48
49 // Whether the result context file is sorted with fc_sort or not.
50 Fc_sort *bool
51
52 // Make this module available when building for recovery
53 Recovery_available *bool
Inseob Kimb554e592019-04-15 20:10:46 +090054}
55
56type fileContextsProperties struct {
57 // flatten_apex can be used to specify additional sources of file_contexts.
58 // Apex paths, /system/apex/{apex_name}, will be amended to the paths of file_contexts
59 // entries.
60 Flatten_apex struct {
61 Srcs []string
62 }
63}
64
65type selinuxContextsModule struct {
66 android.ModuleBase
67
68 properties selinuxContextsProperties
69 fileContextsProperties fileContextsProperties
Inseob Kimcd616492020-03-24 23:06:40 +090070 build func(ctx android.ModuleContext, inputs android.Paths) android.Path
71 deps func(ctx android.BottomUpMutatorContext)
72 outputPath android.Path
Colin Cross040f1512019-10-02 10:36:09 -070073 installPath android.InstallPath
Inseob Kimb554e592019-04-15 20:10:46 +090074}
75
76var (
Inseob Kimcd616492020-03-24 23:06:40 +090077 reuseContextsDepTag = dependencyTag{name: "reuseContexts"}
78 syspropLibraryDepTag = dependencyTag{name: "sysprop_library"}
Inseob Kimb554e592019-04-15 20:10:46 +090079)
80
81func init() {
82 pctx.HostBinToolVariable("fc_sort", "fc_sort")
83
84 android.RegisterModuleType("file_contexts", fileFactory)
85 android.RegisterModuleType("hwservice_contexts", hwServiceFactory)
86 android.RegisterModuleType("property_contexts", propertyFactory)
87 android.RegisterModuleType("service_contexts", serviceFactory)
Janis Danisevskisc40681f2020-07-25 13:02:29 -070088 android.RegisterModuleType("keystore2_key_contexts", keystoreKeyFactory)
Inseob Kimb554e592019-04-15 20:10:46 +090089}
90
Colin Cross040f1512019-10-02 10:36:09 -070091func (m *selinuxContextsModule) InstallInRoot() bool {
Inseob Kimfa6fe472021-01-12 13:40:27 +090092 return m.InRecovery()
93}
94
95func (m *selinuxContextsModule) InstallInRecovery() bool {
96 // ModuleBase.InRecovery() checks the image variant
97 return m.InRecovery()
98}
99
100func (m *selinuxContextsModule) onlyInRecovery() bool {
101 // ModuleBase.InstallInRecovery() checks commonProperties.Recovery property
102 return m.ModuleBase.InstallInRecovery()
Colin Cross040f1512019-10-02 10:36:09 -0700103}
104
Inseob Kimcd616492020-03-24 23:06:40 +0900105func (m *selinuxContextsModule) DepsMutator(ctx android.BottomUpMutatorContext) {
106 if m.deps != nil {
107 m.deps(ctx)
108 }
Inseob Kimfa6fe472021-01-12 13:40:27 +0900109
110 if m.InRecovery() && !m.onlyInRecovery() {
111 ctx.AddFarVariationDependencies([]blueprint.Variation{
112 {Mutator: "image", Variation: android.CoreVariation},
113 }, reuseContextsDepTag, ctx.ModuleName())
114 }
Inseob Kimcd616492020-03-24 23:06:40 +0900115}
116
117func (m *selinuxContextsModule) propertyContextsDeps(ctx android.BottomUpMutatorContext) {
118 for _, lib := range sysprop.SyspropLibraries(ctx.Config()) {
119 ctx.AddFarVariationDependencies([]blueprint.Variation{}, syspropLibraryDepTag, lib)
120 }
121}
122
Inseob Kimb554e592019-04-15 20:10:46 +0900123func (m *selinuxContextsModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Inseob Kimfa6fe472021-01-12 13:40:27 +0900124 if m.InRecovery() {
Colin Cross040f1512019-10-02 10:36:09 -0700125 // Installing context files at the root of the recovery partition
126 m.installPath = android.PathForModuleInstall(ctx)
Inseob Kimb554e592019-04-15 20:10:46 +0900127 } else {
128 m.installPath = android.PathForModuleInstall(ctx, "etc", "selinux")
129 }
130
Inseob Kimfa6fe472021-01-12 13:40:27 +0900131 if m.InRecovery() && !m.onlyInRecovery() {
Inseob Kimb554e592019-04-15 20:10:46 +0900132 dep := ctx.GetDirectDepWithTag(m.Name(), reuseContextsDepTag)
133
134 if reuseDeps, ok := dep.(*selinuxContextsModule); ok {
135 m.outputPath = reuseDeps.outputPath
136 ctx.InstallFile(m.installPath, m.Name(), m.outputPath)
137 return
138 }
139 }
140
141 var inputs android.Paths
142
Paul Duffin532bde12021-07-09 22:53:03 +0100143 ctx.VisitDirectDeps(func(dep android.Module) {
144 depTag := ctx.OtherModuleDependencyTag(dep)
145 if !android.IsSourceDepTagWithOutputTag(depTag, "") {
146 return
147 }
Inseob Kimb554e592019-04-15 20:10:46 +0900148 segroup, ok := dep.(*fileGroup)
149 if !ok {
150 ctx.ModuleErrorf("srcs dependency %q is not an selinux filegroup",
151 ctx.OtherModuleName(dep))
152 return
153 }
154
155 if ctx.ProductSpecific() {
156 inputs = append(inputs, segroup.ProductPrivateSrcs()...)
157 } else if ctx.SocSpecific() {
Inseob Kim8ada8a72020-11-09 20:58:58 +0900158 if ctx.DeviceConfig().BoardSepolicyVers() == ctx.DeviceConfig().PlatformSepolicyVersion() {
159 inputs = append(inputs, segroup.SystemVendorSrcs()...)
160 }
Inseob Kimb554e592019-04-15 20:10:46 +0900161 inputs = append(inputs, segroup.VendorSrcs()...)
162 } else if ctx.DeviceSpecific() {
163 inputs = append(inputs, segroup.OdmSrcs()...)
Bowgo Tsai86a048d2019-09-09 22:04:06 +0800164 } else if ctx.SystemExtSpecific() {
165 inputs = append(inputs, segroup.SystemExtPrivateSrcs()...)
Inseob Kimb554e592019-04-15 20:10:46 +0900166 } else {
167 inputs = append(inputs, segroup.SystemPrivateSrcs()...)
Felix342b58a2020-03-02 16:13:12 +0100168 inputs = append(inputs, segroup.SystemPublicSrcs()...)
Inseob Kimb554e592019-04-15 20:10:46 +0900169 }
170
171 if proptools.Bool(m.properties.Reqd_mask) {
Inseob Kim8ada8a72020-11-09 20:58:58 +0900172 if ctx.SocSpecific() || ctx.DeviceSpecific() {
173 inputs = append(inputs, segroup.VendorReqdMaskSrcs()...)
174 } else {
175 inputs = append(inputs, segroup.SystemReqdMaskSrcs()...)
176 }
Inseob Kimb554e592019-04-15 20:10:46 +0900177 }
178 })
179
180 for _, src := range m.properties.Srcs {
181 // Module sources are handled above with VisitDirectDepsWithTag
182 if android.SrcIsModule(src) == "" {
183 inputs = append(inputs, android.PathForModuleSrc(ctx, src))
184 }
185 }
186
Inseob Kimcd616492020-03-24 23:06:40 +0900187 m.outputPath = m.build(ctx, inputs)
188 ctx.InstallFile(m.installPath, ctx.ModuleName(), m.outputPath)
Inseob Kimb554e592019-04-15 20:10:46 +0900189}
190
191func newModule() *selinuxContextsModule {
192 m := &selinuxContextsModule{}
193 m.AddProperties(
194 &m.properties,
195 )
196 android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
197 android.AddLoadHook(m, func(ctx android.LoadHookContext) {
198 m.selinuxContextsHook(ctx)
199 })
200 return m
201}
202
203func (m *selinuxContextsModule) selinuxContextsHook(ctx android.LoadHookContext) {
204 // TODO: clean this up to use build/soong/android/variable.go after b/79249983
205 var srcs []string
206
207 if ctx.Config().Debuggable() {
208 srcs = append(srcs, m.properties.Product_variables.Debuggable.Srcs...)
209 }
210
211 for _, sanitize := range ctx.Config().SanitizeDevice() {
212 if sanitize == "address" {
213 srcs = append(srcs, m.properties.Product_variables.Address_sanitize.Srcs...)
214 break
215 }
216 }
217
218 m.properties.Srcs = append(m.properties.Srcs, srcs...)
219}
220
221func (m *selinuxContextsModule) AndroidMk() android.AndroidMkData {
Colin Crossf82aed02021-11-04 17:25:55 -0700222 nameSuffix := ""
223 if m.InRecovery() && !m.onlyInRecovery() {
224 nameSuffix = ".recovery"
225 }
Inseob Kimb554e592019-04-15 20:10:46 +0900226 return android.AndroidMkData{
Colin Crossf82aed02021-11-04 17:25:55 -0700227 Class: "ETC",
228 OutputFile: android.OptionalPathForPath(m.outputPath),
229 SubName: nameSuffix,
230 Extra: []android.AndroidMkExtraFunc{
231 func(w io.Writer, outputFile android.Path) {
232 fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", m.installPath.ToMakePath().String())
233 fmt.Fprintln(w, "LOCAL_INSTALLED_MODULE_STEM :=", m.Name())
234 },
Inseob Kimb554e592019-04-15 20:10:46 +0900235 },
236 }
237}
238
Inseob Kimfa6fe472021-01-12 13:40:27 +0900239func (m *selinuxContextsModule) ImageMutatorBegin(ctx android.BaseModuleContext) {
240 if proptools.Bool(m.properties.Recovery_available) && m.InstallInRecovery() {
241 ctx.PropertyErrorf("recovery_available",
242 "doesn't make sense at the same time as `recovery: true`")
Inseob Kimb554e592019-04-15 20:10:46 +0900243 }
244}
245
Inseob Kimfa6fe472021-01-12 13:40:27 +0900246func (m *selinuxContextsModule) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
247 return !m.InstallInRecovery()
248}
249
250func (m *selinuxContextsModule) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
251 return false
252}
253
254func (m *selinuxContextsModule) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
255 return false
256}
257
Inseob Kim6cc75f42021-04-29 13:53:20 +0000258func (m *selinuxContextsModule) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
259 return false
260}
261
Inseob Kimfa6fe472021-01-12 13:40:27 +0900262func (m *selinuxContextsModule) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
263 return m.InstallInRecovery() || proptools.Bool(m.properties.Recovery_available)
264}
265
266func (m *selinuxContextsModule) ExtraImageVariations(ctx android.BaseModuleContext) []string {
267 return nil
268}
269
270func (m *selinuxContextsModule) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
271}
272
273var _ android.ImageInterface = (*selinuxContextsModule)(nil)
274
Inseob Kimcd616492020-03-24 23:06:40 +0900275func (m *selinuxContextsModule) buildGeneralContexts(ctx android.ModuleContext, inputs android.Paths) android.Path {
276 ret := android.PathForModuleGen(ctx, ctx.ModuleName()+"_m4out")
Inseob Kimb554e592019-04-15 20:10:46 +0900277
Colin Cross242c8bc2020-11-16 17:58:17 -0800278 rule := android.NewRuleBuilder(pctx, ctx)
Inseob Kimb554e592019-04-15 20:10:46 +0900279
280 rule.Command().
Dan Willemsen3c3e59b2019-06-19 10:52:50 -0700281 Tool(ctx.Config().PrebuiltBuildTool(ctx, "m4")).
282 Text("--fatal-warnings -s").
Inseob Kimb554e592019-04-15 20:10:46 +0900283 FlagForEachArg("-D", ctx.DeviceConfig().SepolicyM4Defs()).
284 Inputs(inputs).
Inseob Kimcd616492020-03-24 23:06:40 +0900285 FlagWithOutput("> ", ret)
Inseob Kimb554e592019-04-15 20:10:46 +0900286
287 if proptools.Bool(m.properties.Remove_comment) {
Inseob Kimcd616492020-03-24 23:06:40 +0900288 rule.Temporary(ret)
Inseob Kimb554e592019-04-15 20:10:46 +0900289
290 remove_comment_output := android.PathForModuleGen(ctx, ctx.ModuleName()+"_remove_comment")
291
292 rule.Command().
293 Text("sed -e 's/#.*$//' -e '/^$/d'").
Inseob Kimcd616492020-03-24 23:06:40 +0900294 Input(ret).
Inseob Kimb554e592019-04-15 20:10:46 +0900295 FlagWithOutput("> ", remove_comment_output)
296
Inseob Kimcd616492020-03-24 23:06:40 +0900297 ret = remove_comment_output
Inseob Kimb554e592019-04-15 20:10:46 +0900298 }
299
300 if proptools.Bool(m.properties.Fc_sort) {
Inseob Kimcd616492020-03-24 23:06:40 +0900301 rule.Temporary(ret)
Inseob Kimb554e592019-04-15 20:10:46 +0900302
303 sorted_output := android.PathForModuleGen(ctx, ctx.ModuleName()+"_sorted")
304
305 rule.Command().
306 Tool(ctx.Config().HostToolPath(ctx, "fc_sort")).
Inseob Kimcd616492020-03-24 23:06:40 +0900307 FlagWithInput("-i ", ret).
Inseob Kimb554e592019-04-15 20:10:46 +0900308 FlagWithOutput("-o ", sorted_output)
309
Inseob Kimcd616492020-03-24 23:06:40 +0900310 ret = sorted_output
Inseob Kimb554e592019-04-15 20:10:46 +0900311 }
312
Colin Cross242c8bc2020-11-16 17:58:17 -0800313 rule.Build("selinux_contexts", "building contexts: "+m.Name())
Inseob Kimb554e592019-04-15 20:10:46 +0900314
315 rule.DeleteTemporaryFiles()
316
Inseob Kimcd616492020-03-24 23:06:40 +0900317 return ret
Inseob Kimb554e592019-04-15 20:10:46 +0900318}
319
Inseob Kimcd616492020-03-24 23:06:40 +0900320func (m *selinuxContextsModule) buildFileContexts(ctx android.ModuleContext, inputs android.Paths) android.Path {
Inseob Kimb554e592019-04-15 20:10:46 +0900321 if m.properties.Fc_sort == nil {
322 m.properties.Fc_sort = proptools.BoolPtr(true)
323 }
324
Colin Cross242c8bc2020-11-16 17:58:17 -0800325 rule := android.NewRuleBuilder(pctx, ctx)
Inseob Kimb554e592019-04-15 20:10:46 +0900326
327 if ctx.Config().FlattenApex() {
328 for _, src := range m.fileContextsProperties.Flatten_apex.Srcs {
329 if m := android.SrcIsModule(src); m != "" {
330 ctx.ModuleErrorf(
331 "Module srcs dependency %q is not supported for flatten_apex.srcs", m)
Inseob Kimcd616492020-03-24 23:06:40 +0900332 return nil
Inseob Kimb554e592019-04-15 20:10:46 +0900333 }
334 for _, path := range android.PathsForModuleSrcExcludes(ctx, []string{src}, nil) {
335 out := android.PathForModuleGen(ctx, "flattened_apex", path.Rel())
336 apex_path := "/system/apex/" + strings.Replace(
337 strings.TrimSuffix(path.Base(), "-file_contexts"),
338 ".", "\\\\.", -1)
339
340 rule.Command().
341 Text("awk '/object_r/{printf(\""+apex_path+"%s\\n\",$0)}'").
342 Input(path).
343 FlagWithOutput("> ", out)
344
345 inputs = append(inputs, out)
346 }
347 }
348 }
349
Colin Cross242c8bc2020-11-16 17:58:17 -0800350 rule.Build(m.Name(), "flattened_apex_file_contexts")
Inseob Kimcd616492020-03-24 23:06:40 +0900351 return m.buildGeneralContexts(ctx, inputs)
Inseob Kimb554e592019-04-15 20:10:46 +0900352}
353
354func fileFactory() android.Module {
355 m := newModule()
356 m.AddProperties(&m.fileContextsProperties)
357 m.build = m.buildFileContexts
358 return m
359}
360
Inseob Kimcd616492020-03-24 23:06:40 +0900361func (m *selinuxContextsModule) buildHwServiceContexts(ctx android.ModuleContext, inputs android.Paths) android.Path {
Inseob Kimb554e592019-04-15 20:10:46 +0900362 if m.properties.Remove_comment == nil {
363 m.properties.Remove_comment = proptools.BoolPtr(true)
364 }
365
Inseob Kimcd616492020-03-24 23:06:40 +0900366 return m.buildGeneralContexts(ctx, inputs)
367}
368
Inseob Kim2bcc0452020-12-21 13:16:44 +0900369func (m *selinuxContextsModule) checkVendorPropertyNamespace(ctx android.ModuleContext, inputs android.Paths) android.Paths {
370 shippingApiLevel := ctx.DeviceConfig().ShippingApiLevel()
371 ApiLevelR := android.ApiLevelOrPanic(ctx, "R")
372
373 rule := android.NewRuleBuilder(pctx, ctx)
374
375 // This list is from vts_treble_sys_prop_test.
376 allowedPropertyPrefixes := []string{
377 "ctl.odm.",
378 "ctl.vendor.",
379 "ctl.start$odm.",
380 "ctl.start$vendor.",
381 "ctl.stop$odm.",
382 "ctl.stop$vendor.",
383 "init.svc.odm.",
384 "init.svc.vendor.",
385 "ro.boot.",
386 "ro.hardware.",
387 "ro.odm.",
388 "ro.vendor.",
389 "odm.",
390 "persist.odm.",
391 "persist.vendor.",
392 "vendor.",
393 }
394
395 // persist.camera is also allowed for devices launching with R or eariler
396 if shippingApiLevel.LessThanOrEqualTo(ApiLevelR) {
397 allowedPropertyPrefixes = append(allowedPropertyPrefixes, "persist.camera.")
398 }
399
400 var allowedContextPrefixes []string
401
402 if shippingApiLevel.GreaterThanOrEqualTo(ApiLevelR) {
403 // This list is from vts_treble_sys_prop_test.
404 allowedContextPrefixes = []string{
405 "vendor_",
406 "odm_",
407 }
408 }
409
410 var ret android.Paths
411 for _, input := range inputs {
412 cmd := rule.Command().
413 BuiltTool("check_prop_prefix").
414 FlagWithInput("--property-contexts ", input).
415 FlagForEachArg("--allowed-property-prefix ", proptools.ShellEscapeList(allowedPropertyPrefixes)). // contains shell special character '$'
416 FlagForEachArg("--allowed-context-prefix ", allowedContextPrefixes)
417
418 if !ctx.DeviceConfig().BuildBrokenVendorPropertyNamespace() {
419 cmd.Flag("--strict")
420 }
421
422 out := android.PathForModuleGen(ctx, "namespace_checked").Join(ctx, input.String())
423 rule.Command().Text("cp -f").Input(input).Output(out)
424 ret = append(ret, out)
425 }
426 rule.Build("check_namespace", "checking namespace of "+ctx.ModuleName())
427 return ret
428}
429
Inseob Kimcd616492020-03-24 23:06:40 +0900430func (m *selinuxContextsModule) buildPropertyContexts(ctx android.ModuleContext, inputs android.Paths) android.Path {
Inseob Kim2bcc0452020-12-21 13:16:44 +0900431 // vendor/odm properties are enforced for devices launching with Android Q or later. So, if
432 // vendor/odm, make sure that only vendor/odm properties exist.
433 shippingApiLevel := ctx.DeviceConfig().ShippingApiLevel()
434 ApiLevelQ := android.ApiLevelOrPanic(ctx, "Q")
435 if (ctx.SocSpecific() || ctx.DeviceSpecific()) && shippingApiLevel.GreaterThanOrEqualTo(ApiLevelQ) {
436 inputs = m.checkVendorPropertyNamespace(ctx, inputs)
437 }
438
Inseob Kimcd616492020-03-24 23:06:40 +0900439 builtCtxFile := m.buildGeneralContexts(ctx, inputs)
440
441 var apiFiles android.Paths
442 ctx.VisitDirectDepsWithTag(syspropLibraryDepTag, func(c android.Module) {
Inseob Kim3a3539a2021-01-15 18:10:29 +0900443 i, ok := c.(interface{ CurrentSyspropApiFile() android.OptionalPath })
Inseob Kimcd616492020-03-24 23:06:40 +0900444 if !ok {
445 panic(fmt.Errorf("unknown dependency %q for %q", ctx.OtherModuleName(c), ctx.ModuleName()))
446 }
Inseob Kim3a3539a2021-01-15 18:10:29 +0900447 if api := i.CurrentSyspropApiFile(); api.Valid() {
448 apiFiles = append(apiFiles, api.Path())
449 }
Inseob Kimcd616492020-03-24 23:06:40 +0900450 })
451
452 // check compatibility with sysprop_library
453 if len(apiFiles) > 0 {
454 out := android.PathForModuleGen(ctx, ctx.ModuleName()+"_api_checked")
Colin Cross242c8bc2020-11-16 17:58:17 -0800455 rule := android.NewRuleBuilder(pctx, ctx)
Inseob Kimcd616492020-03-24 23:06:40 +0900456
457 msg := `\n******************************\n` +
458 `API of sysprop_library doesn't match with property_contexts\n` +
459 `Please fix the breakage and rebuild.\n` +
460 `******************************\n`
461
462 rule.Command().
463 Text("( ").
Colin Cross242c8bc2020-11-16 17:58:17 -0800464 BuiltTool("sysprop_type_checker").
Inseob Kimcd616492020-03-24 23:06:40 +0900465 FlagForEachInput("--api ", apiFiles).
466 FlagWithInput("--context ", builtCtxFile).
467 Text(" || ( echo").Flag("-e").
468 Flag(`"` + msg + `"`).
469 Text("; exit 38) )")
470
471 rule.Command().Text("cp -f").Input(builtCtxFile).Output(out)
Colin Cross242c8bc2020-11-16 17:58:17 -0800472 rule.Build("property_contexts_check_api", "checking API: "+m.Name())
Inseob Kimcd616492020-03-24 23:06:40 +0900473 builtCtxFile = out
474 }
475
476 return builtCtxFile
Inseob Kimb554e592019-04-15 20:10:46 +0900477}
478
479func hwServiceFactory() android.Module {
480 m := newModule()
481 m.build = m.buildHwServiceContexts
482 return m
483}
484
485func propertyFactory() android.Module {
486 m := newModule()
Inseob Kimcd616492020-03-24 23:06:40 +0900487 m.build = m.buildPropertyContexts
488 m.deps = m.propertyContextsDeps
Inseob Kimb554e592019-04-15 20:10:46 +0900489 return m
490}
491
492func serviceFactory() android.Module {
493 m := newModule()
494 m.build = m.buildGeneralContexts
495 return m
496}
Janis Danisevskisc40681f2020-07-25 13:02:29 -0700497
498func keystoreKeyFactory() android.Module {
499 m := newModule()
500 m.build = m.buildGeneralContexts
501 return m
502}