Merge "Adding Audio HAL V5: Direction API"
diff --git a/include/hardware/gnss-base.h b/include/hardware/gnss-base.h
index e56020d..706aa38 100644
--- a/include/hardware/gnss-base.h
+++ b/include/hardware/gnss-base.h
@@ -1,6 +1,6 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 // Source: android.hardware.gnss@1.0
-// Root: android.hardware:hardware/interfaces
+// Location: hardware/interfaces/gnss/1.0/
 
 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_GNSS_V1_0_EXPORTED_CONSTANTS_H_
 #define HIDL_GENERATED_ANDROID_HARDWARE_GNSS_V1_0_EXPORTED_CONSTANTS_H_
@@ -10,7 +10,7 @@
 #endif
 
 enum {
-    GNSS_MAX_SVS_COUNT = 64u, // 64
+    GNSS_MAX_SVS_COUNT = 64u,
 };
 
 enum {
@@ -24,14 +24,14 @@
 };
 
 enum {
-    GPS_LOCATION_HAS_LAT_LONG = 1, // 0x0001
-    GPS_LOCATION_HAS_ALTITUDE = 2, // 0x0002
-    GPS_LOCATION_HAS_SPEED = 4, // 0x0004
-    GPS_LOCATION_HAS_BEARING = 8, // 0x0008
-    GPS_LOCATION_HAS_HORIZONTAL_ACCURACY = 16, // 0x0010
-    GPS_LOCATION_HAS_VERTICAL_ACCURACY = 32, // 0x0020
-    GPS_LOCATION_HAS_SPEED_ACCURACY = 64, // 0x0040
-    GPS_LOCATION_HAS_BEARING_ACCURACY = 128, // 0x0080
+    GPS_LOCATION_HAS_LAT_LONG = 1 /* 0x0001 */,
+    GPS_LOCATION_HAS_ALTITUDE = 2 /* 0x0002 */,
+    GPS_LOCATION_HAS_SPEED = 4 /* 0x0004 */,
+    GPS_LOCATION_HAS_BEARING = 8 /* 0x0008 */,
+    GPS_LOCATION_HAS_HORIZONTAL_ACCURACY = 16 /* 0x0010 */,
+    GPS_LOCATION_HAS_VERTICAL_ACCURACY = 32 /* 0x0020 */,
+    GPS_LOCATION_HAS_SPEED_ACCURACY = 64 /* 0x0040 */,
+    GPS_LOCATION_HAS_BEARING_ACCURACY = 128 /* 0x0080 */,
 };
 
 enum {
@@ -77,8 +77,8 @@
 };
 
 enum {
-    AGPS_RIL_REQUEST_SETID_IMSI = 1u, // (1 << 0L)
-    AGPS_RIL_REQUEST_SETID_MSISDN = 2u, // (1 << 1L)
+    AGPS_RIL_REQUEST_SETID_IMSI = 1u /* (1 << 0L) */,
+    AGPS_RIL_REQUEST_SETID_MSISDN = 2u /* (1 << 1L) */,
 };
 
 enum {
@@ -88,39 +88,39 @@
 };
 
 enum {
-    GPS_POSITION_RECURRENCE_PERIODIC = 0u, // 0
-    GPS_POSITION_RECURRENCE_SINGLE = 1u, // 1
+    GPS_POSITION_RECURRENCE_PERIODIC = 0u,
+    GPS_POSITION_RECURRENCE_SINGLE = 1u,
 };
 
 enum {
-    GPS_DELETE_EPHEMERIS = 1, // 0x0001
-    GPS_DELETE_ALMANAC = 2, // 0x0002
-    GPS_DELETE_POSITION = 4, // 0x0004
-    GPS_DELETE_TIME = 8, // 0x0008
-    GPS_DELETE_IONO = 16, // 0x0010
-    GPS_DELETE_UTC = 32, // 0x0020
-    GPS_DELETE_HEALTH = 64, // 0x0040
-    GPS_DELETE_SVDIR = 128, // 0x0080
-    GPS_DELETE_SVSTEER = 256, // 0x0100
-    GPS_DELETE_SADATA = 512, // 0x0200
-    GPS_DELETE_RTI = 1024, // 0x0400
-    GPS_DELETE_CELLDB_INFO = 32768, // 0x8000
-    GPS_DELETE_ALL = 65535, // 0xFFFF
+    GPS_DELETE_EPHEMERIS = 1 /* 0x0001 */,
+    GPS_DELETE_ALMANAC = 2 /* 0x0002 */,
+    GPS_DELETE_POSITION = 4 /* 0x0004 */,
+    GPS_DELETE_TIME = 8 /* 0x0008 */,
+    GPS_DELETE_IONO = 16 /* 0x0010 */,
+    GPS_DELETE_UTC = 32 /* 0x0020 */,
+    GPS_DELETE_HEALTH = 64 /* 0x0040 */,
+    GPS_DELETE_SVDIR = 128 /* 0x0080 */,
+    GPS_DELETE_SVSTEER = 256 /* 0x0100 */,
+    GPS_DELETE_SADATA = 512 /* 0x0200 */,
+    GPS_DELETE_RTI = 1024 /* 0x0400 */,
+    GPS_DELETE_CELLDB_INFO = 32768 /* 0x8000 */,
+    GPS_DELETE_ALL = 65535 /* 0xFFFF */,
 };
 
 enum {
-    FLP_BATCH_WAKEUP_ON_FIFO_FULL = 1, // 0x01
+    FLP_BATCH_WAKEUP_ON_FIFO_FULL = 1 /* 0x01 */,
 };
 
 enum {
-    GPS_CAPABILITY_SCHEDULING = 1u, // (1 << 0)
-    GPS_CAPABILITY_MSB = 2u, // (1 << 1)
-    GPS_CAPABILITY_MSA = 4u, // (1 << 2)
-    GPS_CAPABILITY_SINGLE_SHOT = 8u, // (1 << 3)
-    GPS_CAPABILITY_ON_DEMAND_TIME = 16u, // (1 << 4)
-    GPS_CAPABILITY_GEOFENCING = 32u, // (1 << 5)
-    GPS_CAPABILITY_MEASUREMENTS = 64u, // (1 << 6)
-    GPS_CAPABILITY_NAV_MESSAGES = 128u, // (1 << 7)
+    GPS_CAPABILITY_SCHEDULING = 1u /* (1 << 0) */,
+    GPS_CAPABILITY_MSB = 2u /* (1 << 1) */,
+    GPS_CAPABILITY_MSA = 4u /* (1 << 2) */,
+    GPS_CAPABILITY_SINGLE_SHOT = 8u /* (1 << 3) */,
+    GPS_CAPABILITY_ON_DEMAND_TIME = 16u /* (1 << 4) */,
+    GPS_CAPABILITY_GEOFENCING = 32u /* (1 << 5) */,
+    GPS_CAPABILITY_MEASUREMENTS = 64u /* (1 << 6) */,
+    GPS_CAPABILITY_NAV_MESSAGES = 128u /* (1 << 7) */,
 };
 
 enum {
@@ -133,55 +133,55 @@
 
 enum {
     GNSS_SV_FLAGS_NONE = 0,
-    GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA = 1, // (1 << 0)
-    GNSS_SV_FLAGS_HAS_ALMANAC_DATA = 2, // (1 << 1)
-    GNSS_SV_FLAGS_USED_IN_FIX = 4, // (1 << 2)
-    GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY = 8, // (1 << 3)
+    GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA = 1 /* (1 << 0) */,
+    GNSS_SV_FLAGS_HAS_ALMANAC_DATA = 2 /* (1 << 1) */,
+    GNSS_SV_FLAGS_USED_IN_FIX = 4 /* (1 << 2) */,
+    GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY = 8 /* (1 << 3) */,
 };
 
 enum {
-    GPS_GEOFENCE_ENTERED = 1, // (1 << 0L)
-    GPS_GEOFENCE_EXITED = 2, // (1 << 1L)
-    GPS_GEOFENCE_UNCERTAIN = 4, // (1 << 2L)
+    GPS_GEOFENCE_ENTERED = 1 /* (1 << 0L) */,
+    GPS_GEOFENCE_EXITED = 2 /* (1 << 1L) */,
+    GPS_GEOFENCE_UNCERTAIN = 4 /* (1 << 2L) */,
 };
 
 enum {
-    GPS_GEOFENCE_UNAVAILABLE = 1, // (1 << 0L)
-    GPS_GEOFENCE_AVAILABLE = 2, // (1 << 1L)
+    GPS_GEOFENCE_UNAVAILABLE = 1 /* (1 << 0L) */,
+    GPS_GEOFENCE_AVAILABLE = 2 /* (1 << 1L) */,
 };
 
 enum {
     GPS_GEOFENCE_OPERATION_SUCCESS = 0,
-    GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES = -100, // (-100)
-    GPS_GEOFENCE_ERROR_ID_EXISTS = -101, // (-101)
-    GPS_GEOFENCE_ERROR_ID_UNKNOWN = -102, // (-102)
-    GPS_GEOFENCE_ERROR_INVALID_TRANSITION = -103, // (-103)
-    GPS_GEOFENCE_ERROR_GENERIC = -149, // (-149)
+    GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES = -100 /* (-100) */,
+    GPS_GEOFENCE_ERROR_ID_EXISTS = -101 /* (-101) */,
+    GPS_GEOFENCE_ERROR_ID_UNKNOWN = -102 /* (-102) */,
+    GPS_GEOFENCE_ERROR_INVALID_TRANSITION = -103 /* (-103) */,
+    GPS_GEOFENCE_ERROR_GENERIC = -149 /* (-149) */,
 };
 
 enum {
     GPS_MEASUREMENT_SUCCESS = 0,
-    GPS_MEASUREMENT_ERROR_ALREADY_INIT = -100, // (-100)
-    GPS_MEASUREMENT_ERROR_GENERIC = -101, // (-101)
+    GPS_MEASUREMENT_ERROR_ALREADY_INIT = -100 /* (-100) */,
+    GPS_MEASUREMENT_ERROR_GENERIC = -101 /* (-101) */,
 };
 
 enum {
-    GNSS_CLOCK_HAS_LEAP_SECOND = 1, // (1 << 0)
-    GNSS_CLOCK_HAS_TIME_UNCERTAINTY = 2, // (1 << 1)
-    GNSS_CLOCK_HAS_FULL_BIAS = 4, // (1 << 2)
-    GNSS_CLOCK_HAS_BIAS = 8, // (1 << 3)
-    GNSS_CLOCK_HAS_BIAS_UNCERTAINTY = 16, // (1 << 4)
-    GNSS_CLOCK_HAS_DRIFT = 32, // (1 << 5)
-    GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY = 64, // (1 << 6)
+    GNSS_CLOCK_HAS_LEAP_SECOND = 1 /* (1 << 0) */,
+    GNSS_CLOCK_HAS_TIME_UNCERTAINTY = 2 /* (1 << 1) */,
+    GNSS_CLOCK_HAS_FULL_BIAS = 4 /* (1 << 2) */,
+    GNSS_CLOCK_HAS_BIAS = 8 /* (1 << 3) */,
+    GNSS_CLOCK_HAS_BIAS_UNCERTAINTY = 16 /* (1 << 4) */,
+    GNSS_CLOCK_HAS_DRIFT = 32 /* (1 << 5) */,
+    GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY = 64 /* (1 << 6) */,
 };
 
 enum {
-    GNSS_MEASUREMENT_HAS_SNR = 1u, // (1 << 0)
-    GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY = 512u, // (1 << 9)
-    GNSS_MEASUREMENT_HAS_CARRIER_CYCLES = 1024u, // (1 << 10)
-    GNSS_MEASUREMENT_HAS_CARRIER_PHASE = 2048u, // (1 << 11)
-    GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY = 4096u, // (1 << 12)
-    GNSS_MEASUREMENT_HAS_AUTOMATIC_GAIN_CONTROL = 8192u, // (1 << 13)
+    GNSS_MEASUREMENT_HAS_SNR = 1u /* (1 << 0) */,
+    GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY = 512u /* (1 << 9) */,
+    GNSS_MEASUREMENT_HAS_CARRIER_CYCLES = 1024u /* (1 << 10) */,
+    GNSS_MEASUREMENT_HAS_CARRIER_PHASE = 2048u /* (1 << 11) */,
+    GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY = 4096u /* (1 << 12) */,
+    GNSS_MEASUREMENT_HAS_AUTOMATIC_GAIN_CONTROL = 8192u /* (1 << 13) */,
 };
 
 enum {
@@ -191,54 +191,54 @@
 };
 
 enum {
-    GNSS_MEASUREMENT_STATE_UNKNOWN = 0u, // 0
-    GNSS_MEASUREMENT_STATE_CODE_LOCK = 1u, // (1 << 0)
-    GNSS_MEASUREMENT_STATE_BIT_SYNC = 2u, // (1 << 1)
-    GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC = 4u, // (1 << 2)
-    GNSS_MEASUREMENT_STATE_TOW_DECODED = 8u, // (1 << 3)
-    GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS = 16u, // (1 << 4)
-    GNSS_MEASUREMENT_STATE_SYMBOL_SYNC = 32u, // (1 << 5)
-    GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC = 64u, // (1 << 6)
-    GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED = 128u, // (1 << 7)
-    GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC = 256u, // (1 << 8)
-    GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC = 512u, // (1 << 9)
-    GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK = 1024u, // (1 << 10)
-    GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK = 2048u, // (1 << 11)
-    GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC = 4096u, // (1 << 12)
-    GNSS_MEASUREMENT_STATE_SBAS_SYNC = 8192u, // (1 << 13)
-    GNSS_MEASUREMENT_STATE_TOW_KNOWN = 16384u, // (1 << 14)
-    GNSS_MEASUREMENT_STATE_GLO_TOD_KNOWN = 32768u, // (1 << 15)
+    GNSS_MEASUREMENT_STATE_UNKNOWN = 0u,
+    GNSS_MEASUREMENT_STATE_CODE_LOCK = 1u /* (1 << 0) */,
+    GNSS_MEASUREMENT_STATE_BIT_SYNC = 2u /* (1 << 1) */,
+    GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC = 4u /* (1 << 2) */,
+    GNSS_MEASUREMENT_STATE_TOW_DECODED = 8u /* (1 << 3) */,
+    GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS = 16u /* (1 << 4) */,
+    GNSS_MEASUREMENT_STATE_SYMBOL_SYNC = 32u /* (1 << 5) */,
+    GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC = 64u /* (1 << 6) */,
+    GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED = 128u /* (1 << 7) */,
+    GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC = 256u /* (1 << 8) */,
+    GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC = 512u /* (1 << 9) */,
+    GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK = 1024u /* (1 << 10) */,
+    GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK = 2048u /* (1 << 11) */,
+    GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC = 4096u /* (1 << 12) */,
+    GNSS_MEASUREMENT_STATE_SBAS_SYNC = 8192u /* (1 << 13) */,
+    GNSS_MEASUREMENT_STATE_TOW_KNOWN = 16384u /* (1 << 14) */,
+    GNSS_MEASUREMENT_STATE_GLO_TOD_KNOWN = 32768u /* (1 << 15) */,
 };
 
 enum {
     GNSS_ADR_STATE_UNKNOWN = 0,
-    GNSS_ADR_STATE_VALID = 1, // (1 << 0)
-    GNSS_ADR_STATE_RESET = 2, // (1 << 1)
-    GNSS_ADR_STATE_CYCLE_SLIP = 4, // (1 << 2)
+    GNSS_ADR_STATE_VALID = 1 /* (1 << 0) */,
+    GNSS_ADR_STATE_RESET = 2 /* (1 << 1) */,
+    GNSS_ADR_STATE_CYCLE_SLIP = 4 /* (1 << 2) */,
 };
 
 enum {
     GPS_NAVIGATION_MESSAGE_SUCCESS = 0,
-    GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT = -100, // (-100)
-    GPS_NAVIGATION_MESSAGE_ERROR_GENERIC = -101, // (-101)
+    GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT = -100 /* (-100) */,
+    GPS_NAVIGATION_MESSAGE_ERROR_GENERIC = -101 /* (-101) */,
 };
 
 enum {
     GNSS_NAVIGATION_MESSAGE_TYPE_UNKNOWN = 0,
-    GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L1CA = 257, // 0x0101
-    GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L2CNAV = 258, // 0x0102
-    GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L5CNAV = 259, // 0x0103
-    GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_CNAV2 = 260, // 0x0104
-    GNSS_NAVIGATION_MESSAGE_TYPE_GLO_L1CA = 769, // 0x0301
-    GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D1 = 1281, // 0x0501
-    GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D2 = 1282, // 0x0502
-    GNSS_NAVIGATION_MESSAGE_TYPE_GAL_I = 1537, // 0x0601
-    GNSS_NAVIGATION_MESSAGE_TYPE_GAL_F = 1538, // 0x0602
+    GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L1CA = 257 /* 0x0101 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L2CNAV = 258 /* 0x0102 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L5CNAV = 259 /* 0x0103 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_GPS_CNAV2 = 260 /* 0x0104 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_GLO_L1CA = 769 /* 0x0301 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D1 = 1281 /* 0x0501 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D2 = 1282 /* 0x0502 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_GAL_I = 1537 /* 0x0601 */,
+    GNSS_NAVIGATION_MESSAGE_TYPE_GAL_F = 1538 /* 0x0602 */,
 };
 
 typedef enum {
-    NAV_MESSAGE_STATUS_PARITY_PASSED = 1, // (1 << 0)
-    NAV_MESSAGE_STATUS_PARITY_REBUILT = 2, // (1 << 1)
+    NAV_MESSAGE_STATUS_PARITY_PASSED = 1 /* (1 << 0) */,
+    NAV_MESSAGE_STATUS_PARITY_REBUILT = 2 /* (1 << 1) */,
     NAV_MESSAGE_STATUS_UNKNOWN = 0,
 } navigation_message_status;
 
@@ -246,12 +246,13 @@
     GPS_NI_TYPE_VOICE = 1,
     GPS_NI_TYPE_UMTS_SUPL = 2,
     GPS_NI_TYPE_UMTS_CTRL_PLANE = 3,
+    GPS_NI_TYPE_EMERGENCY_SUPL = 4,
 };
 
 enum {
-    GPS_NI_NEED_NOTIFY = 1u, // 0x0001
-    GPS_NI_NEED_VERIFY = 2u, // 0x0002
-    GPS_NI_PRIVACY_OVERRIDE = 4u, // 0x0004
+    GPS_NI_NEED_NOTIFY = 1u /* 0x0001 */,
+    GPS_NI_NEED_VERIFY = 2u /* 0x0002 */,
+    GPS_NI_PRIVACY_OVERRIDE = 4u /* 0x0004 */,
 };
 
 enum {
@@ -265,7 +266,7 @@
     GPS_ENC_SUPL_GSM_DEFAULT = 1,
     GPS_ENC_SUPL_UTF8 = 2,
     GPS_ENC_SUPL_UCS2 = 3,
-    GPS_ENC_UNKNOWN = -1, // (-1)
+    GPS_ENC_UNKNOWN = -1 /* (-1) */,
 };
 
 #ifdef __cplusplus
