| func globalFlags(ctx android.BaseContext) []string { |
| if getMakeVars(ctx, "AB_OTA_UPDATER") == "true" { |
| cflags = append(cflags, "-DAB_OTA_UPDATER=1") |
| if getMakeVars(ctx, "TW_USE_FSCRYPT_POLICY") == "1" { |
| cflags = append(cflags, "-DUSE_FSCRYPT_POLICY_V1") |
| cflags = append(cflags, "-DUSE_FSCRYPT_POLICY_V2") |
| func globalSrcs(ctx android.BaseContext) []string { |
| if getMakeVars(ctx, "TWRP_CUSTOM_KEYBOARD") != "" { |
| srcs = append(srcs, getMakeVars(ctx, "TWRP_CUSTOM_KEYBOARD")) |
| func libAospRecoveryDefaults(ctx android.LoadHookContext) { |
| p.Cflags = globalFlags(ctx) |
| android.RegisterModuleType("libaosprecovery_defaults", libAospRecoveryDefaultsFactory) |
| func libAospRecoveryDefaultsFactory() android.Module { |
| module := cc.DefaultsFactory() |
| android.AddLoadHook(module, libAospRecoveryDefaults) |