1234567891011121314151617181920212223242526272829 |
- package oemlockndk
- import (
- "android/soong/android"
- "android/soong/cc"
- )
- func init() {
- android.RegisterModuleType("cc_oemlock_binary", OemlockDefaultsFactory)
- }
- func OemlockDefaultsFactory() (android.Module) {
- module := cc.DefaultsFactory()
- android.AddLoadHook(module, OemlockHook)
- return module
- }
- func OemlockHook(ctx android.LoadHookContext) {
- type props struct {
- Shared_libs []string
- }
- p := &props{}
- if ctx.AConfig().PlatformSdkVersion().FinalOrFutureInt() <= 31 {
- p.Shared_libs = append(p.Shared_libs, "android.hardware.oemlock-V1-ndk_platform")
- } else {
- p.Shared_libs = append(p.Shared_libs, "android.hardware.oemlock-V1-ndk")
- }
- ctx.AppendProperties(p)
- }
|