package {
    default_applicable_licenses: ["hardware_interfaces_license"],
}

apex_key {
    name: "com.android.hardware.sensors.key",
    public_key: "com.android.hardware.sensors.avbpubkey",
    private_key: "com.android.hardware.sensors.pem",
}

android_app_certificate {
    name: "com.android.hardware.sensors.certificate",
    certificate: "com.android.hardware.sensors",
}

genrule {
    name: "com.android.hardware.sensors.rc-gen",
    srcs: [":sensors-default.rc"],
    out: ["com.android.hardware.sensors.rc"],
    cmd: "sed -E 's/\\/vendor/\\/apex\\/com.android.hardware.sensors/' $(in) > $(out)",
}

prebuilt_etc {
    name: "com.android.hardware.sensors.rc",
    src: ":com.android.hardware.sensors.rc-gen",
    installable: false,
}

// Default vendor APEX for android.hardware.sensors.
// Custom implementations may use override_apex based on this APEX.
apex {
    name: "com.android.hardware.sensors",
    manifest: "apex_manifest.json",
    key: "com.android.hardware.sensors.key",
    certificate: ":com.android.hardware.sensors.certificate",
    file_contexts: "file_contexts",
    use_vndk_as_stable: true,
    updatable: false,
    // Install the apex in /vendor/apex
    soc_specific: true,
    binaries: ["android.hardware.sensors-service.example"],
    prebuilts: [
        "com.android.hardware.sensors.rc",
        "android.hardware.sensor.ambient_temperature.prebuilt.xml",
        "android.hardware.sensor.barometer.prebuilt.xml",
        "android.hardware.sensor.gyroscope.prebuilt.xml",
        "android.hardware.sensor.hinge_angle.prebuilt.xml",
        "android.hardware.sensor.light.prebuilt.xml",
        "android.hardware.sensor.proximity.prebuilt.xml",
        "android.hardware.sensor.relative_humidity.prebuilt.xml",
    ],
    vintf_fragments: [":sensors-default.xml"],
}
