QCamera2: HAL3: Make sure timestamp is correct for shutter notify

With the refactored code, shutter notify timestamp comes from
SENSOR_TIMESTAMP in CaptureResult metadata. Populate the empty metadata
in HFR mode with timestamp so that shutter notify timestamp is valid.

Test: Verify high speed recording timestamp is proper.
Bug: 36455400
Change-Id: Ic250fcb2438aa7b54fe2b6d7f1f29e8231549eeb
diff --git a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
index 51c3a2a..1a0ec8a 100644
--- a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
@@ -6249,8 +6249,11 @@
     camera_metadata_t *resultMetadata;
 
     if (!lastMetadataInBatch) {
-        /* In batch mode, use empty metadata if this is not the last in batch*/
-        resultMetadata = allocate_camera_metadata(0, 0);
+        /* In batch mode, only populate SENSOR_TIMESTAMP if this is not the last in batch.
+         * Timestamp is needed because it's used for shutter notify calculation.
+         * */
+        camMetadata.update(ANDROID_SENSOR_TIMESTAMP, &timestamp, 1);
+        resultMetadata = camMetadata.release();
         return resultMetadata;
     }