-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvold_defaults.go
More file actions
45 lines (36 loc) · 827 Bytes
/
vold_defaults.go
File metadata and controls
45 lines (36 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package twrp
import (
"android/soong/android"
"android/soong/cc"
)
func globalFlags(ctx android.BaseContext) []string {
var cflags []string
if getMakeVars(ctx, "TW_USE_FSCRYPT_POLICY") == "1" {
cflags = append(cflags, "-DUSE_FSCRYPT_POLICY_V1")
} else {
cflags = append(cflags, "-DUSE_FSCRYPT_POLICY_V2")
}
return cflags
}
func libVoldDefaults(ctx android.LoadHookContext) {
type props struct {
Target struct {
Android struct {
Cflags []string
Enabled *bool
}
}
Cflags []string
}
p := &props{}
p.Cflags = globalFlags(ctx)
ctx.AppendProperties(p)
}
func init() {
android.RegisterModuleType("vold_defaults", libVoldDefaultsFactory)
}
func libVoldDefaultsFactory() android.Module {
module := cc.DefaultsFactory()
android.AddLoadHook(module, libVoldDefaults)
return module
}