Camera: Update AON HIDL service V1.2 for FaceDetectPro

- FaceDetectPro Service Type enum and structure are added

CRs-Fixed: 3114468

Change-Id: I5f839e64fed3e46cc809515681d2e1c4b0ce7f80
diff --git a/camera/aon/1.2/Android.bp b/camera/aon/1.2/Android.bp
new file mode 100644
index 0000000..e22a10b
--- /dev/null
+++ b/camera/aon/1.2/Android.bp
@@ -0,0 +1,16 @@
+hidl_interface {
+    name: "vendor.qti.hardware.camera.aon@1.2",
+    root: "vendor.qti.hardware.camera",
+    system_ext_specific: true,
+    srcs: [
+        "types.hal",
+        "IAONService.hal",
+        "IAONServiceCallBack.hal",
+    ],
+    interfaces: [
+        "vendor.qti.hardware.camera.aon@1.1",
+        "vendor.qti.hardware.camera.aon@1.0",
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/camera/aon/1.2/IAONService.hal b/camera/aon/1.2/IAONService.hal
new file mode 100644
index 0000000..9a9e4f8
--- /dev/null
+++ b/camera/aon/1.2/IAONService.hal
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *    * Neither the name of The Linux Foundation. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Changes from Qualcomm Innovation Center are provided under the following license:
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *
+ *    * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package vendor.qti.hardware.camera.aon@1.2;
+
+import vendor.qti.hardware.camera.aon@1.0;
+import vendor.qti.hardware.camera.aon@1.1;
+
+import @1.2::types;
+import @1.2::IAONServiceCallBack;
+
+interface IAONService extends @1.1::IAONService {
+
+
+    /**
+     * Get capabilities supported by AON Service.
+     *
+     * @return serviceCapabilities list of AON service types supported by service.
+     *
+     */
+    getCapabilities_v2() generates (vec<AONServiceType> serviceCapabilities);
+
+    /**
+     * Registers for AON service events.
+     *
+     * @param  callback            callback function that gets called during AON event
+     * @param  serviceType         AON service type that client is interested in
+     * @return status              Returns status of function.
+     *                             Returns 0 in case of success; non-zero otherwise
+     * @return clientHandle        AON Service assigns a valid client handle upon successfull return
+     *                             Any value greater than 0 in case of success.
+     *                             0 in case of failure
+     *
+     */
+    registerClient_v2(IAONServiceCallBack callback, AONServiceType serviceType)
+                    generates (Status status, uint64_t clientHandle);
+
+};
diff --git a/camera/aon/1.2/IAONServiceCallBack.hal b/camera/aon/1.2/IAONServiceCallBack.hal
new file mode 100644
index 0000000..60b9306
--- /dev/null
+++ b/camera/aon/1.2/IAONServiceCallBack.hal
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *    * Neither the name of The Linux Foundation. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Changes from Qualcomm Innovation Center are provided under the following license:
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *
+ *    * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package vendor.qti.hardware.camera.aon@1.2;
+
+import @1.2::types;
+import vendor.qti.hardware.camera.aon@1.0;
+import vendor.qti.hardware.camera.aon@1.1;
+
+/** AON Service callback interface.
+ *  This callback will be invoked when any client registers for AON Service
+ *  and specific AON event triggered by hardware/lower layers */
+interface IAONServiceCallBack extends @1.1::IAONServiceCallBack {
+    notifyAONEvent_v2(uint64_t clientHandle, AONServiceStatus serviceStatus, AONEvtInfo evtInfo);
+};
diff --git a/camera/aon/1.2/types.hal b/camera/aon/1.2/types.hal
new file mode 100644
index 0000000..0c424ff
--- /dev/null
+++ b/camera/aon/1.2/types.hal
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *    * Neither the name of The Linux Foundation. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Changes from Qualcomm Innovation Center are provided under the following license:
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *
+ *    * Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *
+ *    * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package vendor.qti.hardware.camera.aon@1.2;
+
+import vendor.qti.hardware.camera.aon@1.1;
+import vendor.qti.hardware.camera.aon@1.1::types;
+import vendor.qti.hardware.camera.aon@1.1::AONServiceType;
+
+enum AONServiceType     : @1.1::AONServiceType
+{
+    Invalid             = -1,
+    FaceDetectPro       = 3,
+};
+
+/**
+ * The information passed from the event of FaceDetectBasic service type
+ */
+struct FaceInfoBasic {
+    /**
+     * Indicates the roll (or rotate) angle of the face
+     * Valid values: -180 through 179, where a positive value means
+     * the face is rotated clockwise in-plane
+     */
+    int32_t angle_roll;
+};
+
+/**
+ * The information passed from the event of FaceDetectBasic service type
+ */
+struct face_pos_type {
+    /**
+     * X coordinate of a position
+     * It is relative to the frame dimension width (exposed in FaceInfoPro)
+     * It can be negative (e.g. a facial part can be estimated to be outside of the
+     * frame boundary)
+     */
+    int32_t x;
+
+    /**
+     * Y coordinate of a position
+     * It is relative to the frame dimension height (exposed in FaceInfoPro)
+     * It can be negative (e.g. a facial part can be estimated to be outside of the
+     * frame boundary)
+     */
+    int32_t y;
+};
+
+/**
+ * The information per face passed from the event of FaceDetectPro service type
+ */
+struct face_info_pro_per_face {
+    /**
+     * Indicates the roll (or rotate) angle of the face
+     * Valid values: -180 through 179, where a positive value means the face is
+     * rotated clockwise in-plane
+     */
+    int32_t angle_roll;
+
+    /**
+     * Indicates the left/right direction of the face
+     * Valid values: -180 through 179, where a positive value means the face is
+     * facing right
+     */
+    int32_t angle_yaw;
+
+    /**
+     * Width of the face in the frame
+     */
+    uint32_t width;
+
+    /**
+     * height of the face in the frame
+     */
+    uint32_t height;
+
+    /**
+     * Position of the center of the face in the frame
+     */
+    face_pos_type center;
+};
+
+
+/**
+ * The information passed from the event of FaceDetectPro service type
+ */
+struct FaceInfoPro {
+    /**
+     * The frame dimension where the reported face ROI/Parts Coordinates will be based on
+     */
+    uint32_t frame_dim_width;
+    uint32_t frame_dim_height;
+
+    /**
+     * A vector of the per face information
+     */
+    vec<face_info_pro_per_face>  per_face;
+};
+
+/**
+ * The event information callback from AON service to client
+ */
+struct AONEvtInfo {
+    /**
+     * Service type of the callback event.
+     */
+    AONServiceType srv_type;
+
+    /**
+     * FaceDetectBasic event information.
+     */
+    FaceInfoBasic face_info_basic;
+
+    /**
+     * FaceDetectPro event information.
+     */
+    FaceInfoPro face_info_pro;
+};
\ No newline at end of file
diff --git a/camera/current.txt b/camera/current.txt
index 8b16f44..db5d2c1 100644
--- a/camera/current.txt
+++ b/camera/current.txt
@@ -39,3 +39,7 @@
 44dae52420281fec0dcb2c9da359482daf3963a0e1c0c68ac27cbcec6ff8517b vendor.qti.hardware.camera.aon@1.1::types
 d82c958291563902a0190b1f7da58b3808fbb3a018fbf80e06570c6a954dccf7 vendor.qti.hardware.camera.aon@1.1::IAONService
 4f2d1dcc47f3d462088ba445319a09b8f9b2f13a2e57a1b34ea06ce3aa309207 vendor.qti.hardware.camera.aon@1.1::IAONServiceCallBack
+
+afa7eb61656ef6806a373aaae88b664425e08e3f57bc9bae04f7b63acfa48c8d vendor.qti.hardware.camera.aon@1.2::types
+87c4b087b037f9a3dd6d50513c45ee54450a7a2ca8cc3af2a6d2c939d6d9dda5 vendor.qti.hardware.camera.aon@1.2::IAONService
+3ff06912b21fd0b0f0efc5621eab1e3af03c1219716ceada54ae01650b04d78c vendor.qti.hardware.camera.aon@1.2::IAONServiceCallBack
\ No newline at end of file