package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

cc_binary {
    name: "android.hardware.gatekeeper-service.nonsecure",
    cflags: [
        "-fvisibility=hidden",
        "-Wall",
        "-Werror",
    ],
    installable: false, // installed in APEX
    relative_install_path: "hw",
    shared_libs: [
        "android.hardware.gatekeeper-V1-ndk",
        "android.hardware.security.sharedsecret-V1-ndk",
        "lib_android_keymaster_keymint_utils",
        "libbase",
        "libbinder_ndk",
        "libcrypto",
        "libcutils",
        "libgatekeeper",
        "libhardware",
        "libkeymaster_portable",
        "liblog",
        "libutils",
    ],
    srcs: [
        "GateKeeper.cpp",
        "SharedSecret.cpp",
        "service.cpp",
    ],
    static_libs: ["libscrypt_static"],
    vendor: true,
}

prebuilt_etc {
    name: "gatekeeper_nonsecure_vintf",
    srcs: [
        "android.hardware.gatekeeper-service.nonsecure.xml",
        "android.hardware.security.sharedsecret-gatekeeper.xml",
    ],
    sub_dir: "vintf",
    installable: false,
}

prebuilt_etc {
    name: "android.hardware.gatekeeper-service.nonsecure.rc",
    src: "android.hardware.gatekeeper-service.nonsecure.rc",
    installable: false,
}

apex {
    name: "com.android.hardware.gatekeeper.nonsecure",
    binaries: ["android.hardware.gatekeeper-service.nonsecure"],
    certificate: ":com.google.cf.apex.certificate",
    file_contexts: "file_contexts",
    key: "com.google.cf.apex.key",
    manifest: "manifest.json",
    prebuilts: [
        "gatekeeper_nonsecure_vintf",
        "android.hardware.gatekeeper-service.nonsecure.rc",
    ],
    updatable: false,
    vendor: true,
}