diff --git a/include/hardware/hwcomposer2.h b/include/hardware/hwcomposer2.h
index 3255167..c8b17dc 100644
--- a/include/hardware/hwcomposer2.h
+++ b/include/hardware/hwcomposer2.h
@@ -279,6 +279,7 @@
     HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES,
     HWC2_FUNCTION_SET_DISPLAYED_CONTENT_SAMPLING_ENABLED,
     HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLE,
+    HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA_BLOBS,
 } hwc2_function_descriptor_t;
 
 /* Layer requests returned from getDisplayRequests */
@@ -591,6 +592,7 @@
         case HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES: return "GetDisplayedContentSamplingAttributes";
         case HWC2_FUNCTION_SET_DISPLAYED_CONTENT_SAMPLING_ENABLED: return "SetDisplayedContentSamplingEnabled";
         case HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLE: return "GetDisplayedContentSample";
+        case HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA_BLOBS: return "SetLayerPerFrameMetadataBlobs";
         default: return "Unknown";
     }
 }
@@ -829,6 +831,7 @@
     GetDisplayedContentSamplingAttributes = HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES,
     SetDisplayedContentSamplingEnabled = HWC2_FUNCTION_SET_DISPLAYED_CONTENT_SAMPLING_ENABLED,
     GetDisplayedContentSample = HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLE,
