Merge "Fixed the hasCarrierFrequency flag in GnssStatus(part 2)" into oc-dev
diff --git a/audio/effect/2.0/default/AudioBufferManager.cpp b/audio/effect/2.0/default/AudioBufferManager.cpp
index 603dbb8..bba0c4a 100644
--- a/audio/effect/2.0/default/AudioBufferManager.cpp
+++ b/audio/effect/2.0/default/AudioBufferManager.cpp
@@ -30,7 +30,10 @@
     ssize_t idx = mBuffers.indexOfKey(buffer.id);
     if (idx >= 0) {
         *wrapper = mBuffers[idx].promote();
-        if (*wrapper != nullptr) return true;
+        if (*wrapper != nullptr) {
+            (*wrapper)->getHalBuffer()->frameCount = buffer.frameCount;
+            return true;
+        }
         mBuffers.removeItemsAt(idx);
     }
     // Need to create and init a new AudioBufferWrapper.
diff --git a/camera/device/1.0/default/Android.bp b/camera/device/1.0/default/Android.bp
index c2f0c46..686521b 100644
--- a/camera/device/1.0/default/Android.bp
+++ b/camera/device/1.0/default/Android.bp
@@ -27,6 +27,9 @@
     static_libs: [
         "android.hardware.camera.common@1.0-helper"
     ],
+    include_dirs: [
+        "frameworks/native/include/media/openmax"
+    ],
     export_include_dirs: ["."]
 }
 
diff --git a/camera/device/1.0/default/CameraDevice.cpp b/camera/device/1.0/default/CameraDevice.cpp
index cdc9de2..4f26c54 100644
--- a/camera/device/1.0/default/CameraDevice.cpp
+++ b/camera/device/1.0/default/CameraDevice.cpp
@@ -21,6 +21,7 @@
 #include <log/log.h>
 #include <utils/Trace.h>
 
+#include <media/hardware/HardwareAPI.h> // For VideoNativeHandleMetadata
 #include "CameraDevice_1_0.h"
 
 namespace android {
@@ -500,7 +501,7 @@
         if (mem->mBufSize == sizeof(VideoNativeHandleMetadata)) {
             VideoNativeHandleMetadata* md = (VideoNativeHandleMetadata*)
                     ((uint8_t*) mem->mHidlHeapMemData + index * mem->mBufSize);
-            if (md->eType == VideoNativeHandleMetadata::kMetadataBufferTypeNativeHandleSource) {
+            if (md->eType == kMetadataBufferTypeNativeHandleSource) {
                 handle = md->pHandle;
             }
         }
@@ -837,7 +838,7 @@
         void *data = ((uint8_t *) camMemory->mHidlHeapMemData) + bufferIndex * camMemory->mBufSize;
         if (handle) {
             VideoNativeHandleMetadata* md = (VideoNativeHandleMetadata*) data;
-            if (md->eType == VideoNativeHandleMetadata::kMetadataBufferTypeNativeHandleSource) {
+            if (md->eType == kMetadataBufferTypeNativeHandleSource) {
                 // Input handle will be closed by HIDL transport later, so clone it
                 // HAL implementation is responsible to close/delete the clone
                 native_handle_t* clone = native_handle_clone(handle);
diff --git a/camera/device/1.0/default/CameraDevice_1_0.h b/camera/device/1.0/default/CameraDevice_1_0.h
index 4240d57..0e5a49b 100644
--- a/camera/device/1.0/default/CameraDevice_1_0.h
+++ b/camera/device/1.0/default/CameraDevice_1_0.h
@@ -133,17 +133,6 @@
     };
     sp<IAllocator> mAshmemAllocator;
 
-
-    // TODO: b/35625849
-    // Meta data buffer layout for passing a native_handle to codec
-    // matching frameworks/native/include/media/hardware/MetadataBufferType.h and
-    //          frameworks/native/include/media/hardware/HardwareAPI.h
-    struct VideoNativeHandleMetadata {
-        static const uint32_t kMetadataBufferTypeNativeHandleSource = 3;
-        uint32_t eType; // must be kMetadataBufferTypeNativeHandleSource
-        native_handle_t* pHandle;
-    };
-
     const sp<CameraModule> mModule;
     const std::string mCameraId;
     // const after ctor
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/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/sensors/1.0/default/android.hardware.sensors@1.0-service.rc b/sensors/1.0/default/android.hardware.sensors@1.0-service.rc
index 50cf787..c085552 100644
--- a/sensors/1.0/default/android.hardware.sensors@1.0-service.rc
+++ b/sensors/1.0/default/android.hardware.sensors@1.0-service.rc
@@ -1,4 +1,4 @@
 service sensors-hal-1-0 /vendor/bin/hw/android.hardware.sensors@1.0-service
-    class main
+    class hal
     user system
     group system
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);
 }