Merge "Avoid crash when setting buffer on deleted layer" into oc-dev
diff --git a/audio/2.0/default/Device.cpp b/audio/2.0/default/Device.cpp
index b696d94..d12f8c0 100644
--- a/audio/2.0/default/Device.cpp
+++ b/audio/2.0/default/Device.cpp
@@ -26,6 +26,7 @@
 #include "Conversions.h"
 #include "Device.h"
 #include "HidlUtils.h"
+#include "ParametersUtil.h"
 #include "StreamIn.h"
 #include "StreamOut.h"
 
@@ -35,9 +36,28 @@
 namespace V2_0 {
 namespace implementation {
 
+namespace {
+
+class ParametersUtilImpl : public ParametersUtil {
+   public:
+    ParametersUtilImpl(audio_hw_device_t* device) : mDevice{device} {}
+
+    char* halGetParameters(const char* keys) override {
+        return mDevice->get_parameters(mDevice, keys);
+    }
+
+    int halSetParameters(const char* keysAndValues) override {
+        return mDevice->set_parameters(mDevice, keysAndValues);
+    }
+
+   private:
+    audio_hw_device_t* mDevice;
+};
+
+}  // namespace
+
 Device::Device(audio_hw_device_t* device)
-        : mDevice(device) {
-}
+    : mDevice{device}, mParameters{new ParametersUtilImpl(mDevice)} {}
 
 Device::~Device() {
     int status = audio_hw_device_close(mDevice);
@@ -67,12 +87,28 @@
     mDevice->close_output_stream(mDevice, stream);
 }
 
-char* Device::halGetParameters(const char* keys) {
-    return mDevice->get_parameters(mDevice, keys);
+Result Device::getParam(const char* name, bool* value) {
+    return mParameters->getParam(name, value);
 }
 
-int Device::halSetParameters(const char* keysAndValues) {
-    return mDevice->set_parameters(mDevice, keysAndValues);
+Result Device::getParam(const char* name, int* value) {
+    return mParameters->getParam(name, value);
+}
+
+Result Device::getParam(const char* name, String8* value) {
+    return mParameters->getParam(name, value);
+}
+
+Result Device::setParam(const char* name, bool value) {
+    return mParameters->setParam(name, value);
+}
+
+Result Device::setParam(const char* name, int value) {
+    return mParameters->setParam(name, value);
+}
+
+Result Device::setParam(const char* name, const char* value) {
+    return mParameters->setParam(name, value);
 }
 
 // Methods from ::android::hardware::audio::V2_0::IDevice follow.
@@ -274,21 +310,22 @@
 
 Return<AudioHwSync> Device::getHwAvSync()  {
     int halHwAvSync;
-    Result retval = getParam(AudioParameter::keyHwAvSync, &halHwAvSync);
+    Result retval =
+        mParameters->getParam(AudioParameter::keyHwAvSync, &halHwAvSync);
     return retval == Result::OK ? halHwAvSync : AUDIO_HW_SYNC_INVALID;
 }
 
 Return<Result> Device::setScreenState(bool turnedOn)  {
-    return setParam(AudioParameter::keyScreenState, turnedOn);
+    return mParameters->setParam(AudioParameter::keyScreenState, turnedOn);
 }
 
 Return<void> Device::getParameters(const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb)  {
-    getParametersImpl(keys, _hidl_cb);
+    mParameters->getParametersImpl(keys, _hidl_cb);
     return Void();
 }
 
 Return<Result> Device::setParameters(const hidl_vec<ParameterValue>& parameters)  {
-    return setParametersImpl(parameters);
+    return mParameters->setParametersImpl(parameters);
 }
 
 Return<void> Device::debugDump(const hidl_handle& fd)  {
diff --git a/audio/2.0/default/Device.h b/audio/2.0/default/Device.h
index 7738361..748f96b 100644
--- a/audio/2.0/default/Device.h
+++ b/audio/2.0/default/Device.h
@@ -27,14 +27,14 @@
 
 #include <hidl/MQDescriptor.h>
 
-#include "ParametersUtil.h"
-
 namespace android {
 namespace hardware {
 namespace audio {
 namespace V2_0 {
 namespace implementation {
 
+class ParametersUtil;
+
 using ::android::hardware::audio::common::V2_0::AudioConfig;
 using ::android::hardware::audio::common::V2_0::AudioHwSync;
 using ::android::hardware::audio::common::V2_0::AudioInputFlag;
@@ -55,7 +55,7 @@
 using ::android::hardware::hidl_string;
 using ::android::sp;
 
-struct Device : public IDevice, public ParametersUtil {
+struct Device : public IDevice {
     explicit Device(audio_hw_device_t* device);
 
     // Methods from ::android::hardware::audio::V2_0::IDevice follow.
@@ -101,16 +101,19 @@
     void closeInputStream(audio_stream_in_t* stream);
     void closeOutputStream(audio_stream_out_t* stream);
     audio_hw_device_t* device() const { return mDevice; }
+    Result getParam(const char* name, bool* value);
+    Result getParam(const char* name, int* value);
+    Result getParam(const char* name, String8* value);
+    Result setParam(const char* name, bool value);
+    Result setParam(const char* name, int value);
+    Result setParam(const char* name, const char* value);
 
-  private:
+   private:
     audio_hw_device_t *mDevice;
+    std::unique_ptr<ParametersUtil> mParameters;
 
     virtual ~Device();
 
-    // Methods from ParametersUtil.
-    char* halGetParameters(const char* keys) override;
-    int halSetParameters(const char* keysAndValues) override;
-
     uint32_t version() const { return mDevice->common.version; }
 };
 
diff --git a/audio/2.0/default/ParametersUtil.h b/audio/2.0/default/ParametersUtil.h
index 49036dc..603e336 100644
--- a/audio/2.0/default/ParametersUtil.h
+++ b/audio/2.0/default/ParametersUtil.h
@@ -37,22 +37,23 @@
 
 class ParametersUtil {
   public:
-    Result getParam(const char* name, bool* value);
-    Result getParam(const char* name, int* value);
-    Result getParam(const char* name, String8* value);
-    void getParametersImpl(
-            const hidl_vec<hidl_string>& keys,
-            std::function<void(Result retval, const hidl_vec<ParameterValue>& parameters)> cb);
-    std::unique_ptr<AudioParameter> getParams(const AudioParameter& keys);
-    Result setParam(const char* name, bool value);
-    Result setParam(const char* name, int value);
-    Result setParam(const char* name, const char* value);
-    Result setParametersImpl(const hidl_vec<ParameterValue>& parameters);
-    Result setParams(const AudioParameter& param);
+   virtual ~ParametersUtil() = default;
+   Result getParam(const char* name, bool* value);
+   Result getParam(const char* name, int* value);
+   Result getParam(const char* name, String8* value);
+   void getParametersImpl(
+       const hidl_vec<hidl_string>& keys,
+       std::function<void(Result retval,
+                          const hidl_vec<ParameterValue>& parameters)>
+           cb);
+   std::unique_ptr<AudioParameter> getParams(const AudioParameter& keys);
+   Result setParam(const char* name, bool value);
+   Result setParam(const char* name, int value);
+   Result setParam(const char* name, const char* value);
+   Result setParametersImpl(const hidl_vec<ParameterValue>& parameters);
+   Result setParams(const AudioParameter& param);
 
   protected:
-    virtual ~ParametersUtil() {}
-
     virtual char* halGetParameters(const char* keys) = 0;
     virtual int halSetParameters(const char* keysAndValues) = 0;
 };
diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml
new file mode 100644
index 0000000..cd3904e
--- /dev/null
+++ b/compatibility_matrix.xml
@@ -0,0 +1,34 @@
+<compatibility-matrix version="1.0" type="framework">
+    <hal format="hidl" optional="true">
+        <name>android.hardware.bluetooth</name>
+        <version>1.0</version>
+    </hal>
+    <hal format="hidl" optional="true">
+        <name>android.hardware.boot</name>
+        <version>1.0</version>
+    </hal>
+    <hal format="hidl" optional="true">
+        <name>android.hardware.configstore</name>
+        <version>1.0</version>
+    </hal>
+    <hal format="hidl" optional="true">
+        <name>android.hardware.ir</name>
+        <version>1.0</version>
+    </hal>
+    <hal format="hidl" optional="true">
+        <name>android.hardware.nfc</name>
+        <version>1.0</version>
+    </hal>
+    <hal format="hidl" optional="true">
+        <name>android.hardware.radio</name>
+        <version>1.0</version>
+    </hal>
+    <hal format="hidl" optional="true">
+        <name>android.hardware.renderscript</name>
+        <version>1.0</version>
+    </hal>
+    <hal format="hidl" optional="true">
+        <name>android.hardware.wifi</name>
+        <version>1.0</version>
+    </hal>
+</compatibility-matrix>
diff --git a/current.txt b/current.txt
index 1f6d592..089f128 100644
--- a/current.txt
+++ b/current.txt
@@ -98,7 +98,7 @@
 17971eb8a482893dadcfc16e0583f492d42a034ef95d9b0b709417af30838396 android.hardware.graphics.allocator@2.0::IAllocator
 60bf42a4898e4fb70dbd720b263aeafd7f35f5e1a5effeabb4d5d659878a5f18 android.hardware.graphics.bufferqueue@1.0::IGraphicBufferProducer
 b8a75617b9ec12bea641f3a73d4025a33e8b9a2f9169dd46094af56adf9249c5 android.hardware.graphics.bufferqueue@1.0::IProducerListener
-862cd4c41884b6c06d843b88061a021ed117e751b60b8efe8916eb64a0b3c062 android.hardware.graphics.common@1.0::types
+4f6dedbcdd21c309dfc650acea81a096d6b242493ffe49c8d61bd3c43aad354e android.hardware.graphics.common@1.0::types
 b3aac6c3817f039964fcd62268274b3039e17bd7d0d5b40b4d1d1c7b19a1f866 android.hardware.graphics.composer@2.1::IComposer
 b19d00eb8a8b3b0034a0321f22e8f32162bf4c2aebbce6da22c025f56e459ea2 android.hardware.graphics.composer@2.1::IComposerCallback
 e992684e690dfe67a8cbeab5005bfa3fa9c2bf3d4b0b75657fb1f0c2d5dd2bae android.hardware.graphics.composer@2.1::IComposerClient
diff --git a/drm/1.0/default/Android.mk b/drm/1.0/default/Android.mk
index 7602399..4c05da8 100644
--- a/drm/1.0/default/Android.mk
+++ b/drm/1.0/default/Android.mk
@@ -41,8 +41,9 @@
 
 # TODO(b/18948909) Some legacy DRM plugins only support 32-bit. They need to be
 # migrated to 64-bit. Once all of a device's legacy DRM plugins support 64-bit,
-# that device can turn on ENABLE_MEDIADRM_64 to build this service as 64-bit.
-ifneq ($(ENABLE_MEDIADRM_64), true)
+# that device can turn on TARGET_ENABLE_MEDIADRM_64 to build this service as
+# 64-bit.
+ifneq ($(TARGET_ENABLE_MEDIADRM_64), true)
 LOCAL_32_BIT_ONLY := true
 endif
 
@@ -80,8 +81,9 @@
 
 # TODO: Some legacy DRM plugins only support 32-bit. They need to be migrated to
 # 64-bit. (b/18948909) Once all of a device's legacy DRM plugins support 64-bit,
-# that device can turn on ENABLE_MEDIADRM_64 to build this impl as 64-bit.
-ifneq ($(ENABLE_MEDIADRM_64), true)
+# that device can turn on TARGET_ENABLE_MEDIADRM_64 to build this impl as
+# 64-bit.
+ifneq ($(TARGET_ENABLE_MEDIADRM_64), true)
 LOCAL_32_BIT_ONLY := true
 endif
 
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index afb659c..cfcee24 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -129,16 +129,19 @@
         auto svInfo = status->gnss_sv_list[i];
         IGnssCallback::GnssSvInfo gnssSvInfo = {
             .svid = svInfo.svid,
-            .constellation = static_cast<android::hardware::gnss::V1_0::GnssConstellationType>(
-                    svInfo.constellation),
+            .constellation = static_cast<
+                android::hardware::gnss::V1_0::GnssConstellationType>(
+                svInfo.constellation),
             .cN0Dbhz = svInfo.c_n0_dbhz,
             .elevationDegrees = svInfo.elevation,
             .azimuthDegrees = svInfo.azimuth,
-            .svFlag = svInfo.flags,
-            // Older chipsets do not provide carrier frequency, hence HAS_CARRIER_FREQUENCY flag
-            // is not set and the carrierFrequencyHz field is set to zero
-            .carrierFrequencyHz = 0
-        };
+            // Older chipsets do not provide carrier frequency, hence
+            // HAS_CARRIER_FREQUENCY flag and the carrierFrequencyHz fields
+            // are not set. So we are resetting both fields here.
+            .svFlag = static_cast<uint8_t>(
+                svInfo.flags &= ~(static_cast<uint8_t>(
+                    IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY))),
+            .carrierFrequencyHz = 0};
         svStatus.gnssSvList[i] = gnssSvInfo;
     }
 
diff --git a/graphics/allocator/2.0/default/Android.bp b/graphics/allocator/2.0/default/Android.bp
index 4a7cfe0..9968f41 100644
--- a/graphics/allocator/2.0/default/Android.bp
+++ b/graphics/allocator/2.0/default/Android.bp
@@ -42,7 +42,7 @@
     defaults: ["hidl_defaults"],
     srcs: ["gralloc1-adapter.cpp", "Gralloc1On0Adapter.cpp"],
     include_dirs: ["system/core/libsync/include"],
-    cflags: ["-Wall", "-Wextra", "-Wno-unused-parameter"],
+    cflags: ["-Wall", "-Wextra"],
     export_include_dirs: ["."],
     whole_static_libs: ["libgrallocusage"],
 }
diff --git a/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
index be055ec..041ce77 100644
--- a/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
+++ b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
@@ -77,8 +77,7 @@
 }
 
 void Gralloc1On0Adapter::doGetCapabilities(uint32_t* outCount,
-        int32_t* outCapabilities)
-{
+                                           int32_t* /*outCapabilities*/) {
     *outCount = 0;
 }
 
diff --git a/graphics/common/1.0/types.hal b/graphics/common/1.0/types.hal
index 76b3bec..3369fad 100644
--- a/graphics/common/1.0/types.hal
+++ b/graphics/common/1.0/types.hal
@@ -505,26 +505,29 @@
 
 /**
  * Transformation definitions
- *
- * IMPORTANT NOTE:
- * ROT_90 is applied CLOCKWISE and AFTER FLIP_{H|V}.
- *
  */
 @export(name="android_transform_t", value_prefix="HAL_TRANSFORM_")
 enum Transform : int32_t {
-    /** flip source image horizontally (around the vertical axis) */
-    FLIP_H    = 0x01,
     /**
-     * flip source image vertically (around the horizontal axis)*/
-    FLIP_V    = 0x02,
-    /** rotate source image 90 degrees clockwise */
-    ROT_90    = 0x04,
-    /** rotate source image 180 degrees */
-    ROT_180   = 0x03,
-    /** rotate source image 270 degrees clockwise */
-    ROT_270   = 0x07,
+     * Horizontal flip. FLIP_H/FLIP_V is applied before ROT_90.
+     */
+    FLIP_H    = 1 << 0,
 
-    /** 0x08 is reserved */
+    /**
+     * Vertical flip. FLIP_H/FLIP_V is applied before ROT_90.
+     */
+    FLIP_V    = 1 << 1,
+
+    /**
+     * 90 degree clockwise rotation. FLIP_H/FLIP_V is applied before ROT_90.
+     */
+    ROT_90    = 1 << 2,
+
+    /**
+     * Commonly used combinations.
+     */
+    ROT_180   = FLIP_H | FLIP_V,
+    ROT_270   = FLIP_H | FLIP_V | ROT_90,
 };
 
 /**
@@ -1222,209 +1225,209 @@
  */
 @export(name="android_color_mode_t", value_prefix="HAL_COLOR_MODE_")
 enum ColorMode : int32_t {
-  /**
-   * DEFAULT is the "native" gamut of the display.
-   * White Point: Vendor/OEM defined
-   * Panel Gamma: Vendor/OEM defined (typically 2.2)
-   * Rendering Intent: Vendor/OEM defined (typically 'enhanced')
-   */
-  NATIVE = 0,
+    /**
+     * DEFAULT is the "native" gamut of the display.
+     * White Point: Vendor/OEM defined
+     * Panel Gamma: Vendor/OEM defined (typically 2.2)
+     * Rendering Intent: Vendor/OEM defined (typically 'enhanced')
+     */
+    NATIVE = 0,
 
-  /**
-   * STANDARD_BT601_625 corresponds with display
-   * settings that implement the ITU-R Recommendation BT.601
-   * or Rec 601. Using 625 line version
-   * Rendering Intent: Colorimetric
-   * Primaries:
-   *                  x       y
-   *  green           0.290   0.600
-   *  blue            0.150   0.060
-   *  red             0.640   0.330
-   *  white (D65)     0.3127  0.3290
-   *
-   *  KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
-   *  for RGB conversion from the one purely determined by the primaries
-   *  to minimize the color shift into RGB space that uses BT.709
-   *  primaries.
-   *
-   * Gamma Correction (GC):
-   *
-   *  if Vlinear < 0.018
-   *    Vnonlinear = 4.500 * Vlinear
-   *  else
-   *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
-   */
-  STANDARD_BT601_625 = 1,
+    /**
+     * STANDARD_BT601_625 corresponds with display
+     * settings that implement the ITU-R Recommendation BT.601
+     * or Rec 601. Using 625 line version
+     * Rendering Intent: Colorimetric
+     * Primaries:
+     *                  x       y
+     *  green           0.290   0.600
+     *  blue            0.150   0.060
+     *  red             0.640   0.330
+     *  white (D65)     0.3127  0.3290
+     *
+     *  KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
+     *  for RGB conversion from the one purely determined by the primaries
+     *  to minimize the color shift into RGB space that uses BT.709
+     *  primaries.
+     *
+     * Gamma Correction (GC):
+     *
+     *  if Vlinear < 0.018
+     *    Vnonlinear = 4.500 * Vlinear
+     *  else
+     *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+     */
+    STANDARD_BT601_625 = 1,
 
-  /**
-   * Primaries:
-   *                  x       y
-   *  green           0.290   0.600
-   *  blue            0.150   0.060
-   *  red             0.640   0.330
-   *  white (D65)     0.3127  0.3290
-   *
-   *  Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation
-   *  for RGB conversion.
-   *
-   * Gamma Correction (GC):
-   *
-   *  if Vlinear < 0.018
-   *    Vnonlinear = 4.500 * Vlinear
-   *  else
-   *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
-   */
-  STANDARD_BT601_625_UNADJUSTED = 2,
+    /**
+     * Primaries:
+     *                  x       y
+     *  green           0.290   0.600
+     *  blue            0.150   0.060
+     *  red             0.640   0.330
+     *  white (D65)     0.3127  0.3290
+     *
+     *  Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation
+     *  for RGB conversion.
+     *
+     * Gamma Correction (GC):
+     *
+     *  if Vlinear < 0.018
+     *    Vnonlinear = 4.500 * Vlinear
+     *  else
+     *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+     */
+    STANDARD_BT601_625_UNADJUSTED = 2,
 
-  /**
-   * Primaries:
-   *                  x       y
-   *  green           0.310   0.595
-   *  blue            0.155   0.070
-   *  red             0.630   0.340
-   *  white (D65)     0.3127  0.3290
-   *
-   *  KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
-   *  for RGB conversion from the one purely determined by the primaries
-   *  to minimize the color shift into RGB space that uses BT.709
-   *  primaries.
-   *
-   * Gamma Correction (GC):
-   *
-   *  if Vlinear < 0.018
-   *    Vnonlinear = 4.500 * Vlinear
-   *  else
-   *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
-   */
-  STANDARD_BT601_525 = 3,
+    /**
+     * Primaries:
+     *                  x       y
+     *  green           0.310   0.595
+     *  blue            0.155   0.070
+     *  red             0.630   0.340
+     *  white (D65)     0.3127  0.3290
+     *
+     *  KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
+     *  for RGB conversion from the one purely determined by the primaries
+     *  to minimize the color shift into RGB space that uses BT.709
+     *  primaries.
+     *
+     * Gamma Correction (GC):
+     *
+     *  if Vlinear < 0.018
+     *    Vnonlinear = 4.500 * Vlinear
+     *  else
+     *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+     */
+    STANDARD_BT601_525 = 3,
 
-  /**
-   * Primaries:
-   *                  x       y
-   *  green           0.310   0.595
-   *  blue            0.155   0.070
-   *  red             0.630   0.340
-   *  white (D65)     0.3127  0.3290
-   *
-   *  Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation
-   *  for RGB conversion (as in SMPTE 240M).
-   *
-   * Gamma Correction (GC):
-   *
-   *  if Vlinear < 0.018
-   *    Vnonlinear = 4.500 * Vlinear
-   *  else
-   *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
-   */
-  STANDARD_BT601_525_UNADJUSTED = 4,
+    /**
+     * Primaries:
+     *                  x       y
+     *  green           0.310   0.595
+     *  blue            0.155   0.070
+     *  red             0.630   0.340
+     *  white (D65)     0.3127  0.3290
+     *
+     *  Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation
+     *  for RGB conversion (as in SMPTE 240M).
+     *
+     * Gamma Correction (GC):
+     *
+     *  if Vlinear < 0.018
+     *    Vnonlinear = 4.500 * Vlinear
+     *  else
+     *    Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+     */
+    STANDARD_BT601_525_UNADJUSTED = 4,
 
-  /**
-   * REC709 corresponds with display settings that implement
-   * the ITU-R Recommendation BT.709 / Rec. 709 for high-definition television.
-   * Rendering Intent: Colorimetric
-   * Primaries:
-   *                  x       y
-   *  green           0.300   0.600
-   *  blue            0.150   0.060
-   *  red             0.640   0.330
-   *  white (D65)     0.3127  0.3290
-   *
-   * HDTV REC709 Inverse Gamma Correction (IGC): V represents normalized
-   * (with [0 to 1] range) value of R, G, or B.
-   *
-   *  if Vnonlinear < 0.081
-   *    Vlinear = Vnonlinear / 4.5
-   *  else
-   *    Vlinear = ((Vnonlinear + 0.099) / 1.099) ^ (1/0.45)
-   *
-   * HDTV REC709 Gamma Correction (GC):
-   *
-   *  if Vlinear < 0.018
-   *    Vnonlinear = 4.5 * Vlinear
-   *  else
-   *    Vnonlinear = 1.099 * (Vlinear) ^ 0.45 – 0.099
-   */
-  STANDARD_BT709 = 5,
+    /**
+     * REC709 corresponds with display settings that implement
+     * the ITU-R Recommendation BT.709 / Rec. 709 for high-definition television.
+     * Rendering Intent: Colorimetric
+     * Primaries:
+     *                  x       y
+     *  green           0.300   0.600
+     *  blue            0.150   0.060
+     *  red             0.640   0.330
+     *  white (D65)     0.3127  0.3290
+     *
+     * HDTV REC709 Inverse Gamma Correction (IGC): V represents normalized
+     * (with [0 to 1] range) value of R, G, or B.
+     *
+     *  if Vnonlinear < 0.081
+     *    Vlinear = Vnonlinear / 4.5
+     *  else
+     *    Vlinear = ((Vnonlinear + 0.099) / 1.099) ^ (1/0.45)
+     *
+     * HDTV REC709 Gamma Correction (GC):
+     *
+     *  if Vlinear < 0.018
+     *    Vnonlinear = 4.5 * Vlinear
+     *  else
+     *    Vnonlinear = 1.099 * (Vlinear) ^ 0.45 – 0.099
+     */
+    STANDARD_BT709 = 5,
 
-  /**
-   * DCI_P3 corresponds with display settings that implement
-   * SMPTE EG 432-1 and SMPTE RP 431-2
-   * Rendering Intent: Colorimetric
-   * Primaries:
-   *                  x       y
-   *  green           0.265   0.690
-   *  blue            0.150   0.060
-   *  red             0.680   0.320
-   *  white (D65)     0.3127  0.3290
-   *
-   * Gamma: 2.6
-   */
-  DCI_P3 = 6,
+    /**
+     * DCI_P3 corresponds with display settings that implement
+     * SMPTE EG 432-1 and SMPTE RP 431-2
+     * Rendering Intent: Colorimetric
+     * Primaries:
+     *                  x       y
+     *  green           0.265   0.690
+     *  blue            0.150   0.060
+     *  red             0.680   0.320
+     *  white (D65)     0.3127  0.3290
+     *
+     * Gamma: 2.6
+     */
+    DCI_P3 = 6,
 
-  /**
-   * SRGB corresponds with display settings that implement
-   * the sRGB color space. Uses the same primaries as ITU-R Recommendation
-   * BT.709
-   * Rendering Intent: Colorimetric
-   * Primaries:
-   *                  x       y
-   *  green           0.300   0.600
-   *  blue            0.150   0.060
-   *  red             0.640   0.330
-   *  white (D65)     0.3127  0.3290
-   *
-   * PC/Internet (sRGB) Inverse Gamma Correction (IGC):
-   *
-   *  if Vnonlinear ≤ 0.03928
-   *    Vlinear = Vnonlinear / 12.92
-   *  else
-   *    Vlinear = ((Vnonlinear + 0.055)/1.055) ^ 2.4
-   *
-   * PC/Internet (sRGB) Gamma Correction (GC):
-   *
-   *  if Vlinear ≤ 0.0031308
-   *    Vnonlinear = 12.92 * Vlinear
-   *  else
-   *    Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
-   */
-  SRGB = 7,
+    /**
+     * SRGB corresponds with display settings that implement
+     * the sRGB color space. Uses the same primaries as ITU-R Recommendation
+     * BT.709
+     * Rendering Intent: Colorimetric
+     * Primaries:
+     *                  x       y
+     *  green           0.300   0.600
+     *  blue            0.150   0.060
+     *  red             0.640   0.330
+     *  white (D65)     0.3127  0.3290
+     *
+     * PC/Internet (sRGB) Inverse Gamma Correction (IGC):
+     *
+     *  if Vnonlinear ≤ 0.03928
+     *    Vlinear = Vnonlinear / 12.92
+     *  else
+     *    Vlinear = ((Vnonlinear + 0.055)/1.055) ^ 2.4
+     *
+     * PC/Internet (sRGB) Gamma Correction (GC):
+     *
+     *  if Vlinear ≤ 0.0031308
+     *    Vnonlinear = 12.92 * Vlinear
+     *  else
+     *    Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
+     */
+    SRGB = 7,
 
-  /**
-   * ADOBE_RGB corresponds with the RGB color space developed
-   * by Adobe Systems, Inc. in 1998.
-   * Rendering Intent: Colorimetric
-   * Primaries:
-   *                  x       y
-   *  green           0.210   0.710
-   *  blue            0.150   0.060
-   *  red             0.640   0.330
-   *  white (D65)     0.3127  0.3290
-   *
-   * Gamma: 2.2
-   */
-  ADOBE_RGB = 8,
+    /**
+     * ADOBE_RGB corresponds with the RGB color space developed
+     * by Adobe Systems, Inc. in 1998.
+     * Rendering Intent: Colorimetric
+     * Primaries:
+     *                  x       y
+     *  green           0.210   0.710
+     *  blue            0.150   0.060
+     *  red             0.640   0.330
+     *  white (D65)     0.3127  0.3290
+     *
+     * Gamma: 2.2
+     */
+    ADOBE_RGB = 8,
 
-  /**
-   * DISPLAY_P3 is a color space that uses the DCI_P3 primaries,
-   * the D65 white point and the SRGB transfer functions.
-   * Rendering Intent: Colorimetric
-   * Primaries:
-   *                  x       y
-   *  green           0.265   0.690
-   *  blue            0.150   0.060
-   *  red             0.680   0.320
-   *  white (D65)     0.3127  0.3290
-   *
-   * PC/Internet (sRGB) Gamma Correction (GC):
-   *
-   *  if Vlinear ≤ 0.0030186
-   *    Vnonlinear = 12.92 * Vlinear
-   *  else
-   *    Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
-   *
-   * Note: In most cases sRGB transfer function will be fine.
-   */
-  DISPLAY_P3 = 9
+    /**
+     * DISPLAY_P3 is a color space that uses the DCI_P3 primaries,
+     * the D65 white point and the SRGB transfer functions.
+     * Rendering Intent: Colorimetric
+     * Primaries:
+     *                  x       y
+     *  green           0.265   0.690
+     *  blue            0.150   0.060
+     *  red             0.680   0.320
+     *  white (D65)     0.3127  0.3290
+     *
+     * PC/Internet (sRGB) Gamma Correction (GC):
+     *
+     *  if Vlinear ≤ 0.0030186
+     *    Vnonlinear = 12.92 * Vlinear
+     *  else
+     *    Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
+     *
+     * Note: In most cases sRGB transfer function will be fine.
+     */
+    DISPLAY_P3 = 9
 };
 
 /**
diff --git a/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp
index 83f83b6..30235cf 100644
--- a/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp
@@ -158,8 +158,10 @@
 
 /*
  * RSSIMonitoring:
- * Ensures that calls to enable and disable RSSI monitoring will return
- * a success status code.
+ * Ensures that calls to enable RSSI monitoring will return an error status
+ * code if device is not connected to an AP.
+ * Ensures that calls to disable RSSI monitoring will return an error status
+ * code if RSSI monitoring is not enabled.
  */
 TEST_F(WifiStaIfaceHidlTest, RSSIMonitoring) {
     if (!isCapabilitySupported(
@@ -171,11 +173,13 @@
     const CommandId kCmd = 1;
     const Rssi kMaxRssi = -50;
     const Rssi kMinRssi = -90;
-    EXPECT_EQ(WifiStatusCode::SUCCESS,
+    // This is going to fail because device is not connected to an AP.
+    EXPECT_NE(WifiStatusCode::SUCCESS,
               HIDL_INVOKE(wifi_sta_iface_, startRssiMonitoring, kCmd, kMaxRssi,
                           kMinRssi)
                   .code);
-    EXPECT_EQ(WifiStatusCode::SUCCESS,
+    // This is going to fail because RSSI monitoring is not enabled.
+    EXPECT_NE(WifiStatusCode::SUCCESS,
               HIDL_INVOKE(wifi_sta_iface_, stopRssiMonitoring, kCmd).code);
 }