+    SetLayerPerFrameMetadataBlobs = HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA_BLOBS,
 };
 TO_STRING(hwc2_function_descriptor_t, FunctionDescriptor,
         getFunctionDescriptorName)
@@ -2216,6 +2219,42 @@
         uint32_t numElements, const int32_t* /*hw2_per_frame_metadata_key_t*/ keys,
         const float* metadata);
 
+/* setLayerPerFrameMetadataBlobs(...,numElements, keys, sizes, blobs)
+ * Descriptor: HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA_BLOBS
+ * Optional for HWC2 devices
+ *
+ * If supported, (getFunction(HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA_BLOBS)
+ * is non-null), sets the metadata for the given display and layer.
+ *
+ * Upon returning from this function, the metadata change must have fully taken
+ * effect.
+ *
+ * This function must only be called if getPerFrameMetadataKeys is non-NULL
+ * and returns at least one key that corresponds to a blob type.
+ *
+ * Current valid blob type keys are: HDR10_PLUS_SEI
+ *
+ * Parameters:
+ *   numElements is the number of elements in each of the keys, sizes, and
+ *   metadata arrays
+ *   keys is a pointer to an array of keys.  Current valid keys are those listed
+ *   above as valid blob type keys.
+ *   sizes is a pointer to an array of unsigned ints specifying the sizes of
+ *   each metadata blob
+ *   metadata is a pointer to a blob of data holding all blobs contiguously in
+ *   memory
+ *
+ *   Returns HWC2_ERROR_NONE or one of the following erros:
+ *     HWC2_ERROR_BAD_DISPLAY - an invalid display handle was passed in
+ *     HWC2_ERROR_BAD_PARAMETER - sizes of keys and metadata parameters does
+ *     not match numElements, numElements < 0, or keys contains a
+ *     non-valid key (see above for current valid blob type keys).
+ *     HWC2_ERROR_UNSUPPORTED - metadata is not supported on this display
+ */
+typedef int32_t /*hwc2_error_t*/ (*HWC2_PFN_SET_LAYER_PER_FRAME_METADATA_BLOBS)(
+        hwc2_device_t* device, hwc2_display_t display, hwc2_layer_t layer,
+        uint32_t numElements, const int32_t* keys, const uint32_t* sizes,
+        const uint8_t* metadata);
 /*
  * Layer State Functions
  *
diff --git a/include/hardware/keymaster_defs.h b/include/hardware/keymaster_defs.h
index cec486e..196062e 100644
--- a/include/hardware/keymaster_defs.h
+++ b/include/hardware/keymaster_defs.h
@@ -586,7 +586,7 @@
                 return -1;
             if (a->blob.data_length > b->blob.data_length)
                 return 1;
-        };
+        }
     }
 
     return 0;
diff --git a/include/hardware/nfc-base.h b/include/hardware/nfc-base.h
index 6b63ad2..d22cd5d 100644
--- a/include/hardware/nfc-base.h
+++ b/include/hardware/nfc-base.h
@@ -1,6 +1,6 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 // Source: android.hardware.nfc@1.0
-// Root: android.hardware:hardware/interfaces
+// Location: hardware/interfaces/nfc/1.0/
 
 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_NFC_V1_0_EXPORTED_CONSTANTS_H_
 #define HIDL_GENERATED_ANDROID_HARDWARE_NFC_V1_0_EXPORTED_CONSTANTS_H_
@@ -10,21 +10,21 @@
 #endif
 
 enum {
-    HAL_NFC_OPEN_CPLT_EVT = 0u, // 0
-    HAL_NFC_CLOSE_CPLT_EVT = 1u, // 1
-    HAL_NFC_POST_INIT_CPLT_EVT = 2u, // 2
-    HAL_NFC_PRE_DISCOVER_CPLT_EVT = 3u, // 3
-    HAL_NFC_REQUEST_CONTROL_EVT = 4u, // 4
-    HAL_NFC_RELEASE_CONTROL_EVT = 5u, // 5
-    HAL_NFC_ERROR_EVT = 6u, // 6
+    HAL_NFC_OPEN_CPLT_EVT = 0u,
+    HAL_NFC_CLOSE_CPLT_EVT = 1u,
+    HAL_NFC_POST_INIT_CPLT_EVT = 2u,
+    HAL_NFC_PRE_DISCOVER_CPLT_EVT = 3u,
+    HAL_NFC_REQUEST_CONTROL_EVT = 4u,
+    HAL_NFC_RELEASE_CONTROL_EVT = 5u,
+    HAL_NFC_ERROR_EVT = 6u,
 };
 
 enum {
-    HAL_NFC_STATUS_OK = 0u, // 0
-    HAL_NFC_STATUS_FAILED = 1u, // 1
-    HAL_NFC_STATUS_ERR_TRANSPORT = 2u, // 2
-    HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 3u, // 3
-    HAL_NFC_STATUS_REFUSED = 4u, // 4
+    HAL_NFC_STATUS_OK = 0u,
+    HAL_NFC_STATUS_FAILED = 1u,
+    HAL_NFC_STATUS_ERR_TRANSPORT = 2u,
+    HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 3u,
+    HAL_NFC_STATUS_REFUSED = 4u,
 };
 
 #ifdef __cplusplus
diff --git a/include/hardware/sensors-base.h b/include/hardware/sensors-base.h
index b0f6223..a87cf52 100644
--- a/include/hardware/sensors-base.h
+++ b/include/hardware/sensors-base.h
@@ -1,6 +1,6 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 // Source: android.hardware.sensors@1.0
-// Root: android.hardware:hardware/interfaces
+// Location: hardware/interfaces/sensors/1.0/
 
 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_SENSORS_V1_0_EXPORTED_CONSTANTS_H_
 #define HIDL_GENERATED_ANDROID_HARDWARE_SENSORS_V1_0_EXPORTED_CONSTANTS_H_
@@ -51,23 +51,23 @@
     SENSOR_TYPE_ADDITIONAL_INFO = 33,
     SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34,
     SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35,
-    SENSOR_TYPE_DEVICE_PRIVATE_BASE = 65536, // 0x10000
+    SENSOR_TYPE_DEVICE_PRIVATE_BASE = 65536 /* 0x10000 */,
 };
 
 enum {
-    SENSOR_FLAG_WAKE_UP = 1u, // 1
-    SENSOR_FLAG_CONTINUOUS_MODE = 0u, // 0
-    SENSOR_FLAG_ON_CHANGE_MODE = 2u, // 2
-    SENSOR_FLAG_ONE_SHOT_MODE = 4u, // 4
-    SENSOR_FLAG_SPECIAL_REPORTING_MODE = 6u, // 6
-    SENSOR_FLAG_DATA_INJECTION = 16u, // 0x10
-    SENSOR_FLAG_DYNAMIC_SENSOR = 32u, // 0x20
-    SENSOR_FLAG_ADDITIONAL_INFO = 64u, // 0x40
-    SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM = 1024u, // 0x400
-    SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC = 2048u, // 0x800
-    SENSOR_FLAG_MASK_REPORTING_MODE = 14u, // 0xE
-    SENSOR_FLAG_MASK_DIRECT_REPORT = 896u, // 0x380
-    SENSOR_FLAG_MASK_DIRECT_CHANNEL = 3072u, // 0xC00
+    SENSOR_FLAG_WAKE_UP = 1u,
+    SENSOR_FLAG_CONTINUOUS_MODE = 0u,
+    SENSOR_FLAG_ON_CHANGE_MODE = 2u,
+    SENSOR_FLAG_ONE_SHOT_MODE = 4u,
+    SENSOR_FLAG_SPECIAL_REPORTING_MODE = 6u,
+    SENSOR_FLAG_DATA_INJECTION = 16u /* 0x10 */,
+    SENSOR_FLAG_DYNAMIC_SENSOR = 32u /* 0x20 */,
+    SENSOR_FLAG_ADDITIONAL_INFO = 64u /* 0x40 */,
+    SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM = 1024u /* 0x400 */,
+    SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC = 2048u /* 0x800 */,
+    SENSOR_FLAG_MASK_REPORTING_MODE = 14u /* 0xE */,
+    SENSOR_FLAG_MASK_DIRECT_REPORT = 896u /* 0x380 */,
+    SENSOR_FLAG_MASK_DIRECT_CHANNEL = 3072u /* 0xC00 */,
 };
 
 typedef enum {
@@ -80,7 +80,7 @@
 } sensor_flag_shift_t;
 
 enum {
-    SENSOR_STATUS_NO_CONTACT = -1, // (-1)
+    SENSOR_STATUS_NO_CONTACT = -1 /* (-1) */,
     SENSOR_STATUS_UNRELIABLE = 0,
     SENSOR_STATUS_ACCURACY_LOW = 1,
     SENSOR_STATUS_ACCURACY_MEDIUM = 2,
@@ -88,42 +88,42 @@
 };
 
 enum {
-    META_DATA_FLUSH_COMPLETE = 1u, // 1
+    META_DATA_FLUSH_COMPLETE = 1u,
 };
 
 typedef enum {
-    AINFO_BEGIN = 0u, // 0
-    AINFO_END = 1u, // 1
-    AINFO_UNTRACKED_DELAY = 65536u, // 0x10000
-    AINFO_INTERNAL_TEMPERATURE = 65537u, // 65537
-    AINFO_VEC3_CALIBRATION = 65538u, // 65538
-    AINFO_SENSOR_PLACEMENT = 65539u, // 65539
-    AINFO_SAMPLING = 65540u, // 65540
-    AINFO_CHANNEL_NOISE = 131072u, // 0x20000
-    AINFO_CHANNEL_SAMPLER = 131073u, // 131073
-    AINFO_CHANNEL_FILTER = 131074u, // 131074
-    AINFO_CHANNEL_LINEAR_TRANSFORM = 131075u, // 131075
-    AINFO_CHANNEL_NONLINEAR_MAP = 131076u, // 131076
-    AINFO_CHANNEL_RESAMPLER = 131077u, // 131077
-    AINFO_LOCAL_GEOMAGNETIC_FIELD = 196608u, // 0x30000
-    AINFO_LOCAL_GRAVITY = 196609u, // 196609
-    AINFO_DOCK_STATE = 196610u, // 196610
-    AINFO_HIGH_PERFORMANCE_MODE = 196611u, // 196611
-    AINFO_MAGNETIC_FIELD_CALIBRATION = 196612u, // 196612
-    AINFO_CUSTOM_START = 268435456u, // 0x10000000
-    AINFO_DEBUGGING_START = 1073741824u, // 0x40000000
+    AINFO_BEGIN = 0u,
+    AINFO_END = 1u,
+    AINFO_UNTRACKED_DELAY = 65536u /* 0x10000 */,
+    AINFO_INTERNAL_TEMPERATURE = 65537u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_UNTRACKED_DELAY implicitly + 1) */,
+    AINFO_VEC3_CALIBRATION = 65538u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_INTERNAL_TEMPERATURE implicitly + 1) */,
+    AINFO_SENSOR_PLACEMENT = 65539u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_VEC3_CALIBRATION implicitly + 1) */,
+    AINFO_SAMPLING = 65540u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_SENSOR_PLACEMENT implicitly + 1) */,
+    AINFO_CHANNEL_NOISE = 131072u /* 0x20000 */,
+    AINFO_CHANNEL_SAMPLER = 131073u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_CHANNEL_NOISE implicitly + 1) */,
+    AINFO_CHANNEL_FILTER = 131074u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_CHANNEL_SAMPLER implicitly + 1) */,
+    AINFO_CHANNEL_LINEAR_TRANSFORM = 131075u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_CHANNEL_FILTER implicitly + 1) */,
+    AINFO_CHANNEL_NONLINEAR_MAP = 131076u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_CHANNEL_LINEAR_TRANSFORM implicitly + 1) */,
+    AINFO_CHANNEL_RESAMPLER = 131077u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_CHANNEL_NONLINEAR_MAP implicitly + 1) */,
+    AINFO_LOCAL_GEOMAGNETIC_FIELD = 196608u /* 0x30000 */,
+    AINFO_LOCAL_GRAVITY = 196609u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_LOCAL_GEOMAGNETIC_FIELD implicitly + 1) */,
+    AINFO_DOCK_STATE = 196610u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_LOCAL_GRAVITY implicitly + 1) */,
+    AINFO_HIGH_PERFORMANCE_MODE = 196611u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_DOCK_STATE implicitly + 1) */,
+    AINFO_MAGNETIC_FIELD_CALIBRATION = 196612u /* (::android::hardware::sensors::V1_0::AdditionalInfoType.AINFO_HIGH_PERFORMANCE_MODE implicitly + 1) */,
+    AINFO_CUSTOM_START = 268435456u /* 0x10000000 */,
+    AINFO_DEBUGGING_START = 1073741824u /* 0x40000000 */,
 } additional_info_type_t;
 
 typedef enum {
     SENSOR_DIRECT_RATE_STOP = 0,
-    SENSOR_DIRECT_RATE_NORMAL = 1,
-    SENSOR_DIRECT_RATE_FAST = 2,
-    SENSOR_DIRECT_RATE_VERY_FAST = 3,
+    SENSOR_DIRECT_RATE_NORMAL = 1 /* (::android::hardware::sensors::V1_0::RateLevel.STOP implicitly + 1) */,
+    SENSOR_DIRECT_RATE_FAST = 2 /* (::android::hardware::sensors::V1_0::RateLevel.NORMAL implicitly + 1) */,
+    SENSOR_DIRECT_RATE_VERY_FAST = 3 /* (::android::hardware::sensors::V1_0::RateLevel.FAST implicitly + 1) */,
 } direct_rate_level_t;
 
 typedef enum {
     SENSOR_DIRECT_MEM_TYPE_ASHMEM = 1,
-    SENSOR_DIRECT_MEM_TYPE_GRALLOC = 2,
+    SENSOR_DIRECT_MEM_TYPE_GRALLOC = 2 /* (::android::hardware::sensors::V1_0::SharedMemType.ASHMEM implicitly + 1) */,
 } direct_mem_type_t;
 
 typedef enum {
diff --git a/modules/camera/3_4/Android.mk b/modules/camera/3_4/Android.mk
index ae408fa..3395b5b 100644
--- a/modules/camera/3_4/Android.mk
+++ b/modules/camera/3_4/Android.mk
@@ -97,10 +97,6 @@
 
 LOCAL_C_INCLUDES += $(v4l2_c_includes)
 LOCAL_SRC_FILES := $(v4l2_src_files)
-
-# Remove when libjpeg_static_ndk is XOM compatible
-LOCAL_XOM := false
-
 include $(BUILD_SHARED_LIBRARY)
 
 # Unit tests for V4L2 Camera HAL.
@@ -119,9 +115,6 @@
   $(v4l2_src_files) \
   $(v4l2_test_files) \
 
-# Remove when libjpeg_static_ndk is XOM compatible
-LOCAL_XOM := false
-
 include $(BUILD_NATIVE_TEST)
 
 endif # USE_CAMERA_V4L2_HAL
diff --git a/modules/camera/3_4/arc/cached_frame.cpp b/modules/camera/3_4/arc/cached_frame.cpp
index 7137505..1c33d85 100644
--- a/modules/camera/3_4/arc/cached_frame.cpp
+++ b/modules/camera/3_4/arc/cached_frame.cpp
@@ -5,11 +5,10 @@
 
 #include "arc/cached_frame.h"
 
-#include <errno.h>
-#include <libyuv.h>
+#include <cerrno>
 
+#include <libyuv.h>
 #include "arc/common.h"
-#include "arc/common_types.h"
 
 namespace arc {
 
diff --git a/modules/camera/3_4/arc/cached_frame.h b/modules/camera/3_4/arc/cached_frame.h
index fbfcb76..a16c2a6 100644
--- a/modules/camera/3_4/arc/cached_frame.h
+++ b/modules/camera/3_4/arc/cached_frame.h
@@ -9,7 +9,6 @@
 #include <memory>
 
 #include <camera/CameraMetadata.h>
-
 #include "arc/image_processor.h"
 
 namespace arc {
diff --git a/modules/camera/3_4/arc/exif_utils.cpp b/modules/camera/3_4/arc/exif_utils.cpp
index aec53c5..5e8c756 100644
--- a/modules/camera/3_4/arc/exif_utils.cpp
+++ b/modules/camera/3_4/arc/exif_utils.cpp
@@ -10,7 +10,6 @@
 #include <ctime>
 
 #include <libyuv.h>
-
 #include "arc/common.h"
 
 namespace std {
diff --git a/modules/camera/3_4/arc/frame_buffer.cpp b/modules/camera/3_4/arc/frame_buffer.cpp
index 4ae0fe3..51a7320 100644
--- a/modules/camera/3_4/arc/frame_buffer.cpp
+++ b/modules/camera/3_4/arc/frame_buffer.cpp
@@ -5,10 +5,9 @@
 
 #include "arc/frame_buffer.h"
 
-#include <sys/mman.h>
-
 #include <utility>
 
+#include <sys/mman.h>
 #include "arc/common.h"
 #include "arc/image_processor.h"
 
diff --git a/modules/camera/3_4/arc/frame_buffer.h b/modules/camera/3_4/arc/frame_buffer.h
index 3efeb3b..6a90feb 100644
--- a/modules/camera/3_4/arc/frame_buffer.h
+++ b/modules/camera/3_4/arc/frame_buffer.h
@@ -6,14 +6,11 @@
 #ifndef HAL_USB_FRAME_BUFFER_H_
 #define HAL_USB_FRAME_BUFFER_H_
 
-#include <stdint.h>
-
+#include <cstdint>
 #include <memory>
-#include <string>
 
 #include <base/files/scoped_file.h>
 #include <base/synchronization/lock.h>
-
 #include <hardware/gralloc.h>
 
 namespace arc {
diff --git a/modules/camera/3_4/arc/image_processor.cpp b/modules/camera/3_4/arc/image_processor.cpp
index f0fee91..ee28c0b 100644
--- a/modules/camera/3_4/arc/image_processor.cpp
+++ b/modules/camera/3_4/arc/image_processor.cpp
@@ -5,12 +5,12 @@
 
 #include "arc/image_processor.h"
 
-#include <errno.h>
-#include <libyuv.h>
-#include <time.h>
+#include <cerrno>
+#include <ctime>
+#include <string>
 
+#include <libyuv.h>
 #include "arc/common.h"
-#include "arc/common_types.h"
 #include "arc/exif_utils.h"
 #include "arc/jpeg_compressor.h"
 
@@ -85,6 +85,8 @@
     case V4L2_PIX_FMT_BGR32:
     case V4L2_PIX_FMT_RGB32:
       return width * height * 4;
+    case V4L2_PIX_FMT_JPEG:
+      return 0; // For JPEG real size will be calculated after conversion.
     default:
       LOGF(ERROR) << "Pixel format " << FormatToString(fourcc)
                   << " is unsupported.";
@@ -388,6 +390,9 @@
     return false;
   }
   size_t buffer_length = compressor.GetCompressedImageSize();
+  if (out_frame->SetDataSize(buffer_length)) {
+    return false;
+  }
   memcpy(out_frame->GetData(), compressor.GetCompressedImagePtr(),
          buffer_length);
   return true;
diff --git a/modules/camera/3_4/arc/image_processor.h b/modules/camera/3_4/arc/image_processor.h
index 323680a..46bb7b4 100644
--- a/modules/camera/3_4/arc/image_processor.h
+++ b/modules/camera/3_4/arc/image_processor.h
@@ -6,14 +6,12 @@
 #ifndef HAL_USB_IMAGE_PROCESSOR_H_
 #define HAL_USB_IMAGE_PROCESSOR_H_
 
-#include <string>
-
+#include <camera/CameraMetadata.h>
 // FourCC pixel formats (defined as V4L2_PIX_FMT_*).
 #include <linux/videodev2.h>
 // Declarations of HAL_PIXEL_FORMAT_XXX.
 #include <system/graphics.h>
 
-#include <camera/CameraMetadata.h>
 #include "frame_buffer.h"
 
 namespace arc {
diff --git a/modules/camera/3_4/arc/jpeg_compressor.cpp b/modules/camera/3_4/arc/jpeg_compressor.cpp
index 7c61b40..0a7b20b 100644
--- a/modules/camera/3_4/arc/jpeg_compressor.cpp
+++ b/modules/camera/3_4/arc/jpeg_compressor.cpp
@@ -8,8 +8,6 @@
 
 #include <memory>
 
-#include <errno.h>
-
 #include "arc/common.h"
 
 namespace arc {
diff --git a/modules/camera/3_4/arc/jpeg_compressor.h b/modules/camera/3_4/arc/jpeg_compressor.h
index 378f3cd..499b9aa 100644
--- a/modules/camera/3_4/arc/jpeg_compressor.h
+++ b/modules/camera/3_4/arc/jpeg_compressor.h
@@ -9,7 +9,6 @@
 
 // We must include cstdio before jpeglib.h. It is a requirement of libjpeg.
 #include <cstdio>
-#include <string>
 #include <vector>
 
 extern "C" {
diff --git a/modules/camera/3_4/camera.cpp b/modules/camera/3_4/camera.cpp
index 387134f..7636cba 100644
--- a/modules/camera/3_4/camera.cpp
+++ b/modules/camera/3_4/camera.cpp
@@ -19,25 +19,21 @@
 //#define LOG_NDEBUG 0
 #define LOG_TAG "Camera"
 
+#include "camera.h"
+
 #include <cstdlib>
 #include <memory>
-#include <vector>
-#include <stdio.h>
+
 #include <hardware/camera3.h>
 #include <sync/sync.h>
 #include <system/camera_metadata.h>
 #include <system/graphics.h>
-#include <utils/Mutex.h>
-
 #include "metadata/metadata_common.h"
-
-#include <cutils/log.h>
+#include "static_properties.h"
 
 #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL)
 #include <utils/Trace.h>
 
-#include "camera.h"
-
 #define CAMERA_SYNC_TIMEOUT 5000 // in msecs
 
 namespace default_camera_hal {
@@ -76,7 +72,7 @@
 {
     ALOGI("%s:%d: Opening camera device", __func__, mId);
     ATRACE_CALL();
-    android::Mutex::Autolock al(mDeviceLock);
+    android::Mutex::Autolock dl(mDeviceLock);
 
     if (mBusy) {
         ALOGE("%s:%d: Error! Camera device already opened", __func__, mId);
@@ -113,7 +109,7 @@
 int Camera::loadStaticInfo() {
   // Using a lock here ensures |mStaticInfo| will only ever be set once,
   // even in concurrent situations.
-  android::Mutex::Autolock al(mStaticInfoLock);
+  android::Mutex::Autolock sl(mStaticInfoLock);
 
   if (mStaticInfo) {
     return 0;
@@ -143,7 +139,7 @@
 {
     ALOGI("%s:%d: Closing camera device", __func__, mId);
     ATRACE_CALL();
-    android::Mutex::Autolock al(mDeviceLock);
+    android::Mutex::Autolock dl(mDeviceLock);
 
     if (!mBusy) {
         ALOGE("%s:%d: Error! Camera device not open", __func__, mId);
@@ -173,7 +169,8 @@
 
 int Camera::configureStreams(camera3_stream_configuration_t *stream_config)
 {
-    android::Mutex::Autolock al(mDeviceLock);
+    android::Mutex::Autolock dl(mDeviceLock);
+    android::Mutex::Autolock tl(mInFlightTrackerLock);
 
     ALOGV("%s:%d: stream_config=%p", __func__, mId, stream_config);
     ATRACE_CALL();
@@ -302,7 +299,7 @@
     int res;
     // TODO(b/32917568): A capture request submitted or ongoing during a flush
     // should be returned with an error; for now they are mutually exclusive.
-    android::Mutex::Autolock al(mFlushLock);
+    android::Mutex::Autolock tl(mInFlightTrackerLock);
 
     ATRACE_CALL();
 
@@ -376,6 +373,8 @@
 
 void Camera::completeRequest(std::shared_ptr<CaptureRequest> request, int err)
 {
+    android::Mutex::Autolock tl(mInFlightTrackerLock);
+
     if (!mInFlightTracker->Remove(request)) {
         ALOGE("%s:%d: Completed request %p is not being tracked. "
               "It may have been cleared out during a flush.",
@@ -424,7 +423,7 @@
     // is called concurrently with this (in either order).
     // Since the callback to completeRequest also may happen on a separate
     // thread, this function should behave nicely concurrently with that too.
-    android::Mutex::Autolock al(mFlushLock);
+    android::Mutex::Autolock tl(mInFlightTrackerLock);
 
     std::set<std::shared_ptr<CaptureRequest>> requests;
     mInFlightTracker->Clear(&requests);
@@ -517,7 +516,7 @@
 {
     ALOGV("%s:%d: Dumping to fd %d", __func__, mId, fd);
     ATRACE_CALL();
-    android::Mutex::Autolock al(mDeviceLock);
+    android::Mutex::Autolock dl(mDeviceLock);
 
     dprintf(fd, "Camera ID: %d (Busy: %d)\n", mId, mBusy);
 
diff --git a/modules/camera/3_4/camera.h b/modules/camera/3_4/camera.h
index 687c733..8c49c8d 100644
--- a/modules/camera/3_4/camera.h
+++ b/modules/camera/3_4/camera.h
@@ -134,11 +134,11 @@
         // Lock protecting only static camera characteristics, which may
         // be accessed without the camera device open
         android::Mutex mStaticInfoLock;
-        android::Mutex mFlushLock;
         // Standard camera settings templates
         std::unique_ptr<const android::CameraMetadata> mTemplates[CAMERA3_TEMPLATE_COUNT];
         // Track in flight requests.
         std::unique_ptr<RequestTracker> mInFlightTracker;
+        android::Mutex mInFlightTrackerLock;
 };
 }  // namespace default_camera_hal
 
diff --git a/modules/camera/3_4/capture_request.cpp b/modules/camera/3_4/capture_request.cpp
index 00b20cd..beef72f 100644
--- a/modules/camera/3_4/capture_request.cpp
+++ b/modules/camera/3_4/capture_request.cpp
@@ -16,8 +16,6 @@
 
 #include "capture_request.h"
 
-#include <set>
-
 namespace default_camera_hal {
 
 CaptureRequest::CaptureRequest() : CaptureRequest(nullptr) {}
diff --git a/modules/camera/3_4/format_metadata_factory.cpp b/modules/camera/3_4/format_metadata_factory.cpp
index 5eed134..3469b06 100644
--- a/modules/camera/3_4/format_metadata_factory.cpp
+++ b/modules/camera/3_4/format_metadata_factory.cpp
@@ -19,7 +19,11 @@
 
 #include "format_metadata_factory.h"
 
+#include <algorithm>
+#include <set>
+
 #include "arc/image_processor.h"
+#include "common.h"
 #include "metadata/array_vector.h"
 #include "metadata/partial_metadata_factory.h"
 #include "metadata/property.h"
diff --git a/modules/camera/3_4/format_metadata_factory.h b/modules/camera/3_4/format_metadata_factory.h
index 23c1777..cd25f9c 100644
--- a/modules/camera/3_4/format_metadata_factory.h
+++ b/modules/camera/3_4/format_metadata_factory.h
@@ -17,12 +17,9 @@
 #ifndef V4L2_CAMERA_HAL_FORMAT_METADATA_FACTORY_H_
 #define V4L2_CAMERA_HAL_FORMAT_METADATA_FACTORY_H_
 
-#include <algorithm>
 #include <iterator>
 #include <memory>
-#include <set>
 
-#include "common.h"
 #include "metadata/metadata_common.h"
 #include "v4l2_wrapper.h"
 
diff --git a/modules/camera/3_4/format_metadata_factory_test.cpp b/modules/camera/3_4/format_metadata_factory_test.cpp
index fe5d67f..65d4415 100644
--- a/modules/camera/3_4/format_metadata_factory_test.cpp
+++ b/modules/camera/3_4/format_metadata_factory_test.cpp
@@ -14,11 +14,12 @@
  * limitations under the License.
  */
 
+#include "format_metadata_factory.h"
+
 #include <camera/CameraMetadata.h>
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-#include "format_metadata_factory.h"
 #include "metadata/test_common.h"
 #include "v4l2_wrapper_mock.h"
 
diff --git a/modules/camera/3_4/function_thread.h b/modules/camera/3_4/function_thread.h
index 7a7b1e3..44bf061 100644
--- a/modules/camera/3_4/function_thread.h
+++ b/modules/camera/3_4/function_thread.h
@@ -21,8 +21,6 @@
 
 #include <utils/Thread.h>
 
-#include "common.h"
-
 namespace v4l2_camera_hal {
 
 class FunctionThread : public android::Thread {
diff --git a/modules/camera/3_4/metadata/boottime_state_delegate.cpp b/modules/camera/3_4/metadata/boottime_state_delegate.cpp
index 3508e85..4ea6818 100644
--- a/modules/camera/3_4/metadata/boottime_state_delegate.cpp
+++ b/modules/camera/3_4/metadata/boottime_state_delegate.cpp
@@ -17,11 +17,13 @@
 //#define LOG_NDEBUG 0
 #define LOG_TAG "BoottimeStateDelegate"
 
-#include <errno.h>
-#include <string.h>
-
 #include "boottime_state_delegate.h"
 
+#include <cerrno>
+#include <cstring>
+
+#include "common.h"
+
 namespace v4l2_camera_hal {
 
 int BoottimeStateDelegate::GetValue(int64_t* value) {
diff --git a/modules/camera/3_4/metadata/boottime_state_delegate.h b/modules/camera/3_4/metadata/boottime_state_delegate.h
index 0a5c4b9..e31e12f 100644
--- a/modules/camera/3_4/metadata/boottime_state_delegate.h
+++ b/modules/camera/3_4/metadata/boottime_state_delegate.h
@@ -17,7 +17,8 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_BOOTTIME_STATE_DELEGATE_H_
 #define V4L2_CAMERA_HAL_METADATA_BOOTTIME_STATE_DELEGATE_H_
 
-#include "../common.h"
+#include <cstdint>
+
 #include "state_delegate_interface.h"
 
 namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/metadata/control.h b/modules/camera/3_4/metadata/control.h
index 902a60c..35f4d04 100644
--- a/modules/camera/3_4/metadata/control.h
+++ b/modules/camera/3_4/metadata/control.h
@@ -21,7 +21,6 @@
 
 #include <android-base/macros.h>
 #include <system/camera_metadata.h>
-
 #include "metadata_common.h"
 #include "partial_metadata_interface.h"
 #include "tagged_control_delegate.h"
diff --git a/modules/camera/3_4/metadata/control_delegate_interface_mock.h b/modules/camera/3_4/metadata/control_delegate_interface_mock.h
index 7ed05ed..9a0ca04 100644
--- a/modules/camera/3_4/metadata/control_delegate_interface_mock.h
+++ b/modules/camera/3_4/metadata/control_delegate_interface_mock.h
@@ -19,10 +19,10 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_CONTROL_DELEGATE_INTERFACE_MOCK_H_
 #define V4L2_CAMERA_HAL_METADATA_CONTROL_DELEGATE_INTERFACE_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "control_delegate_interface.h"
 
+#include <gmock/gmock.h>
+
 namespace v4l2_camera_hal {
 
 template <typename T>
diff --git a/modules/camera/3_4/metadata/control_options_interface_mock.h b/modules/camera/3_4/metadata/control_options_interface_mock.h
index ab8f6ee..2492880 100644
--- a/modules/camera/3_4/metadata/control_options_interface_mock.h
+++ b/modules/camera/3_4/metadata/control_options_interface_mock.h
@@ -19,10 +19,10 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_CONTROL_OPTIONS_INTERFACE_MOCK_H_
 #define V4L2_CAMERA_HAL_METADATA_CONTROL_OPTIONS_INTERFACE_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "control_options_interface.h"
 
+#include <gmock/gmock.h>
+
 namespace v4l2_camera_hal {
 
 template <typename T>
diff --git a/modules/camera/3_4/metadata/converter_interface.h b/modules/camera/3_4/metadata/converter_interface.h
index ca6a0f2..fa960e9 100644
--- a/modules/camera/3_4/metadata/converter_interface.h
+++ b/modules/camera/3_4/metadata/converter_interface.h
@@ -17,8 +17,6 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_CONVERTER_INTERFACE_H_
 #define V4L2_CAMERA_HAL_METADATA_CONVERTER_INTERFACE_H_
 
-#include "../common.h"
-
 namespace v4l2_camera_hal {
 
 // A ConverterInterface converts metadata values to V4L2 values vice-versa.
diff --git a/modules/camera/3_4/metadata/converter_interface_mock.h b/modules/camera/3_4/metadata/converter_interface_mock.h
index 3f7e6f7..19d618a 100644
--- a/modules/camera/3_4/metadata/converter_interface_mock.h
+++ b/modules/camera/3_4/metadata/converter_interface_mock.h
@@ -19,10 +19,10 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_CONVERTER_INTERFACE_MOCK_H_
 #define V4L2_CAMERA_HAL_METADATA_CONVERTER_INTERFACE_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "converter_interface.h"
 
+#include <gmock/gmock.h>
+
 namespace v4l2_camera_hal {
 
 template <typename TMetadata, typename TV4L2>
diff --git a/modules/camera/3_4/metadata/default_option_delegate.h b/modules/camera/3_4/metadata/default_option_delegate.h
index f290318..d3d66c5 100644
--- a/modules/camera/3_4/metadata/default_option_delegate.h
+++ b/modules/camera/3_4/metadata/default_option_delegate.h
@@ -17,8 +17,6 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_DEFAULT_OPTION_DELEGATE_H_
 #define V4L2_CAMERA_HAL_METADATA_DEFAULT_OPTION_DELEGATE_H_
 
-#include <errno.h>
-
 #include <map>
 
 #include <hardware/camera3.h>
diff --git a/modules/camera/3_4/metadata/default_option_delegate_mock.h b/modules/camera/3_4/metadata/default_option_delegate_mock.h
index 84ec740..6b80071 100644
--- a/modules/camera/3_4/metadata/default_option_delegate_mock.h
+++ b/modules/camera/3_4/metadata/default_option_delegate_mock.h
@@ -19,10 +19,10 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_DEFAULT_OPTION_DELEGATE_MOCK_H_
 #define V4L2_CAMERA_HAL_METADATA_DEFAULT_OPTION_DELEGATE_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "default_option_delegate.h"
 
+#include <gmock/gmock.h>
+
 namespace v4l2_camera_hal {
 
 template <typename T>
diff --git a/modules/camera/3_4/metadata/enum_converter.cpp b/modules/camera/3_4/metadata/enum_converter.cpp
index 14da006..580e7e1 100644
--- a/modules/camera/3_4/metadata/enum_converter.cpp
+++ b/modules/camera/3_4/metadata/enum_converter.cpp
@@ -19,9 +19,9 @@
 
 #include "enum_converter.h"
 
-#include <errno.h>
+#include <cerrno>
 
-#include "../common.h"
+#include "common.h"
 
 namespace v4l2_camera_hal {
 
diff --git a/modules/camera/3_4/metadata/enum_converter.h b/modules/camera/3_4/metadata/enum_converter.h
index 83f4daa..855f430 100644
--- a/modules/camera/3_4/metadata/enum_converter.h
+++ b/modules/camera/3_4/metadata/enum_converter.h
@@ -20,7 +20,6 @@
 #include <map>
 
 #include <android-base/macros.h>
-
 #include "converter_interface.h"
 
 namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/metadata/enum_converter_test.cpp b/modules/camera/3_4/metadata/enum_converter_test.cpp
index 9ba7ffc..1f27884 100644
--- a/modules/camera/3_4/metadata/enum_converter_test.cpp
+++ b/modules/camera/3_4/metadata/enum_converter_test.cpp
@@ -16,7 +16,6 @@
 
 #include "enum_converter.h"
 
-#include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
 using testing::Test;
diff --git a/modules/camera/3_4/metadata/map_converter.h b/modules/camera/3_4/metadata/map_converter.h
index 2324d74..aa11981 100644
--- a/modules/camera/3_4/metadata/map_converter.h
+++ b/modules/camera/3_4/metadata/map_converter.h
@@ -17,13 +17,12 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_MAP_CONVERTER_H_
 #define V4L2_CAMERA_HAL_METADATA_MAP_CONVERTER_H_
 
-#include <errno.h>
-
+#include <cerrno>
 #include <map>
 #include <memory>
 
 #include <android-base/macros.h>
-
+#include "common.h"
 #include "converter_interface.h"
 
 namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/metadata/menu_control_options.h b/modules/camera/3_4/metadata/menu_control_options.h
index c972dc6..cc7f30d 100644
--- a/modules/camera/3_4/metadata/menu_control_options.h
+++ b/modules/camera/3_4/metadata/menu_control_options.h
@@ -17,9 +17,9 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_MENU_CONTROL_OPTIONS_H_
 #define V4L2_CAMERA_HAL_METADATA_MENU_CONTROL_OPTIONS_H_
 
-#include <errno.h>
+#include <cerrno>
 
-#include "../common.h"
+#include "common.h"
 #include "control_options_interface.h"
 #include "default_option_delegate.h"
 
diff --git a/modules/camera/3_4/metadata/menu_control_options_test.cpp b/modules/camera/3_4/metadata/menu_control_options_test.cpp
index 1a6ce6e..b8eea74 100644
--- a/modules/camera/3_4/metadata/menu_control_options_test.cpp
+++ b/modules/camera/3_4/metadata/menu_control_options_test.cpp
@@ -21,7 +21,6 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <hardware/camera3.h>
-
 #include "default_option_delegate_mock.h"
 
 using testing::Return;
diff --git a/modules/camera/3_4/metadata/metadata.cpp b/modules/camera/3_4/metadata/metadata.cpp
index c5106c7..682d78d 100644
--- a/modules/camera/3_4/metadata/metadata.cpp
+++ b/modules/camera/3_4/metadata/metadata.cpp
@@ -19,11 +19,9 @@
 
 #include "metadata.h"
 
-#include <camera/CameraMetadata.h>
 #include <hardware/camera3.h>
 
-#include "../common.h"
-#include "metadata_common.h"
+#include "common.h"
 
 namespace v4l2_camera_hal {
 
diff --git a/modules/camera/3_4/metadata/metadata.h b/modules/camera/3_4/metadata/metadata.h
index 615b589..eb3e035 100644
--- a/modules/camera/3_4/metadata/metadata.h
+++ b/modules/camera/3_4/metadata/metadata.h
@@ -17,11 +17,8 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_H_
 #define V4L2_CAMERA_HAL_METADATA_H_
 
-#include <set>
-
 #include <android-base/macros.h>
 #include <camera/CameraMetadata.h>
-#include <hardware/camera3.h>
 
 #include "metadata_common.h"
 
diff --git a/modules/camera/3_4/metadata/metadata_common.h b/modules/camera/3_4/metadata/metadata_common.h
index 52fb3ea..f56ccc8 100644
--- a/modules/camera/3_4/metadata/metadata_common.h
+++ b/modules/camera/3_4/metadata/metadata_common.h
@@ -23,8 +23,8 @@
 #include <vector>
 
 #include <camera/CameraMetadata.h>
-
 #include "array_vector.h"
+#include "common.h"
 #include "partial_metadata_interface.h"
 
 namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/metadata/metadata_reader.h b/modules/camera/3_4/metadata/metadata_reader.h
index 8e05079..f704a15 100644
--- a/modules/camera/3_4/metadata/metadata_reader.h
+++ b/modules/camera/3_4/metadata/metadata_reader.h
@@ -17,14 +17,12 @@
 #ifndef DEFAULT_CAMERA_HAL_METADATA_METADATA_READER_H_
 #define DEFAULT_CAMERA_HAL_METADATA_METADATA_READER_H_
 
-#include <map>
 #include <memory>
 #include <set>
 #include <vector>
 
 #include <android-base/macros.h>
 #include <camera/CameraMetadata.h>
-
 #include "types.h"
 
 namespace default_camera_hal {
diff --git a/modules/camera/3_4/metadata/metadata_reader_mock.h b/modules/camera/3_4/metadata/metadata_reader_mock.h
index 19895a7..3a91d17 100644
--- a/modules/camera/3_4/metadata/metadata_reader_mock.h
+++ b/modules/camera/3_4/metadata/metadata_reader_mock.h
@@ -19,10 +19,10 @@
 #ifndef DEFAULT_CAMERA_HAL_METADATA_METADATA_READER_MOCK_H_
 #define DEFAULT_CAMERA_HAL_METADATA_METADATA_READER_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "metadata_reader.h"
 
+#include <gmock/gmock.h>
+
 namespace default_camera_hal {
 
 class MetadataReaderMock : public MetadataReader {
diff --git a/modules/camera/3_4/metadata/metadata_reader_test.cpp b/modules/camera/3_4/metadata/metadata_reader_test.cpp
index 5b9cc63..92f9438 100644
--- a/modules/camera/3_4/metadata/metadata_reader_test.cpp
+++ b/modules/camera/3_4/metadata/metadata_reader_test.cpp
@@ -17,16 +17,12 @@
 #include "metadata_reader.h"
 
 #include <camera/CameraMetadata.h>
-#include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <system/camera.h>
 
 #include "array_vector.h"
 #include "metadata_common.h"
 
-using testing::AtMost;
-using testing::Expectation;
-using testing::Return;
 using testing::Test;
 
 namespace default_camera_hal {
diff --git a/modules/camera/3_4/metadata/metadata_test.cpp b/modules/camera/3_4/metadata/metadata_test.cpp
index 508884c..5769a76 100644
--- a/modules/camera/3_4/metadata/metadata_test.cpp
+++ b/modules/camera/3_4/metadata/metadata_test.cpp
@@ -23,7 +23,6 @@
 #include <camera/CameraMetadata.h>
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
-
 #include "metadata_common.h"
 #include "partial_metadata_interface_mock.h"
 
diff --git a/modules/camera/3_4/metadata/partial_metadata_factory.h b/modules/camera/3_4/metadata/partial_metadata_factory.h
index 63bf2f5..75aba25 100644
--- a/modules/camera/3_4/metadata/partial_metadata_factory.h
+++ b/modules/camera/3_4/metadata/partial_metadata_factory.h
@@ -17,7 +17,7 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_CONTROL_FACTORY_H_
 #define V4L2_CAMERA_HAL_METADATA_CONTROL_FACTORY_H_
 
-#include "../common.h"
+#include "common.h"
 #include "control.h"
 #include "menu_control_options.h"
 #include "no_effect_control_delegate.h"
diff --git a/modules/camera/3_4/metadata/partial_metadata_factory_test.cpp b/modules/camera/3_4/metadata/partial_metadata_factory_test.cpp
index 3537ed2..f039b54 100644
--- a/modules/camera/3_4/metadata/partial_metadata_factory_test.cpp
+++ b/modules/camera/3_4/metadata/partial_metadata_factory_test.cpp
@@ -14,15 +14,16 @@
  * limitations under the License.
  */
 
+#include "partial_metadata_factory.h"
+
 #include <camera/CameraMetadata.h>
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-#include "../v4l2_wrapper_mock.h"
 #include "converter_interface_mock.h"
 #include "metadata_common.h"
-#include "partial_metadata_factory.h"
 #include "test_common.h"
+#include "v4l2_wrapper_mock.h"
 
 using testing::AtMost;
 using testing::Expectation;
diff --git a/modules/camera/3_4/metadata/partial_metadata_interface.h b/modules/camera/3_4/metadata/partial_metadata_interface.h
index f6e9138..4212e03 100644
--- a/modules/camera/3_4/metadata/partial_metadata_interface.h
+++ b/modules/camera/3_4/metadata/partial_metadata_interface.h
@@ -17,14 +17,10 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_PARTIAL_METADATA_INTERFACE_H_
 #define V4L2_CAMERA_HAL_METADATA_PARTIAL_METADATA_INTERFACE_H_
 
-#include <array>
 #include <vector>
 
 #include <camera/CameraMetadata.h>
 
-#include "../common.h"
-#include "array_vector.h"
-
 namespace v4l2_camera_hal {
 
 // A subset of metadata.
diff --git a/modules/camera/3_4/metadata/partial_metadata_interface_mock.h b/modules/camera/3_4/metadata/partial_metadata_interface_mock.h
index 9e822a1..289b978 100644
--- a/modules/camera/3_4/metadata/partial_metadata_interface_mock.h
+++ b/modules/camera/3_4/metadata/partial_metadata_interface_mock.h
@@ -19,10 +19,10 @@
 #ifndef V4L2_CAMERA_HAL_PARTIAL_METADATA_INTERFACE_MOCK_H_
 #define V4L2_CAMERA_HAL_PARTIAL_METADATA_INTERFACE_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "partial_metadata_interface.h"
 
+#include <gmock/gmock.h>
+
 namespace v4l2_camera_hal {
 
 class PartialMetadataInterfaceMock : public PartialMetadataInterface {
diff --git a/modules/camera/3_4/metadata/property.h b/modules/camera/3_4/metadata/property.h
index 6a542b2..b5a996c 100644
--- a/modules/camera/3_4/metadata/property.h
+++ b/modules/camera/3_4/metadata/property.h
@@ -17,7 +17,6 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_PROPERTY_H_
 #define V4L2_CAMERA_HAL_METADATA_PROPERTY_H_
 
-#include "../common.h"
 #include "metadata_common.h"
 #include "partial_metadata_interface.h"
 
diff --git a/modules/camera/3_4/metadata/property_test.cpp b/modules/camera/3_4/metadata/property_test.cpp
index 80f8eb8..5faac47 100644
--- a/modules/camera/3_4/metadata/property_test.cpp
+++ b/modules/camera/3_4/metadata/property_test.cpp
@@ -20,19 +20,13 @@
 #include <vector>
 
 #include <camera/CameraMetadata.h>
-#include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <hardware/camera3.h>
-
 #include "array_vector.h"
 #include "metadata_common.h"
 #include "test_common.h"
 
-using testing::AtMost;
-using testing::Return;
-using testing::ReturnRef;
 using testing::Test;
-using testing::_;
 
 namespace v4l2_camera_hal {
 
diff --git a/modules/camera/3_4/metadata/ranged_converter.h b/modules/camera/3_4/metadata/ranged_converter.h
index bc48767..abfe370 100644
--- a/modules/camera/3_4/metadata/ranged_converter.h
+++ b/modules/camera/3_4/metadata/ranged_converter.h
@@ -20,7 +20,7 @@
 #include <memory>
 
 #include <android-base/macros.h>
-
+#include "common.h"
 #include "converter_interface.h"
 
 namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/metadata/scaling_converter.h b/modules/camera/3_4/metadata/scaling_converter.h
index 3087167..bddf1f4 100644
--- a/modules/camera/3_4/metadata/scaling_converter.h
+++ b/modules/camera/3_4/metadata/scaling_converter.h
@@ -17,7 +17,7 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_SCALING_CONVERTER_H_
 #define V4L2_CAMERA_HAL_METADATA_SCALING_CONVERTER_H_
 
-#include "../common.h"
+#include "common.h"
 #include "converter_interface.h"
 
 namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/metadata/slider_control_options.h b/modules/camera/3_4/metadata/slider_control_options.h
index 88c1651..1d9fb7e 100644
--- a/modules/camera/3_4/metadata/slider_control_options.h
+++ b/modules/camera/3_4/metadata/slider_control_options.h
@@ -17,11 +17,10 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_SLIDER_CONTROL_OPTIONS_H_
 #define V4L2_CAMERA_HAL_METADATA_SLIDER_CONTROL_OPTIONS_H_
 
-#include <errno.h>
-
+#include <cerrno>
 #include <vector>
 
-#include "../common.h"
+#include "common.h"
 #include "control_options_interface.h"
 #include "default_option_delegate.h"
 
diff --git a/modules/camera/3_4/metadata/slider_control_options_test.cpp b/modules/camera/3_4/metadata/slider_control_options_test.cpp
index b7cef5a..7f3a643 100644
--- a/modules/camera/3_4/metadata/slider_control_options_test.cpp
+++ b/modules/camera/3_4/metadata/slider_control_options_test.cpp
@@ -21,7 +21,6 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <hardware/camera3.h>
-
 #include "default_option_delegate_mock.h"
 
 using testing::Return;
diff --git a/modules/camera/3_4/metadata/state.h b/modules/camera/3_4/metadata/state.h
index 13f2ea5..3fd8447 100644
--- a/modules/camera/3_4/metadata/state.h
+++ b/modules/camera/3_4/metadata/state.h
@@ -17,7 +17,7 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_STATE_H_
 #define V4L2_CAMERA_HAL_METADATA_STATE_H_
 
-#include "../common.h"
+#include "common.h"
 #include "metadata_common.h"
 #include "partial_metadata_interface.h"
 #include "state_delegate_interface.h"
diff --git a/modules/camera/3_4/metadata/state_delegate_interface_mock.h b/modules/camera/3_4/metadata/state_delegate_interface_mock.h
index 5064b83..e9698f1 100644
--- a/modules/camera/3_4/metadata/state_delegate_interface_mock.h
+++ b/modules/camera/3_4/metadata/state_delegate_interface_mock.h
@@ -19,10 +19,10 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_STATE_DELEGATE_INTERFACE_MOCK_H_
 #define V4L2_CAMERA_HAL_METADATA_STATE_DELEGATE_INTERFACE_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "state_delegate_interface.h"
 
+#include <gmock/gmock.h>
+
 namespace v4l2_camera_hal {
 
 template <typename T>
diff --git a/modules/camera/3_4/metadata/test_common.h b/modules/camera/3_4/metadata/test_common.h
index 42e44f0..838f97e 100644
--- a/modules/camera/3_4/metadata/test_common.h
+++ b/modules/camera/3_4/metadata/test_common.h
@@ -22,7 +22,6 @@
 
 #include <camera/CameraMetadata.h>
 #include <gtest/gtest.h>
-
 #include "array_vector.h"
 #include "metadata_common.h"
 
diff --git a/modules/camera/3_4/metadata/v4l2_control_delegate.h b/modules/camera/3_4/metadata/v4l2_control_delegate.h
index 3f45f9c..b52c252 100644
--- a/modules/camera/3_4/metadata/v4l2_control_delegate.h
+++ b/modules/camera/3_4/metadata/v4l2_control_delegate.h
@@ -17,9 +17,9 @@
 #ifndef V4L2_CAMERA_HAL_METADATA_V4L2_CONTROL_DELEGATE_H_
 #define V4L2_CAMERA_HAL_METADATA_V4L2_CONTROL_DELEGATE_H_
 
-#include "../v4l2_wrapper.h"
 #include "control_delegate_interface.h"
 #include "converter_interface.h"
+#include "v4l2_wrapper.h"
 
 namespace v4l2_camera_hal {
 
diff --git a/modules/camera/3_4/metadata/v4l2_control_delegate_test.cpp b/modules/camera/3_4/metadata/v4l2_control_delegate_test.cpp
index 2f14d6f..63ad0f6 100644
--- a/modules/camera/3_4/metadata/v4l2_control_delegate_test.cpp
+++ b/modules/camera/3_4/metadata/v4l2_control_delegate_test.cpp
@@ -18,9 +18,8 @@
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
-
-#include "../v4l2_wrapper_mock.h"
 #include "converter_interface_mock.h"
+#include "v4l2_wrapper_mock.h"
 
 using testing::Return;
 using testing::SetArgPointee;
diff --git a/modules/camera/3_4/request_tracker.h b/modules/camera/3_4/request_tracker.h
index e0bb4b5..3d390e3 100644
--- a/modules/camera/3_4/request_tracker.h
+++ b/modules/camera/3_4/request_tracker.h
@@ -21,9 +21,8 @@
 #include <memory>
 #include <set>
 
-#include <hardware/camera3.h>
 #include <android-base/macros.h>
-
+#include <hardware/camera3.h>
 #include "capture_request.h"
 
 namespace default_camera_hal {
diff --git a/modules/camera/3_4/request_tracker_test.cpp b/modules/camera/3_4/request_tracker_test.cpp
index 001ba78..a7e377c 100644
--- a/modules/camera/3_4/request_tracker_test.cpp
+++ b/modules/camera/3_4/request_tracker_test.cpp
@@ -16,15 +16,9 @@
 
 #include "request_tracker.h"
 
-#include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-using testing::AtMost;
-using testing::Expectation;
-using testing::Return;
-using testing::SetArgPointee;
 using testing::Test;
-using testing::_;
 
 namespace default_camera_hal {
 
diff --git a/modules/camera/3_4/static_properties.h b/modules/camera/3_4/static_properties.h
index 25c8205..565118d 100644
--- a/modules/camera/3_4/static_properties.h
+++ b/modules/camera/3_4/static_properties.h
@@ -21,7 +21,6 @@
 #include <set>
 
 #include <hardware/camera3.h>
-
 #include "common.h"
 #include "metadata/metadata_reader.h"
 #include "metadata/types.h"
diff --git a/modules/camera/3_4/stream_format.cpp b/modules/camera/3_4/stream_format.cpp
index 401a2f0..4a6231a 100644
--- a/modules/camera/3_4/stream_format.cpp
+++ b/modules/camera/3_4/stream_format.cpp
@@ -19,10 +19,7 @@
 
 #include "stream_format.h"
 
-#include <linux/videodev2.h>
-
 #include <system/graphics.h>
-
 #include "arc/image_processor.h"
 #include "common.h"
 
diff --git a/modules/camera/3_4/stream_format.h b/modules/camera/3_4/stream_format.h
index 82ec440..3f0c514 100644
--- a/modules/camera/3_4/stream_format.h
+++ b/modules/camera/3_4/stream_format.h
@@ -17,12 +17,10 @@
 #ifndef V4L2_CAMERA_HAL_STREAM_FORMAT_H_
 #define V4L2_CAMERA_HAL_STREAM_FORMAT_H_
 
-#include <string.h>
+#include <cstring>
 
 #include <linux/videodev2.h>
-
 #include "arc/common_types.h"
-#include "common.h"
 
 namespace v4l2_camera_hal {
 
diff --git a/modules/camera/3_4/v4l2_camera.cpp b/modules/camera/3_4/v4l2_camera.cpp
index 558b453..99b7a93 100644
--- a/modules/camera/3_4/v4l2_camera.cpp
+++ b/modules/camera/3_4/v4l2_camera.cpp
@@ -19,16 +19,14 @@
 
 #include "v4l2_camera.h"
 
-#include <fcntl.h>
-#include <linux/videodev2.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
 #include <cstdlib>
+#include <fcntl.h>
 
 #include <camera/CameraMetadata.h>
 #include <hardware/camera3.h>
-
+#include <linux/videodev2.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include "common.h"
 #include "function_thread.h"
 #include "metadata/metadata_common.h"
diff --git a/modules/camera/3_4/v4l2_camera.h b/modules/camera/3_4/v4l2_camera.h
index fc2adb3..ee29145 100644
--- a/modules/camera/3_4/v4l2_camera.h
+++ b/modules/camera/3_4/v4l2_camera.h
@@ -21,14 +21,12 @@
 
 #include <array>
 #include <condition_variable>
-#include <map>
 #include <queue>
 #include <string>
 
 #include <camera/CameraMetadata.h>
 #include <utils/StrongPointer.h>
 #include <utils/Thread.h>
-
 #include "camera.h"
 #include "common.h"
 #include "metadata/metadata.h"
diff --git a/modules/camera/3_4/v4l2_metadata_factory.cpp b/modules/camera/3_4/v4l2_metadata_factory.cpp
index 535f562..096951f 100644
--- a/modules/camera/3_4/v4l2_metadata_factory.cpp
+++ b/modules/camera/3_4/v4l2_metadata_factory.cpp
@@ -20,13 +20,11 @@
 #include "v4l2_metadata_factory.h"
 
 #include <camera/CameraMetadata.h>
-
 #include "common.h"
 #include "format_metadata_factory.h"
 #include "metadata/boottime_state_delegate.h"
 #include "metadata/control.h"
 #include "metadata/enum_converter.h"
-#include "metadata/metadata_common.h"
 #include "metadata/partial_metadata_factory.h"
 #include "metadata/property.h"
 #include "metadata/scaling_converter.h"
diff --git a/modules/camera/3_4/v4l2_wrapper.cpp b/modules/camera/3_4/v4l2_wrapper.cpp
index bba826f..bee7855 100644
--- a/modules/camera/3_4/v4l2_wrapper.cpp
+++ b/modules/camera/3_4/v4l2_wrapper.cpp
@@ -20,18 +20,13 @@
 #include "v4l2_wrapper.h"
 
 #include <algorithm>
-#include <array>
-#include <limits>
-#include <mutex>
-#include <vector>
-
 #include <fcntl.h>
+#include <limits>
+
+#include <android-base/unique_fd.h>
 #include <linux/videodev2.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-
-#include <android-base/unique_fd.h>
-
 #include "arc/cached_frame.h"
 
 namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/v4l2_wrapper.h b/modules/camera/3_4/v4l2_wrapper.h
index dcb8afe..2682ce7 100644
--- a/modules/camera/3_4/v4l2_wrapper.h
+++ b/modules/camera/3_4/v4l2_wrapper.h
@@ -25,7 +25,6 @@
 #include <vector>
 
 #include <android-base/unique_fd.h>
-
 #include "arc/common_types.h"
 #include "arc/frame_buffer.h"
 #include "capture_request.h"
diff --git a/modules/camera/3_4/v4l2_wrapper_mock.h b/modules/camera/3_4/v4l2_wrapper_mock.h
index f98bc94..1e4d3ad 100644
--- a/modules/camera/3_4/v4l2_wrapper_mock.h
+++ b/modules/camera/3_4/v4l2_wrapper_mock.h
@@ -19,10 +19,10 @@
 #ifndef V4L2_CAMERA_HAL_V4L2_WRAPPER_MOCK_H_
 #define V4L2_CAMERA_HAL_V4L2_WRAPPER_MOCK_H_
 
-#include <gmock/gmock.h>
-
 #include "v4l2_wrapper.h"
 
+#include <gmock/gmock.h>
+
 namespace v4l2_camera_hal {
 
 class V4L2WrapperMock : public V4L2Wrapper {