Merge "Update contexthub OWNERS"
diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp
index bec22df..1a9df21 100644
--- a/audio/core/all-versions/default/Device.cpp
+++ b/audio/core/all-versions/default/Device.cpp
@@ -378,7 +378,7 @@
 }
 
 Return<Result> Device::setConnectedState(const DeviceAddress& address, bool connected) {
-    auto key = connected ? AudioParameter::keyStreamConnect : AudioParameter::keyStreamDisconnect;
+    auto key = connected ? AudioParameter::keyDeviceConnect : AudioParameter::keyDeviceDisconnect;
     return setParam(key, address);
 }
 #endif
diff --git a/audio/core/all-versions/default/Stream.cpp b/audio/core/all-versions/default/Stream.cpp
index b995657..e62f6d3 100644
--- a/audio/core/all-versions/default/Stream.cpp
+++ b/audio/core/all-versions/default/Stream.cpp
@@ -243,8 +243,8 @@
 
 Return<Result> Stream::setConnectedState(const DeviceAddress& address, bool connected) {
     return setParam(
-        connected ? AudioParameter::keyStreamConnect : AudioParameter::keyStreamDisconnect,
-        address);
+            connected ? AudioParameter::keyDeviceConnect : AudioParameter::keyDeviceDisconnect,
+            address);
 }
 #elif MAJOR_VERSION >= 4
 Return<void> Stream::getDevices(getDevices_cb _hidl_cb) {
diff --git a/dumpstate/1.0/default/DumpstateDevice.cpp b/dumpstate/1.0/default/DumpstateDevice.cpp
index 25d92b0..c57bf43 100644
--- a/dumpstate/1.0/default/DumpstateDevice.cpp
+++ b/dumpstate/1.0/default/DumpstateDevice.cpp
@@ -37,11 +37,6 @@
     // NOTE: this is just an example on how to use the DumpstateUtil.h functions to implement
     // this interface.
 
-    // Exit when dump is completed since this is a lazy HAL.
-    addPostCommandTask([]() {
-        exit(0);
-    });
-
     if (handle == nullptr || handle->numFds < 1) {
         ALOGE("no FDs\n");
         return Void();
diff --git a/dumpstate/1.0/default/service.cpp b/dumpstate/1.0/default/service.cpp
index 4f276b7..76c72b5 100644
--- a/dumpstate/1.0/default/service.cpp
+++ b/dumpstate/1.0/default/service.cpp
@@ -15,22 +15,26 @@
  */
 #define LOG_TAG "android.hardware.dumpstate@1.0-service"
 
+#include <hidl/HidlLazyUtils.h>
 #include <hidl/HidlSupport.h>
 #include <hidl/HidlTransportSupport.h>
 
 #include "DumpstateDevice.h"
 
-using ::android::hardware::configureRpcThreadpool;
-using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
-using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice;
-using ::android::hardware::joinRpcThreadpool;
 using ::android::OK;
 using ::android::sp;
+using ::android::hardware::configureRpcThreadpool;
+using ::android::hardware::joinRpcThreadpool;
+using ::android::hardware::LazyServiceRegistrar;
+using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
+using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice;
 
 int main(int /* argc */, char* /* argv */ []) {
     sp<IDumpstateDevice> dumpstate = new DumpstateDevice;
     configureRpcThreadpool(1, true /* will join */);
-    if (dumpstate->registerAsService() != OK) {
+
+    auto registrar = LazyServiceRegistrar::getInstance();
+    if (registrar.registerService(dumpstate) != OK) {
         ALOGE("Could not register service.");
         return 1;
     }
diff --git a/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h b/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h
index 18fbb6d..8540068 100644
--- a/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h
+++ b/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h
@@ -37,6 +37,10 @@
      Error validateBufferSize(const native_handle_t* bufferHandle,
                               const IMapper::BufferDescriptorInfo& descriptorInfo,
                               uint32_t stride) override {
+         if (descriptorInfo.layerCount != 1) {
+             return Error::BAD_VALUE;
+         }
+
          if (!mModule->validateBufferSize) {
              return Error::NONE;
          }
diff --git a/power/stats/1.0/default/PowerStats.cpp b/power/stats/1.0/default/PowerStats.cpp
index 78766f2..68275ce 100644
--- a/power/stats/1.0/default/PowerStats.cpp
+++ b/power/stats/1.0/default/PowerStats.cpp
@@ -87,7 +87,7 @@
     std::string railFileName;
     std::string spsFileName;
     uint32_t index = 0;
-    uint32_t samplingRate;
+    unsigned long samplingRate;
     for (const auto& path : mPm.devicePaths) {
         railFileName = path + "/enabled_rails";
         spsFileName = path + "/sampling_rate";
@@ -109,10 +109,11 @@
         while (std::getline(railNames, line)) {
             std::vector<std::string> words = android::base::Split(line, ":");
             if (words.size() == 2) {
-                mPm.railsInfo.emplace(words[0], RailData{.devicePath = path,
-                                                         .index = index,
-                                                         .subsysName = words[1],
-                                                         .samplingRate = samplingRate});
+                mPm.railsInfo.emplace(
+                        words[0], RailData{.devicePath = path,
+                                           .index = index,
+                                           .subsysName = words[1],
+                                           .samplingRate = static_cast<uint32_t>(samplingRate)});
                 index++;
             } else {
                 ALOGW("Unexpected format in file: %s", railFileName.c_str());