Merge "improve timeout handling"
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 2ae4853..1eea640 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -43,6 +43,7 @@
 #include <ui/GraphicBuffer.h>
 
 #include <VtsHalHidlTargetTestBase.h>
+#include <VtsHalHidlTargetTestEnvBase.h>
 
 using ::android::hardware::Return;
 using ::android::hardware::Void;
@@ -100,7 +101,6 @@
 using ResultMetadataQueue = MessageQueue<uint8_t, kSynchronizedReadWrite>;
 using ::android::hidl::manager::V1_0::IServiceManager;
 
-const char kCameraPassthroughServiceName[] = "legacy/0";
 const char *kProviderFQName = "android.hardware.camera.provider@2.4::ICameraProvider";
 const uint32_t kMaxPreviewWidth = 1920;
 const uint32_t kMaxPreviewHeight = 1080;
@@ -219,66 +219,28 @@
 }
 
 // Test environment for camera
-class CameraHidlEnvironment : public ::testing::Environment {
-public:
+class CameraHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
+   public:
     // get the test environment singleton
     static CameraHidlEnvironment* Instance() {
         static CameraHidlEnvironment* instance = new CameraHidlEnvironment;
         return instance;
     }
 
-    virtual void SetUp() override;
-    virtual void TearDown() override;
+    virtual void HidlSetUp() override { ALOGI("SetUp CameraHidlEnvironment"); }
 
-    std::unordered_map<std::string, sp<ICameraProvider> > mProviders;
+    virtual void HidlTearDown() override { ALOGI("TearDown CameraHidlEnvironment"); }
 
-private:
+    virtual void registerTestServices() override {
+        registerTestService("android.hardware.camera.provider", "2.4", "ICameraProvider");
+    }
+
+   private:
     CameraHidlEnvironment() {}
 
     GTEST_DISALLOW_COPY_AND_ASSIGN_(CameraHidlEnvironment);
 };
 
-void CameraHidlEnvironment::SetUp() {
-    sp<IServiceManager> manager = IServiceManager::getService();
-    ASSERT_NE(manager, nullptr);
-
-    manager->listByInterface(kProviderFQName,
-                             [this](const hidl_vec<hidl_string> &registered) {
-        std::string name;
-        uint32_t id;
-        sp<ICameraProvider> provider = nullptr;
-        for (size_t i = 0; i < registered.size(); i++) {
-            ASSERT_TRUE(parseProviderName(registered[i],
-                    &name /*out*/, &id /*out*/));
-            provider = ICameraProvider::tryGetService(registered[i]);
-            ALOGI_IF(provider, "provider is not nullptr, %p", provider.get());
-            if (nullptr != provider.get()) {
-                mProviders.emplace(name, provider);
-            }
-        }
-    });
-
-    std::string legacyName;
-    uint32_t legacyId;
-    ASSERT_TRUE(parseProviderName(kCameraPassthroughServiceName,
-            &legacyName /*out*/, &legacyId /*out*/));
-    auto legacyIt = mProviders.find(legacyName);
-    //Add any legacy passthrough implementations
-    if (legacyIt == mProviders.end()) {
-        sp<ICameraProvider> provider = ICameraProvider::tryGetService(
-                kCameraPassthroughServiceName);
-        if (nullptr != provider.get()) {
-            mProviders.emplace(legacyName, provider);
-        }
-    }
-
-    ASSERT_FALSE(mProviders.empty());
-}
-
-void CameraHidlEnvironment::TearDown() {
-    ALOGI("TearDown CameraHidlEnvironment");
-}
-
 struct BufferItemHander: public BufferItemConsumer::FrameAvailableListener {
     BufferItemHander(wp<BufferItemConsumer> consumer) : mConsumer(consumer) {}
 
@@ -521,23 +483,32 @@
 // The main test class for camera HIDL HAL.
 class CameraHidlTest : public ::testing::VtsHalHidlTargetTestBase {
 public:
-    virtual void SetUp() override {}
-    virtual void TearDown() override {}
+ virtual void SetUp() override {
+     string service_name = CameraHidlEnvironment::Instance()->getServiceName(kProviderFQName);
+     ALOGI("get service with name: %s", service_name.c_str());
+     mProvider = ::testing::VtsHalHidlTargetTestBase::getService<ICameraProvider>(service_name);
+     ASSERT_NE(mProvider, nullptr);
 
-    hidl_vec<hidl_string> getCameraDeviceNames(sp<ICameraProvider> provider);
+     uint32_t id;
+     ASSERT_TRUE(parseProviderName(service_name, &mProviderType, &id));
+ }
+ virtual void TearDown() override {}
 
-    struct EmptyDeviceCb : public ICameraDeviceCallback {
-        virtual Return<void> processCaptureResult(const hidl_vec<CaptureResult>& /*results*/) override {
-            ALOGI("processCaptureResult callback");
-            ADD_FAILURE(); // Empty callback should not reach here
-            return Void();
-        }
+ hidl_vec<hidl_string> getCameraDeviceNames(sp<ICameraProvider> provider);
 
-        virtual Return<void> notify(const hidl_vec<NotifyMsg>& /*msgs*/) override {
-            ALOGI("notify callback");
-            ADD_FAILURE(); // Empty callback should not reach here
-            return Void();
-        }
+ struct EmptyDeviceCb : public ICameraDeviceCallback {
+     virtual Return<void> processCaptureResult(
+         const hidl_vec<CaptureResult>& /*results*/) override {
+         ALOGI("processCaptureResult callback");
+         ADD_FAILURE();  // Empty callback should not reach here
+         return Void();
+     }
+
+     virtual Return<void> notify(const hidl_vec<NotifyMsg>& /*msgs*/) override {
+         ALOGI("notify callback");
+         ADD_FAILURE();  // Empty callback should not reach here
+         return Void();
+     }
     };
 
     struct DeviceCb : public ICameraDeviceCallback {
@@ -731,6 +702,11 @@
 
     // Holds camera registered buffers
     std::unordered_map<uint32_t, sp<::android::MemoryHeapBase> > mMemoryPool;
+
+    // Camera provider service
+    sp<ICameraProvider> mProvider;
+    // Camera provider type.
+    std::string mProviderType;
 };
 
 Return<void> CameraHidlTest::Camera1DeviceCb::notifyCallback(
@@ -1032,59 +1008,45 @@
 // Test if ICameraProvider::isTorchModeSupported returns Status::OK
 TEST_F(CameraHidlTest, isTorchModeSupported) {
     Return<void> ret;
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        ret = provider.second->isSetTorchModeSupported(
-            [&](auto status, bool support) {
-                ALOGI("isSetTorchModeSupported returns status:%d supported:%d",
-                        (int)status, support);
-                ASSERT_EQ(Status::OK, status);
-            });
-        ASSERT_TRUE(ret.isOk());
-    }
+    ret = mProvider->isSetTorchModeSupported([&](auto status, bool support) {
+        ALOGI("isSetTorchModeSupported returns status:%d supported:%d", (int)status, support);
+        ASSERT_EQ(Status::OK, status);
+    });
+    ASSERT_TRUE(ret.isOk());
 }
 
 // TODO: consider removing this test if getCameraDeviceNames() has the same coverage
 TEST_F(CameraHidlTest, getCameraIdList) {
     Return<void> ret;
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        ret = provider.second->getCameraIdList(
-            [&](auto status, const auto& idList) {
-                ALOGI("getCameraIdList returns status:%d", (int)status);
-                for (size_t i = 0; i < idList.size(); i++) {
-                    ALOGI("Camera Id[%zu] is %s", i, idList[i].c_str());
-                }
-                ASSERT_EQ(Status::OK, status);
-                // This is true for internal camera provider.
-                // Not necessary hold for external cameras providers
-                ASSERT_GT(idList.size(), 0u);
-            });
-        ASSERT_TRUE(ret.isOk());
-    }
+    ret = mProvider->getCameraIdList([&](auto status, const auto& idList) {
+        ALOGI("getCameraIdList returns status:%d", (int)status);
+        for (size_t i = 0; i < idList.size(); i++) {
+            ALOGI("Camera Id[%zu] is %s", i, idList[i].c_str());
+        }
+        ASSERT_EQ(Status::OK, status);
+        // This is true for internal camera provider.
+        // Not necessary hold for external cameras providers
+        ASSERT_GT(idList.size(), 0u);
+    });
+    ASSERT_TRUE(ret.isOk());
 }
 
 // Test if ICameraProvider::getVendorTags returns Status::OK
 TEST_F(CameraHidlTest, getVendorTags) {
     Return<void> ret;
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        ret = provider.second->getVendorTags(
-            [&](auto status, const auto& vendorTagSecs) {
-                ALOGI("getVendorTags returns status:%d numSections %zu",
-                        (int)status, vendorTagSecs.size());
-                for (size_t i = 0; i < vendorTagSecs.size(); i++) {
-                    ALOGI("Vendor tag section %zu name %s",
-                            i, vendorTagSecs[i].sectionName.c_str());
-                    for (size_t j = 0; j < vendorTagSecs[i].tags.size(); j++) {
-                        const auto& tag = vendorTagSecs[i].tags[j];
-                        ALOGI("Vendor tag id %u name %s type %d",
-                                tag.tagId,
-                                tag.tagName.c_str(),
-                                (int) tag.tagType);
-                    }
-                }
-                ASSERT_EQ(Status::OK, status);
-            });
-        ASSERT_TRUE(ret.isOk());
-    }
+    ret = mProvider->getVendorTags([&](auto status, const auto& vendorTagSecs) {
+        ALOGI("getVendorTags returns status:%d numSections %zu", (int)status, vendorTagSecs.size());
+        for (size_t i = 0; i < vendorTagSecs.size(); i++) {
+            ALOGI("Vendor tag section %zu name %s", i, vendorTagSecs[i].sectionName.c_str());
+            for (size_t j = 0; j < vendorTagSecs[i].tags.size(); j++) {
+                const auto& tag = vendorTagSecs[i].tags[j];
+                ALOGI("Vendor tag id %u name %s type %d", tag.tagId, tag.tagName.c_str(),
+                      (int)tag.tagType);
+            }
+        }
+        ASSERT_EQ(Status::OK, status);
+    });
+    ASSERT_TRUE(ret.isOk());
 }
 
 // Test if ICameraProvider::setCallback returns Status::OK
@@ -1107,45 +1069,34 @@
         }
     };
     sp<ProviderCb> cb = new ProviderCb;
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        auto status = provider.second->setCallback(cb);
-        ASSERT_TRUE(status.isOk());
-        ASSERT_EQ(Status::OK, status);
-    }
+    auto status = mProvider->setCallback(cb);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_EQ(Status::OK, status);
 }
 
 // Test if ICameraProvider::getCameraDeviceInterface returns Status::OK and non-null device
 TEST_F(CameraHidlTest, getCameraDeviceInterface) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                Return<void> ret;
-                ret = provider.second->getCameraDeviceInterface_V3_x(
-                    name,
-                    [&](auto status, const auto& device3_2) {
-                        ALOGI("getCameraDeviceInterface_V3_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device3_2, nullptr);
-                    });
-                ASSERT_TRUE(ret.isOk());
-            } else if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                Return<void> ret;
-                ret = provider.second->getCameraDeviceInterface_V1_x(
-                    name,
-                    [&](auto status, const auto& device1) {
-                        ALOGI("getCameraDeviceInterface_V1_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device1, nullptr);
-                    });
-                ASSERT_TRUE(ret.isOk());
-            }
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            Return<void> ret;
+            ret = mProvider->getCameraDeviceInterface_V3_x(
+                name, [&](auto status, const auto& device3_2) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device3_2, nullptr);
+                });
+            ASSERT_TRUE(ret.isOk());
+        } else if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            Return<void> ret;
+            ret = mProvider->getCameraDeviceInterface_V1_x(
+                name, [&](auto status, const auto& device1) {
+                    ALOGI("getCameraDeviceInterface_V1_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device1, nullptr);
+                });
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -1153,66 +1104,55 @@
 // Verify that the device resource cost can be retrieved and the values are
 // sane.
 TEST_F(CameraHidlTest, getResourceCost) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
-                ALOGI("getResourceCost: Testing camera device %s", name.c_str());
-                Return<void> ret;
-                ret = provider.second->getCameraDeviceInterface_V3_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V3_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device3_2 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("getResourceCost: Testing camera device %s", name.c_str());
+            Return<void> ret;
+            ret = mProvider->getCameraDeviceInterface_V3_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                ret = device3_2->getResourceCost(
-                    [&](auto status, const auto& resourceCost) {
-                        ALOGI("getResourceCost returns status:%d", (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ALOGI("    Resource cost is %d", resourceCost.resourceCost);
-                        ASSERT_LE(resourceCost.resourceCost, 100u);
-                        for (const auto& name : resourceCost.conflictingDevices) {
-                            ALOGI("    Conflicting device: %s", name.c_str());
-                        }
-                    });
-                ASSERT_TRUE(ret.isOk());
-            } else {
-                ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                ALOGI("getResourceCost: Testing camera device %s", name.c_str());
-                Return<void> ret;
-                ret = provider.second->getCameraDeviceInterface_V1_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V1_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device1 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+            ret = device3_2->getResourceCost([&](auto status, const auto& resourceCost) {
+                ALOGI("getResourceCost returns status:%d", (int)status);
+                ASSERT_EQ(Status::OK, status);
+                ALOGI("    Resource cost is %d", resourceCost.resourceCost);
+                ASSERT_LE(resourceCost.resourceCost, 100u);
+                for (const auto& name : resourceCost.conflictingDevices) {
+                    ALOGI("    Conflicting device: %s", name.c_str());
+                }
+            });
+            ASSERT_TRUE(ret.isOk());
+        } else {
+            ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            ALOGI("getResourceCost: Testing camera device %s", name.c_str());
+            Return<void> ret;
+            ret = mProvider->getCameraDeviceInterface_V1_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V1_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device1 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                ret = device1->getResourceCost(
-                    [&](auto status, const auto& resourceCost) {
-                        ALOGI("getResourceCost returns status:%d", (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ALOGI("    Resource cost is %d",
-                              resourceCost.resourceCost);
-                        ASSERT_LE(resourceCost.resourceCost, 100u);
-                        for (const auto& name : resourceCost.conflictingDevices) {
-                            ALOGI("    Conflicting device: %s", name.c_str());
-                        }
-                    });
-                ASSERT_TRUE(ret.isOk());
-            }
+            ret = device1->getResourceCost([&](auto status, const auto& resourceCost) {
+                ALOGI("getResourceCost returns status:%d", (int)status);
+                ASSERT_EQ(Status::OK, status);
+                ALOGI("    Resource cost is %d", resourceCost.resourceCost);
+                ASSERT_LE(resourceCost.resourceCost, 100u);
+                for (const auto& name : resourceCost.conflictingDevices) {
+                    ALOGI("    Conflicting device: %s", name.c_str());
+                }
+            });
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -1220,143 +1160,117 @@
 // Verify that the static camera info can be retrieved
 // successfully.
 TEST_F(CameraHidlTest, getCameraInfo) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                ALOGI("getCameraCharacteristics: Testing camera device %s",
-                      name.c_str());
-                Return<void> ret;
-                ret = provider.second->getCameraDeviceInterface_V1_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V1_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device1 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str());
+            Return<void> ret;
+            ret = mProvider->getCameraDeviceInterface_V1_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V1_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device1 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                ret = device1->getCameraInfo(
-                    [&](auto status, const auto& info) {
-                        ALOGI("getCameraInfo returns status:%d", (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        switch(info.orientation) {
-                            case 0:
-                            case 90:
-                            case 180:
-                            case 270:
-                                //Expected cases
-                                ALOGI("camera orientation: %d", info.orientation);
-                                break;
-                            default:
-                                FAIL() << "Unexpected camera orientation:" << info.orientation;
-                        }
-                        switch(info.facing) {
-                            case CameraFacing::BACK:
-                            case CameraFacing::FRONT:
-                            case CameraFacing::EXTERNAL:
-                                //Expected cases
-                                ALOGI("camera facing: %d", info.facing);
-                                break;
-                            default:
-                                FAIL() << "Unexpected camera facing:" << static_cast<uint32_t> (
-                                        info.facing);
-                        }
-                    });
-                ASSERT_TRUE(ret.isOk());
-            }
+            ret = device1->getCameraInfo([&](auto status, const auto& info) {
+                ALOGI("getCameraInfo returns status:%d", (int)status);
+                ASSERT_EQ(Status::OK, status);
+                switch (info.orientation) {
+                    case 0:
+                    case 90:
+                    case 180:
+                    case 270:
+                        // Expected cases
+                        ALOGI("camera orientation: %d", info.orientation);
+                        break;
+                    default:
+                        FAIL() << "Unexpected camera orientation:" << info.orientation;
+                }
+                switch (info.facing) {
+                    case CameraFacing::BACK:
+                    case CameraFacing::FRONT:
+                    case CameraFacing::EXTERNAL:
+                        // Expected cases
+                        ALOGI("camera facing: %d", info.facing);
+                        break;
+                    default:
+                        FAIL() << "Unexpected camera facing:" << static_cast<uint32_t>(info.facing);
+                }
+            });
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
 
 // Check whether preview window can be configured
 TEST_F(CameraHidlTest, setPreviewWindow) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1,
-                        &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
 
-                Return<void> ret;
-                ret = device1->close();
-                ASSERT_TRUE(ret.isOk());
-            }
+            Return<void> ret;
+            ret = device1->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
 
 // Verify that setting preview window fails in case device is not open
 TEST_F(CameraHidlTest, setPreviewWindowInvalid) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                ALOGI("getCameraCharacteristics: Testing camera device %s",
-                      name.c_str());
-                Return<void> ret;
-                ret = provider.second->getCameraDeviceInterface_V1_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V1_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device1 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str());
+            Return<void> ret;
+            ret = mProvider->getCameraDeviceInterface_V1_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V1_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device1 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                Return<Status> returnStatus = device1->setPreviewWindow(nullptr);
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OPERATION_NOT_SUPPORTED, returnStatus);
-            }
+            Return<Status> returnStatus = device1->setPreviewWindow(nullptr);
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OPERATION_NOT_SUPPORTED, returnStatus);
         }
     }
 }
 
 // Start and stop preview checking whether it gets enabled in between.
 TEST_F(CameraHidlTest, startStopPreview) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1,
-                        &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
 
-                startPreview(device1);
+            startPreview(device1);
 
-                Return<bool> returnBoolStatus = device1->previewEnabled();
-                ASSERT_TRUE(returnBoolStatus.isOk());
-                ASSERT_TRUE(returnBoolStatus);
+            Return<bool> returnBoolStatus = device1->previewEnabled();
+            ASSERT_TRUE(returnBoolStatus.isOk());
+            ASSERT_TRUE(returnBoolStatus);
 
-                stopPreviewAndClose(device1);
-            }
+            stopPreviewAndClose(device1);
         }
     }
 }
@@ -1364,646 +1278,552 @@
 // Start preview without active preview window. Preview should start as soon
 // as a valid active window gets configured.
 TEST_F(CameraHidlTest, startStopPreviewDelayed) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                Return<Status> returnStatus = device1->setPreviewWindow(nullptr);
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
+            Return<Status> returnStatus = device1->setPreviewWindow(nullptr);
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
 
-                startPreview(device1);
+            startPreview(device1);
 
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
 
-                //Preview should get enabled now
-                Return<bool> returnBoolStatus = device1->previewEnabled();
-                ASSERT_TRUE(returnBoolStatus.isOk());
-                ASSERT_TRUE(returnBoolStatus);
+            // Preview should get enabled now
+            Return<bool> returnBoolStatus = device1->previewEnabled();
+            ASSERT_TRUE(returnBoolStatus.isOk());
+            ASSERT_TRUE(returnBoolStatus);
 
-                stopPreviewAndClose(device1);
-            }
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // Verify that image capture behaves as expected along with preview callbacks.
 TEST_F(CameraHidlTest, takePicture) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
 
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
-                }
-
-                enableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME,
-                              device1);
-                startPreview(device1);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    waitForFrameLocked(DataCallbackMsg::PREVIEW_FRAME, l);
-                }
-
-                disableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME,
-                                device1);
-                enableMsgType((unsigned int)DataCallbackMsg::COMPRESSED_IMAGE,
-                        device1);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
-                }
-
-                Return<Status> returnStatus = device1->takePicture();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    waitForFrameLocked(DataCallbackMsg::COMPRESSED_IMAGE, l);
-                }
-
-                disableMsgType((unsigned int)DataCallbackMsg::COMPRESSED_IMAGE,
-                        device1);
-                stopPreviewAndClose(device1);
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
             }
+
+            enableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME, device1);
+            startPreview(device1);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                waitForFrameLocked(DataCallbackMsg::PREVIEW_FRAME, l);
+            }
+
+            disableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME, device1);
+            enableMsgType((unsigned int)DataCallbackMsg::COMPRESSED_IMAGE, device1);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
+            }
+
+            Return<Status> returnStatus = device1->takePicture();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                waitForFrameLocked(DataCallbackMsg::COMPRESSED_IMAGE, l);
+            }
+
+            disableMsgType((unsigned int)DataCallbackMsg::COMPRESSED_IMAGE, device1);
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // Image capture should fail in case preview didn't get enabled first.
 TEST_F(CameraHidlTest, takePictureFail) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                Return<Status> returnStatus = device1->takePicture();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_NE(Status::OK, returnStatus);
+            Return<Status> returnStatus = device1->takePicture();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_NE(Status::OK, returnStatus);
 
-                Return<void> ret = device1->close();
-                ASSERT_TRUE(ret.isOk());
-            }
+            Return<void> ret = device1->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
 
 // Verify that image capture can be cancelled.
 TEST_F(CameraHidlTest, cancelPicture) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
-                startPreview(device1);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+            startPreview(device1);
 
-                Return<Status> returnStatus = device1->takePicture();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
+            Return<Status> returnStatus = device1->takePicture();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
 
-                returnStatus = device1->cancelPicture();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
+            returnStatus = device1->cancelPicture();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
 
-                stopPreviewAndClose(device1);
-            }
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // Image capture cancel should fail when image capture is not running.
 TEST_F(CameraHidlTest, cancelPictureFail) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
-                startPreview(device1);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+            startPreview(device1);
 
-                Return<Status> returnStatus = device1->cancelPicture();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_NE(Status::OK, returnStatus);
+            Return<Status> returnStatus = device1->cancelPicture();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_NE(Status::OK, returnStatus);
 
-                stopPreviewAndClose(device1);
-            }
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // Test basic video recording.
 TEST_F(CameraHidlTest, startStopRecording) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
 
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
-                }
-
-                enableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME,
-                        device1);
-                startPreview(device1);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    waitForFrameLocked(DataCallbackMsg::PREVIEW_FRAME, l);
-                    mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
-                    mVideoBufferIndex = UINT32_MAX;
-                }
-
-                disableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME,
-                        device1);
-
-                bool videoMetaEnabled = false;
-                Return<Status> returnStatus = device1->storeMetaDataInBuffers(
-                        true);
-                ASSERT_TRUE(returnStatus.isOk());
-                // It is allowed for devices to not support this feature
-                ASSERT_TRUE((Status::OK == returnStatus) ||
-                        (Status::OPERATION_NOT_SUPPORTED == returnStatus));
-                if (Status::OK == returnStatus) {
-                    videoMetaEnabled = true;
-                }
-
-                enableMsgType((unsigned int)DataCallbackMsg::VIDEO_FRAME,
-                        device1);
-                Return<bool> returnBoolStatus = device1->recordingEnabled();
-                ASSERT_TRUE(returnBoolStatus.isOk());
-                ASSERT_FALSE(returnBoolStatus);
-
-                returnStatus = device1->startRecording();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    waitForFrameLocked(DataCallbackMsg::VIDEO_FRAME, l);
-                    ASSERT_NE(UINT32_MAX, mVideoBufferIndex);
-                    disableMsgType((unsigned int)DataCallbackMsg::VIDEO_FRAME,
-                            device1);
-                }
-
-                returnBoolStatus = device1->recordingEnabled();
-                ASSERT_TRUE(returnBoolStatus.isOk());
-                ASSERT_TRUE(returnBoolStatus);
-
-                Return<void> ret;
-                if (videoMetaEnabled) {
-                    ret = device1->releaseRecordingFrameHandle(mVideoData,
-                            mVideoBufferIndex, mVideoNativeHandle);
-                    ASSERT_TRUE(ret.isOk());
-                } else {
-                    ret = device1->releaseRecordingFrame(mVideoData,
-                            mVideoBufferIndex);
-                    ASSERT_TRUE(ret.isOk());
-                }
-
-                ret = device1->stopRecording();
-                ASSERT_TRUE(ret.isOk());
-
-                stopPreviewAndClose(device1);
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
             }
+
+            enableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME, device1);
+            startPreview(device1);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                waitForFrameLocked(DataCallbackMsg::PREVIEW_FRAME, l);
+                mDataMessageTypeReceived = DataCallbackMsg::RAW_IMAGE_NOTIFY;
+                mVideoBufferIndex = UINT32_MAX;
+            }
+
+            disableMsgType((unsigned int)DataCallbackMsg::PREVIEW_FRAME, device1);
+
+            bool videoMetaEnabled = false;
+            Return<Status> returnStatus = device1->storeMetaDataInBuffers(true);
+            ASSERT_TRUE(returnStatus.isOk());
+            // It is allowed for devices to not support this feature
+            ASSERT_TRUE((Status::OK == returnStatus) ||
+                        (Status::OPERATION_NOT_SUPPORTED == returnStatus));
+            if (Status::OK == returnStatus) {
+                videoMetaEnabled = true;
+            }
+
+            enableMsgType((unsigned int)DataCallbackMsg::VIDEO_FRAME, device1);
+            Return<bool> returnBoolStatus = device1->recordingEnabled();
+            ASSERT_TRUE(returnBoolStatus.isOk());
+            ASSERT_FALSE(returnBoolStatus);
+
+            returnStatus = device1->startRecording();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                waitForFrameLocked(DataCallbackMsg::VIDEO_FRAME, l);
+                ASSERT_NE(UINT32_MAX, mVideoBufferIndex);
+                disableMsgType((unsigned int)DataCallbackMsg::VIDEO_FRAME, device1);
+            }
+
+            returnBoolStatus = device1->recordingEnabled();
+            ASSERT_TRUE(returnBoolStatus.isOk());
+            ASSERT_TRUE(returnBoolStatus);
+
+            Return<void> ret;
+            if (videoMetaEnabled) {
+                ret = device1->releaseRecordingFrameHandle(mVideoData, mVideoBufferIndex,
+                                                           mVideoNativeHandle);
+                ASSERT_TRUE(ret.isOk());
+            } else {
+                ret = device1->releaseRecordingFrame(mVideoData, mVideoBufferIndex);
+                ASSERT_TRUE(ret.isOk());
+            }
+
+            ret = device1->stopRecording();
+            ASSERT_TRUE(ret.isOk());
+
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // It shouldn't be possible to start recording without enabling preview first.
 TEST_F(CameraHidlTest, startRecordingFail) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                Return<bool> returnBoolStatus = device1->recordingEnabled();
-                ASSERT_TRUE(returnBoolStatus.isOk());
-                ASSERT_FALSE(returnBoolStatus);
+            Return<bool> returnBoolStatus = device1->recordingEnabled();
+            ASSERT_TRUE(returnBoolStatus.isOk());
+            ASSERT_FALSE(returnBoolStatus);
 
-                Return<Status> returnStatus = device1->startRecording();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_NE(Status::OK, returnStatus);
+            Return<Status> returnStatus = device1->startRecording();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_NE(Status::OK, returnStatus);
 
-                Return<void> ret = device1->close();
-                ASSERT_TRUE(ret.isOk());
-            }
+            Return<void> ret = device1->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
 
 // Check autofocus support if available.
 TEST_F(CameraHidlTest, autoFocus) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<const char *> focusModes = {CameraParameters::FOCUS_MODE_AUTO,
-                CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE,
-                CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO};
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<const char*> focusModes = {CameraParameters::FOCUS_MODE_AUTO,
+                                           CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE,
+                                           CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO};
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                CameraParameters cameraParams;
-                getParameters(device1, &cameraParams /*out*/);
+            CameraParameters cameraParams;
+            getParameters(device1, &cameraParams /*out*/);
 
-                if (Status::OK != isAutoFocusModeAvailable(cameraParams,
-                        CameraParameters::FOCUS_MODE_AUTO)) {
-                    Return<void> ret = device1->close();
-                    ASSERT_TRUE(ret.isOk());
+            if (Status::OK !=
+                isAutoFocusModeAvailable(cameraParams, CameraParameters::FOCUS_MODE_AUTO)) {
+                Return<void> ret = device1->close();
+                ASSERT_TRUE(ret.isOk());
+                continue;
+            }
+
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+            startPreview(device1);
+            enableMsgType((unsigned int)NotifyCallbackMsg::FOCUS, device1);
+
+            for (auto& iter : focusModes) {
+                if (Status::OK != isAutoFocusModeAvailable(cameraParams, iter)) {
                     continue;
                 }
 
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
-                startPreview(device1);
-                enableMsgType((unsigned int)NotifyCallbackMsg::FOCUS, device1);
-
-                for (auto &iter : focusModes) {
-                    if (Status::OK != isAutoFocusModeAvailable(cameraParams,
-                            iter)) {
-                        continue;
-                    }
-
-                    cameraParams.set(CameraParameters::KEY_FOCUS_MODE, iter);
-                    setParameters(device1, cameraParams);
-                    {
-                        std::unique_lock<std::mutex> l(mLock);
-                        mNotifyMessage = NotifyCallbackMsg::ERROR;
-                    }
-
-                    Return<Status> returnStatus = device1->autoFocus();
-                    ASSERT_TRUE(returnStatus.isOk());
-                    ASSERT_EQ(Status::OK, returnStatus);
-
-                    {
-                        std::unique_lock<std::mutex> l(mLock);
-                        while (NotifyCallbackMsg::FOCUS != mNotifyMessage) {
-                            auto timeout = std::chrono::system_clock::now() +
-                                    std::chrono::seconds(kAutoFocusTimeoutSec);
-                            ASSERT_NE(std::cv_status::timeout,
-                                    mResultCondition.wait_until(l, timeout));
-                        }
-                    }
+                cameraParams.set(CameraParameters::KEY_FOCUS_MODE, iter);
+                setParameters(device1, cameraParams);
+                {
+                    std::unique_lock<std::mutex> l(mLock);
+                    mNotifyMessage = NotifyCallbackMsg::ERROR;
                 }
 
-                disableMsgType((unsigned int)NotifyCallbackMsg::FOCUS, device1);
-                stopPreviewAndClose(device1);
+                Return<Status> returnStatus = device1->autoFocus();
+                ASSERT_TRUE(returnStatus.isOk());
+                ASSERT_EQ(Status::OK, returnStatus);
+
+                {
+                    std::unique_lock<std::mutex> l(mLock);
+                    while (NotifyCallbackMsg::FOCUS != mNotifyMessage) {
+                        auto timeout = std::chrono::system_clock::now() +
+                                       std::chrono::seconds(kAutoFocusTimeoutSec);
+                        ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
+                    }
+                }
             }
+
+            disableMsgType((unsigned int)NotifyCallbackMsg::FOCUS, device1);
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // In case autofocus is supported verify that it can be cancelled.
 TEST_F(CameraHidlTest, cancelAutoFocus) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                CameraParameters cameraParams;
-                getParameters(device1, &cameraParams /*out*/);
+            CameraParameters cameraParams;
+            getParameters(device1, &cameraParams /*out*/);
 
-                if (Status::OK != isAutoFocusModeAvailable(cameraParams,
-                        CameraParameters::FOCUS_MODE_AUTO)) {
-                    Return<void> ret = device1->close();
-                    ASSERT_TRUE(ret.isOk());
-                    continue;
-                }
-
-                // It should be fine to call before preview starts.
-                ASSERT_EQ(Status::OK, device1->cancelAutoFocus());
-
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
-                startPreview(device1);
-
-                // It should be fine to call after preview starts too.
-                Return<Status> returnStatus = device1->cancelAutoFocus();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-
-                returnStatus = device1->autoFocus();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-
-                returnStatus = device1->cancelAutoFocus();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-
-                stopPreviewAndClose(device1);
+            if (Status::OK !=
+                isAutoFocusModeAvailable(cameraParams, CameraParameters::FOCUS_MODE_AUTO)) {
+                Return<void> ret = device1->close();
+                ASSERT_TRUE(ret.isOk());
+                continue;
             }
+
+            // It should be fine to call before preview starts.
+            ASSERT_EQ(Status::OK, device1->cancelAutoFocus());
+
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+            startPreview(device1);
+
+            // It should be fine to call after preview starts too.
+            Return<Status> returnStatus = device1->cancelAutoFocus();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+
+            returnStatus = device1->autoFocus();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+
+            returnStatus = device1->cancelAutoFocus();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // Check whether face detection is available and try to enable&disable.
 TEST_F(CameraHidlTest, sendCommandFaceDetection) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                CameraParameters cameraParams;
-                getParameters(device1, &cameraParams /*out*/);
+            CameraParameters cameraParams;
+            getParameters(device1, &cameraParams /*out*/);
 
-                int32_t hwFaces = cameraParams.getInt(
-                        CameraParameters::KEY_MAX_NUM_DETECTED_FACES_HW);
-                int32_t swFaces = cameraParams.getInt(
-                        CameraParameters::KEY_MAX_NUM_DETECTED_FACES_SW);
-                if ((0 >= hwFaces) && (0 >= swFaces)) {
-                    Return<void> ret = device1->close();
-                    ASSERT_TRUE(ret.isOk());
-                    continue;
-                }
-
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
-                startPreview(device1);
-
-                if (0 < hwFaces) {
-                    Return<Status> returnStatus = device1->sendCommand(
-                            CommandType::START_FACE_DETECTION,
-                            CAMERA_FACE_DETECTION_HW, 0);
-                    ASSERT_TRUE(returnStatus.isOk());
-                    ASSERT_EQ(Status::OK, returnStatus);
-                    // TODO(epeev) : Enable and check for face notifications
-                    returnStatus = device1->sendCommand(
-                            CommandType::STOP_FACE_DETECTION,
-                            CAMERA_FACE_DETECTION_HW, 0);
-                    ASSERT_TRUE(returnStatus.isOk());
-                    ASSERT_EQ(Status::OK, returnStatus);
-                }
-
-                if (0 < swFaces) {
-                    Return<Status> returnStatus = device1->sendCommand(
-                            CommandType::START_FACE_DETECTION,
-                            CAMERA_FACE_DETECTION_SW, 0);
-                    ASSERT_TRUE(returnStatus.isOk());
-                    ASSERT_EQ(Status::OK, returnStatus);
-                    // TODO(epeev) : Enable and check for face notifications
-                    returnStatus = device1->sendCommand(
-                            CommandType::STOP_FACE_DETECTION,
-                            CAMERA_FACE_DETECTION_SW, 0);
-                    ASSERT_TRUE(returnStatus.isOk());
-                    ASSERT_EQ(Status::OK, returnStatus);
-                }
-
-                stopPreviewAndClose(device1);
+            int32_t hwFaces = cameraParams.getInt(CameraParameters::KEY_MAX_NUM_DETECTED_FACES_HW);
+            int32_t swFaces = cameraParams.getInt(CameraParameters::KEY_MAX_NUM_DETECTED_FACES_SW);
+            if ((0 >= hwFaces) && (0 >= swFaces)) {
+                Return<void> ret = device1->close();
+                ASSERT_TRUE(ret.isOk());
+                continue;
             }
+
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+            startPreview(device1);
+
+            if (0 < hwFaces) {
+                Return<Status> returnStatus = device1->sendCommand(
+                    CommandType::START_FACE_DETECTION, CAMERA_FACE_DETECTION_HW, 0);
+                ASSERT_TRUE(returnStatus.isOk());
+                ASSERT_EQ(Status::OK, returnStatus);
+                // TODO(epeev) : Enable and check for face notifications
+                returnStatus = device1->sendCommand(CommandType::STOP_FACE_DETECTION,
+                                                    CAMERA_FACE_DETECTION_HW, 0);
+                ASSERT_TRUE(returnStatus.isOk());
+                ASSERT_EQ(Status::OK, returnStatus);
+            }
+
+            if (0 < swFaces) {
+                Return<Status> returnStatus = device1->sendCommand(
+                    CommandType::START_FACE_DETECTION, CAMERA_FACE_DETECTION_SW, 0);
+                ASSERT_TRUE(returnStatus.isOk());
+                ASSERT_EQ(Status::OK, returnStatus);
+                // TODO(epeev) : Enable and check for face notifications
+                returnStatus = device1->sendCommand(CommandType::STOP_FACE_DETECTION,
+                                                    CAMERA_FACE_DETECTION_SW, 0);
+                ASSERT_TRUE(returnStatus.isOk());
+                ASSERT_EQ(Status::OK, returnStatus);
+            }
+
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // Check whether smooth zoom is available and try to enable&disable.
 TEST_F(CameraHidlTest, sendCommandSmoothZoom) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                CameraParameters cameraParams;
-                getParameters(device1, &cameraParams /*out*/);
+            CameraParameters cameraParams;
+            getParameters(device1, &cameraParams /*out*/);
 
-                const char *smoothZoomStr = cameraParams.get(
-                        CameraParameters::KEY_SMOOTH_ZOOM_SUPPORTED);
-                bool smoothZoomSupported = ((nullptr != smoothZoomStr) &&
-                        (strcmp(smoothZoomStr, CameraParameters::TRUE) == 0)) ?
-                                true : false;
-                if (!smoothZoomSupported) {
-                    Return<void> ret = device1->close();
-                    ASSERT_TRUE(ret.isOk());
-                    continue;
-                }
-
-                int32_t maxZoom = cameraParams.getInt(
-                        CameraParameters::KEY_MAX_ZOOM);
-                ASSERT_TRUE(0 < maxZoom);
-
-                sp<BufferItemConsumer> bufferItemConsumer;
-                sp<BufferItemHander> bufferHandler;
-                setupPreviewWindow(device1, &bufferItemConsumer /*out*/,
-                        &bufferHandler /*out*/);
-                startPreview(device1);
-                setParameters(device1, cameraParams);
-
-                Return<Status> returnStatus = device1->sendCommand(
-                        CommandType::START_SMOOTH_ZOOM, maxZoom, 0);
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-                // TODO(epeev) : Enable and check for face notifications
-                returnStatus = device1->sendCommand(
-                        CommandType::STOP_SMOOTH_ZOOM, 0, 0);
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-
-                stopPreviewAndClose(device1);
+            const char* smoothZoomStr =
+                cameraParams.get(CameraParameters::KEY_SMOOTH_ZOOM_SUPPORTED);
+            bool smoothZoomSupported =
+                ((nullptr != smoothZoomStr) && (strcmp(smoothZoomStr, CameraParameters::TRUE) == 0))
+                    ? true
+                    : false;
+            if (!smoothZoomSupported) {
+                Return<void> ret = device1->close();
+                ASSERT_TRUE(ret.isOk());
+                continue;
             }
+
+            int32_t maxZoom = cameraParams.getInt(CameraParameters::KEY_MAX_ZOOM);
+            ASSERT_TRUE(0 < maxZoom);
+
+            sp<BufferItemConsumer> bufferItemConsumer;
+            sp<BufferItemHander> bufferHandler;
+            setupPreviewWindow(device1, &bufferItemConsumer /*out*/, &bufferHandler /*out*/);
+            startPreview(device1);
+            setParameters(device1, cameraParams);
+
+            Return<Status> returnStatus =
+                device1->sendCommand(CommandType::START_SMOOTH_ZOOM, maxZoom, 0);
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+            // TODO(epeev) : Enable and check for face notifications
+            returnStatus = device1->sendCommand(CommandType::STOP_SMOOTH_ZOOM, 0, 0);
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+
+            stopPreviewAndClose(device1);
         }
     }
 }
 
 // Basic sanity tests related to camera parameters.
 TEST_F(CameraHidlTest, getSetParameters) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                CameraParameters cameraParams;
-                getParameters(device1, &cameraParams /*out*/);
+            CameraParameters cameraParams;
+            getParameters(device1, &cameraParams /*out*/);
 
-                int32_t width, height;
-                cameraParams.getPictureSize(&width, &height);
-                ASSERT_TRUE((0 < width) && (0 < height));
-                cameraParams.getPreviewSize(&width, &height);
-                ASSERT_TRUE((0 < width) && (0 < height));
-                int32_t minFps, maxFps;
-                cameraParams.getPreviewFpsRange(&minFps, &maxFps);
-                ASSERT_TRUE((0 < minFps) && (0 < maxFps));
-                ASSERT_NE(nullptr, cameraParams.getPreviewFormat());
-                ASSERT_NE(nullptr, cameraParams.getPictureFormat());
-                ASSERT_TRUE(strcmp(CameraParameters::PIXEL_FORMAT_JPEG,
-                        cameraParams.getPictureFormat()) == 0);
+            int32_t width, height;
+            cameraParams.getPictureSize(&width, &height);
+            ASSERT_TRUE((0 < width) && (0 < height));
+            cameraParams.getPreviewSize(&width, &height);
+            ASSERT_TRUE((0 < width) && (0 < height));
+            int32_t minFps, maxFps;
+            cameraParams.getPreviewFpsRange(&minFps, &maxFps);
+            ASSERT_TRUE((0 < minFps) && (0 < maxFps));
+            ASSERT_NE(nullptr, cameraParams.getPreviewFormat());
+            ASSERT_NE(nullptr, cameraParams.getPictureFormat());
+            ASSERT_TRUE(
+                strcmp(CameraParameters::PIXEL_FORMAT_JPEG, cameraParams.getPictureFormat()) == 0);
 
-                const char *flashMode = cameraParams.get(
-                        CameraParameters::KEY_FLASH_MODE);
-                ASSERT_TRUE((nullptr == flashMode) || (strcmp(
-                        CameraParameters::FLASH_MODE_OFF, flashMode) == 0));
+            const char* flashMode = cameraParams.get(CameraParameters::KEY_FLASH_MODE);
+            ASSERT_TRUE((nullptr == flashMode) ||
+                        (strcmp(CameraParameters::FLASH_MODE_OFF, flashMode) == 0));
 
-                const char *wbMode = cameraParams.get(
-                        CameraParameters::KEY_WHITE_BALANCE);
-                ASSERT_TRUE((nullptr == wbMode) || (strcmp(
-                        CameraParameters::WHITE_BALANCE_AUTO, wbMode) == 0));
+            const char* wbMode = cameraParams.get(CameraParameters::KEY_WHITE_BALANCE);
+            ASSERT_TRUE((nullptr == wbMode) ||
+                        (strcmp(CameraParameters::WHITE_BALANCE_AUTO, wbMode) == 0));
 
-                const char *effect = cameraParams.get(
-                        CameraParameters::KEY_EFFECT);
-                ASSERT_TRUE((nullptr == effect) || (strcmp(
-                        CameraParameters::EFFECT_NONE, effect) == 0));
+            const char* effect = cameraParams.get(CameraParameters::KEY_EFFECT);
+            ASSERT_TRUE((nullptr == effect) ||
+                        (strcmp(CameraParameters::EFFECT_NONE, effect) == 0));
 
-                ::android::Vector<Size> previewSizes;
-                cameraParams.getSupportedPreviewSizes(previewSizes);
-                ASSERT_FALSE(previewSizes.empty());
-                ::android::Vector<Size> pictureSizes;
-                cameraParams.getSupportedPictureSizes(pictureSizes);
-                ASSERT_FALSE(pictureSizes.empty());
-                const char *previewFormats = cameraParams.get(
-                        CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS);
-                ASSERT_NE(nullptr, previewFormats);
-                ::android::String8 previewFormatsString(previewFormats);
-                ASSERT_TRUE(previewFormatsString.contains(
-                        CameraParameters::PIXEL_FORMAT_YUV420SP));
-                ASSERT_NE(nullptr, cameraParams.get(
-                        CameraParameters::KEY_SUPPORTED_PICTURE_FORMATS));
-                ASSERT_NE(nullptr, cameraParams.get(
-                        CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES));
-                const char *focusModes = cameraParams.get(
-                        CameraParameters::KEY_SUPPORTED_FOCUS_MODES);
-                ASSERT_NE(nullptr, focusModes);
-                ::android::String8 focusModesString(focusModes);
-                const char *focusMode = cameraParams.get(
-                        CameraParameters::KEY_FOCUS_MODE);
-                ASSERT_NE(nullptr, focusMode);
-                // Auto focus mode should be default
-                if (focusModesString.contains(
-                        CameraParameters::FOCUS_MODE_AUTO)) {
-                    ASSERT_TRUE(strcmp(
-                            CameraParameters::FOCUS_MODE_AUTO, focusMode) == 0);
-                }
-                ASSERT_TRUE(0 < cameraParams.getInt(
-                        CameraParameters::KEY_FOCAL_LENGTH));
-                int32_t horizontalViewAngle = cameraParams.getInt(
-                        CameraParameters::KEY_HORIZONTAL_VIEW_ANGLE);
-                ASSERT_TRUE((0 < horizontalViewAngle) &&
-                            (360 >= horizontalViewAngle));
-                int32_t verticalViewAngle = cameraParams.getInt(
-                        CameraParameters::KEY_VERTICAL_VIEW_ANGLE);
-                ASSERT_TRUE((0 < verticalViewAngle) &&
-                            (360 >= verticalViewAngle));
-                int32_t jpegQuality = cameraParams.getInt(
-                        CameraParameters::KEY_JPEG_QUALITY);
-                ASSERT_TRUE((1 <= jpegQuality) && (100 >= jpegQuality));
-                int32_t jpegThumbQuality = cameraParams.getInt(
-                        CameraParameters::KEY_JPEG_THUMBNAIL_QUALITY);
-                ASSERT_TRUE((1 <= jpegThumbQuality) &&
-                            (100 >= jpegThumbQuality));
-
-                cameraParams.setPictureSize(pictureSizes[0].width,
-                        pictureSizes[0].height);
-                cameraParams.setPreviewSize(previewSizes[0].width,
-                        previewSizes[0].height);
-
-                setParameters(device1, cameraParams);
-                getParameters(device1, &cameraParams /*out*/);
-
-                cameraParams.getPictureSize(&width, &height);
-                ASSERT_TRUE((pictureSizes[0].width == width) &&
-                        (pictureSizes[0].height == height));
-                cameraParams.getPreviewSize(&width, &height);
-                ASSERT_TRUE((previewSizes[0].width == width) &&
-                        (previewSizes[0].height == height));
-
-                Return<void> ret = device1->close();
-                ASSERT_TRUE(ret.isOk());
+            ::android::Vector<Size> previewSizes;
+            cameraParams.getSupportedPreviewSizes(previewSizes);
+            ASSERT_FALSE(previewSizes.empty());
+            ::android::Vector<Size> pictureSizes;
+            cameraParams.getSupportedPictureSizes(pictureSizes);
+            ASSERT_FALSE(pictureSizes.empty());
+            const char* previewFormats =
+                cameraParams.get(CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS);
+            ASSERT_NE(nullptr, previewFormats);
+            ::android::String8 previewFormatsString(previewFormats);
+            ASSERT_TRUE(previewFormatsString.contains(CameraParameters::PIXEL_FORMAT_YUV420SP));
+            ASSERT_NE(nullptr, cameraParams.get(CameraParameters::KEY_SUPPORTED_PICTURE_FORMATS));
+            ASSERT_NE(nullptr,
+                      cameraParams.get(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES));
+            const char* focusModes = cameraParams.get(CameraParameters::KEY_SUPPORTED_FOCUS_MODES);
+            ASSERT_NE(nullptr, focusModes);
+            ::android::String8 focusModesString(focusModes);
+            const char* focusMode = cameraParams.get(CameraParameters::KEY_FOCUS_MODE);
+            ASSERT_NE(nullptr, focusMode);
+            // Auto focus mode should be default
+            if (focusModesString.contains(CameraParameters::FOCUS_MODE_AUTO)) {
+                ASSERT_TRUE(strcmp(CameraParameters::FOCUS_MODE_AUTO, focusMode) == 0);
             }
+            ASSERT_TRUE(0 < cameraParams.getInt(CameraParameters::KEY_FOCAL_LENGTH));
+            int32_t horizontalViewAngle =
+                cameraParams.getInt(CameraParameters::KEY_HORIZONTAL_VIEW_ANGLE);
+            ASSERT_TRUE((0 < horizontalViewAngle) && (360 >= horizontalViewAngle));
+            int32_t verticalViewAngle =
+                cameraParams.getInt(CameraParameters::KEY_VERTICAL_VIEW_ANGLE);
+            ASSERT_TRUE((0 < verticalViewAngle) && (360 >= verticalViewAngle));
+            int32_t jpegQuality = cameraParams.getInt(CameraParameters::KEY_JPEG_QUALITY);
+            ASSERT_TRUE((1 <= jpegQuality) && (100 >= jpegQuality));
+            int32_t jpegThumbQuality =
+                cameraParams.getInt(CameraParameters::KEY_JPEG_THUMBNAIL_QUALITY);
+            ASSERT_TRUE((1 <= jpegThumbQuality) && (100 >= jpegThumbQuality));
+
+            cameraParams.setPictureSize(pictureSizes[0].width, pictureSizes[0].height);
+            cameraParams.setPreviewSize(previewSizes[0].width, previewSizes[0].height);
+
+            setParameters(device1, cameraParams);
+            getParameters(device1, &cameraParams /*out*/);
+
+            cameraParams.getPictureSize(&width, &height);
+            ASSERT_TRUE((pictureSizes[0].width == width) && (pictureSizes[0].height == height));
+            cameraParams.getPreviewSize(&width, &height);
+            ASSERT_TRUE((previewSizes[0].width == width) && (previewSizes[0].height == height));
+
+            Return<void> ret = device1->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2011,50 +1831,36 @@
 // Verify that the static camera characteristics can be retrieved
 // successfully.
 TEST_F(CameraHidlTest, getCameraCharacteristics) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
-                ALOGI("getCameraCharacteristics: Testing camera device %s",
-                      name.c_str());
-                Return<void> ret;
-                ret = provider.second->getCameraDeviceInterface_V3_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V3_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device3_2 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str());
+            Return<void> ret;
+            ret = mProvider->getCameraDeviceInterface_V3_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                ret = device3_2->getCameraCharacteristics(
-                    [&](auto status, const auto& chars) {
-                        ALOGI("getCameraCharacteristics returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        const camera_metadata_t* metadata =
-                                (camera_metadata_t*) chars.data();
-                        size_t expectedSize = chars.size();
-                        int result = validate_camera_metadata_structure(
-                                metadata, &expectedSize);
-                        ASSERT_TRUE((result == 0) ||
-                                (result == CAMERA_METADATA_VALIDATION_SHIFTED));
-                        size_t entryCount = get_camera_metadata_entry_count(
-                                metadata);
-                        // TODO: we can do better than 0 here. Need to check how many required
-                        // characteristics keys we've defined.
-                        ASSERT_GT(entryCount, 0u);
-                        ALOGI("getCameraCharacteristics metadata entry count is %zu",
-                              entryCount);
-                    });
-                ASSERT_TRUE(ret.isOk());
-            }
+            ret = device3_2->getCameraCharacteristics([&](auto status, const auto& chars) {
+                ALOGI("getCameraCharacteristics returns status:%d", (int)status);
+                ASSERT_EQ(Status::OK, status);
+                const camera_metadata_t* metadata = (camera_metadata_t*)chars.data();
+                size_t expectedSize = chars.size();
+                int result = validate_camera_metadata_structure(metadata, &expectedSize);
+                ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED));
+                size_t entryCount = get_camera_metadata_entry_count(metadata);
+                // TODO: we can do better than 0 here. Need to check how many required
+                // characteristics keys we've defined.
+                ASSERT_GT(entryCount, 0u);
+                ALOGI("getCameraCharacteristics metadata entry count is %zu", entryCount);
+            });
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2062,273 +1868,235 @@
 //In case it is supported verify that torch can be enabled.
 //Check for corresponding toch callbacks as well.
 TEST_F(CameraHidlTest, setTorchMode) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        bool torchControlSupported = false;
-        Return<void> ret;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    bool torchControlSupported = false;
+    Return<void> ret;
 
-        ret = provider.second->isSetTorchModeSupported(
-            [&](auto status, bool support) {
-                ALOGI("isSetTorchModeSupported returns status:%d supported:%d",
-                        (int)status, support);
-                ASSERT_EQ(Status::OK, status);
-                torchControlSupported = support;
-            });
+    ret = mProvider->isSetTorchModeSupported([&](auto status, bool support) {
+        ALOGI("isSetTorchModeSupported returns status:%d supported:%d", (int)status, support);
+        ASSERT_EQ(Status::OK, status);
+        torchControlSupported = support;
+    });
 
+    sp<TorchProviderCb> cb = new TorchProviderCb(this);
+    Return<Status> returnStatus = mProvider->setCallback(cb);
+    ASSERT_TRUE(returnStatus.isOk());
+    ASSERT_EQ(Status::OK, returnStatus);
 
-        sp<TorchProviderCb> cb = new TorchProviderCb(this);
-        Return<Status> returnStatus = provider.second->setCallback(cb);
-        ASSERT_TRUE(returnStatus.isOk());
-        ASSERT_EQ(Status::OK, returnStatus);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("setTorchMode: Testing camera device %s", name.c_str());
+            ret = mProvider->getCameraDeviceInterface_V3_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
-                ALOGI("setTorchMode: Testing camera device %s", name.c_str());
-                ret = provider.second->getCameraDeviceInterface_V3_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V3_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device3_2 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
-
-                mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
-                returnStatus = device3_2->setTorchMode(TorchMode::ON);
-                ASSERT_TRUE(returnStatus.isOk());
-                if (!torchControlSupported) {
-                    ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus);
-                } else {
-                    ASSERT_TRUE(returnStatus == Status::OK ||
-                                returnStatus == Status::OPERATION_NOT_SUPPORTED);
-                    if (returnStatus == Status::OK) {
-                        {
-                            std::unique_lock<std::mutex> l(mTorchLock);
-                            while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
-                                auto timeout = std::chrono::system_clock::now() +
-                                        std::chrono::seconds(kTorchTimeoutSec);
-                                ASSERT_NE(std::cv_status::timeout,
-                                        mTorchCond.wait_until(l, timeout));
-                            }
-                            ASSERT_EQ(TorchModeStatus::AVAILABLE_ON,
-                                    mTorchStatus);
-                            mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
+            mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
+            returnStatus = device3_2->setTorchMode(TorchMode::ON);
+            ASSERT_TRUE(returnStatus.isOk());
+            if (!torchControlSupported) {
+                ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus);
+            } else {
+                ASSERT_TRUE(returnStatus == Status::OK ||
+                            returnStatus == Status::OPERATION_NOT_SUPPORTED);
+                if (returnStatus == Status::OK) {
+                    {
+                        std::unique_lock<std::mutex> l(mTorchLock);
+                        while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
+                            auto timeout = std::chrono::system_clock::now() +
+                                           std::chrono::seconds(kTorchTimeoutSec);
+                            ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout));
                         }
+                        ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus);
+                        mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
+                    }
 
-                        returnStatus = device3_2->setTorchMode(TorchMode::OFF);
-                        ASSERT_TRUE(returnStatus.isOk());
-                        ASSERT_EQ(Status::OK, returnStatus);
+                    returnStatus = device3_2->setTorchMode(TorchMode::OFF);
+                    ASSERT_TRUE(returnStatus.isOk());
+                    ASSERT_EQ(Status::OK, returnStatus);
 
-                        {
-                            std::unique_lock<std::mutex> l(mTorchLock);
-                            while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
-                                auto timeout = std::chrono::system_clock::now() +
-                                        std::chrono::seconds(kTorchTimeoutSec);
-                                ASSERT_NE(std::cv_status::timeout,
-                                        mTorchCond.wait_until(l, timeout));
-                            }
-                            ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF,
-                                    mTorchStatus);
+                    {
+                        std::unique_lock<std::mutex> l(mTorchLock);
+                        while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
+                            auto timeout = std::chrono::system_clock::now() +
+                                           std::chrono::seconds(kTorchTimeoutSec);
+                            ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout));
                         }
+                        ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus);
                     }
                 }
-            } else if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                ALOGI("dumpState: Testing camera device %s", name.c_str());
-                ret = provider.second->getCameraDeviceInterface_V1_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V1_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device1 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
-
-                mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
-                returnStatus = device1->setTorchMode(TorchMode::ON);
-                ASSERT_TRUE(returnStatus.isOk());
-                if (!torchControlSupported) {
-                    ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus);
-                } else {
-                    ASSERT_TRUE(returnStatus == Status::OK ||
-                                returnStatus == Status::OPERATION_NOT_SUPPORTED);
-                    if (returnStatus == Status::OK) {
-                        {
-                            std::unique_lock<std::mutex> l(mTorchLock);
-                            while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
-                                auto timeout = std::chrono::system_clock::now() +
-                                        std::chrono::seconds(kTorchTimeoutSec);
-                                ASSERT_NE(std::cv_status::timeout,
-                                        mTorchCond.wait_until(l, timeout));
-                            }
-                            ASSERT_EQ(TorchModeStatus::AVAILABLE_ON,
-                                    mTorchStatus);
-                            mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
-                        }
-
-                        returnStatus = device1->setTorchMode(TorchMode::OFF);
-                        ASSERT_TRUE(returnStatus.isOk());
-                        ASSERT_EQ(Status::OK, returnStatus);
-
-                        {
-                            std::unique_lock<std::mutex> l(mTorchLock);
-                            while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
-                                auto timeout = std::chrono::system_clock::now() +
-                                        std::chrono::seconds(kTorchTimeoutSec);
-                                ASSERT_NE(std::cv_status::timeout,
-                                        mTorchCond.wait_until(l, timeout));
-                            }
-                            ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF,
-                                    mTorchStatus);
-                        }
-                    }
-                }
-                ret = device1->close();
-                ASSERT_TRUE(ret.isOk());
             }
-        }
+        } else if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            ALOGI("dumpState: Testing camera device %s", name.c_str());
+            ret = mProvider->getCameraDeviceInterface_V1_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V1_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device1 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-        returnStatus = provider.second->setCallback(nullptr);
-        ASSERT_TRUE(returnStatus.isOk());
-        ASSERT_EQ(Status::OK, returnStatus);
+            mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
+            returnStatus = device1->setTorchMode(TorchMode::ON);
+            ASSERT_TRUE(returnStatus.isOk());
+            if (!torchControlSupported) {
+                ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus);
+            } else {
+                ASSERT_TRUE(returnStatus == Status::OK ||
+                            returnStatus == Status::OPERATION_NOT_SUPPORTED);
+                if (returnStatus == Status::OK) {
+                    {
+                        std::unique_lock<std::mutex> l(mTorchLock);
+                        while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
+                            auto timeout = std::chrono::system_clock::now() +
+                                           std::chrono::seconds(kTorchTimeoutSec);
+                            ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout));
+                        }
+                        ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus);
+                        mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
+                    }
+
+                    returnStatus = device1->setTorchMode(TorchMode::OFF);
+                    ASSERT_TRUE(returnStatus.isOk());
+                    ASSERT_EQ(Status::OK, returnStatus);
+
+                    {
+                        std::unique_lock<std::mutex> l(mTorchLock);
+                        while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
+                            auto timeout = std::chrono::system_clock::now() +
+                                           std::chrono::seconds(kTorchTimeoutSec);
+                            ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout));
+                        }
+                        ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus);
+                    }
+                }
+            }
+            ret = device1->close();
+            ASSERT_TRUE(ret.isOk());
+        }
     }
+
+    returnStatus = mProvider->setCallback(nullptr);
+    ASSERT_TRUE(returnStatus.isOk());
+    ASSERT_EQ(Status::OK, returnStatus);
 }
 
 // Check dump functionality.
 TEST_F(CameraHidlTest, dumpState) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        Return<void> ret;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    Return<void> ret;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                ::android::sp<ICameraDevice> device3_2;
-                ALOGI("dumpState: Testing camera device %s", name.c_str());
-                ret = provider.second->getCameraDeviceInterface_V3_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V3_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device3_2 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<ICameraDevice> device3_2;
+            ALOGI("dumpState: Testing camera device %s", name.c_str());
+            ret = mProvider->getCameraDeviceInterface_V3_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                native_handle_t* raw_handle = native_handle_create(1, 0);
-                raw_handle->data[0] = open(kDumpOutput, O_RDWR);
-                ASSERT_GE(raw_handle->data[0], 0);
-                hidl_handle handle = raw_handle;
-                ret= device3_2->dumpState(handle);
-                ASSERT_TRUE(ret.isOk());
-                close(raw_handle->data[0]);
-                native_handle_delete(raw_handle);
-            } else if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                ALOGI("dumpState: Testing camera device %s", name.c_str());
-                ret = provider.second->getCameraDeviceInterface_V1_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V1_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device1 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+            native_handle_t* raw_handle = native_handle_create(1, 0);
+            raw_handle->data[0] = open(kDumpOutput, O_RDWR);
+            ASSERT_GE(raw_handle->data[0], 0);
+            hidl_handle handle = raw_handle;
+            ret = device3_2->dumpState(handle);
+            ASSERT_TRUE(ret.isOk());
+            close(raw_handle->data[0]);
+            native_handle_delete(raw_handle);
+        } else if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            ::android::sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            ALOGI("dumpState: Testing camera device %s", name.c_str());
+            ret = mProvider->getCameraDeviceInterface_V1_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V1_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device1 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                native_handle_t* raw_handle = native_handle_create(1, 0);
-                raw_handle->data[0] = open(kDumpOutput, O_RDWR);
-                ASSERT_GE(raw_handle->data[0], 0);
-                hidl_handle handle = raw_handle;
-                Return<Status> returnStatus = device1->dumpState(handle);
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-                close(raw_handle->data[0]);
-                native_handle_delete(raw_handle);
-            }
+            native_handle_t* raw_handle = native_handle_create(1, 0);
+            raw_handle->data[0] = open(kDumpOutput, O_RDWR);
+            ASSERT_GE(raw_handle->data[0], 0);
+            hidl_handle handle = raw_handle;
+            Return<Status> returnStatus = device1->dumpState(handle);
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+            close(raw_handle->data[0]);
+            native_handle_delete(raw_handle);
         }
     }
 }
 
 // Open, dumpStates, then close
 TEST_F(CameraHidlTest, openClose) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        Return<void> ret;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    Return<void> ret;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
-                ALOGI("openClose: Testing camera device %s", name.c_str());
-                ret = provider.second->getCameraDeviceInterface_V3_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V3_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device3_2 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            ALOGI("openClose: Testing camera device %s", name.c_str());
+            ret = mProvider->getCameraDeviceInterface_V3_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                sp<EmptyDeviceCb> cb = new EmptyDeviceCb;
-                sp<ICameraDeviceSession> session;
-                ret = device3_2->open(
-                    cb,
-                    [&](auto status, const auto& newSession) {
-                        ALOGI("device::open returns status:%d", (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(newSession, nullptr);
-                        session = newSession;
-                    });
-                ASSERT_TRUE(ret.isOk());
+            sp<EmptyDeviceCb> cb = new EmptyDeviceCb;
+            sp<ICameraDeviceSession> session;
+            ret = device3_2->open(cb, [&](auto status, const auto& newSession) {
+                ALOGI("device::open returns status:%d", (int)status);
+                ASSERT_EQ(Status::OK, status);
+                ASSERT_NE(newSession, nullptr);
+                session = newSession;
+            });
+            ASSERT_TRUE(ret.isOk());
 
-                native_handle_t* raw_handle = native_handle_create(1, 0);
-                raw_handle->data[0] = open(kDumpOutput, O_RDWR);
-                ASSERT_GE(raw_handle->data[0], 0);
-                hidl_handle handle = raw_handle;
-                ret = device3_2->dumpState(handle);
-                ASSERT_TRUE(ret.isOk());
-                close(raw_handle->data[0]);
-                native_handle_delete(raw_handle);
+            native_handle_t* raw_handle = native_handle_create(1, 0);
+            raw_handle->data[0] = open(kDumpOutput, O_RDWR);
+            ASSERT_GE(raw_handle->data[0], 0);
+            hidl_handle handle = raw_handle;
+            ret = device3_2->dumpState(handle);
+            ASSERT_TRUE(ret.isOk());
+            close(raw_handle->data[0]);
+            native_handle_delete(raw_handle);
 
-                ret = session->close();
-                ASSERT_TRUE(ret.isOk());
-                // TODO: test all session API calls return INTERNAL_ERROR after close
-                // TODO: keep a wp copy here and verify session cannot be promoted out of this scope
-            } else if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_1_0) {
-                sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
-                openCameraDevice(name, provider.second, &device1 /*out*/);
-                ASSERT_NE(nullptr, device1.get());
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
+            // TODO: test all session API calls return INTERNAL_ERROR after close
+            // TODO: keep a wp copy here and verify session cannot be promoted out of this scope
+        } else if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_1_0) {
+            sp<::android::hardware::camera::device::V1_0::ICameraDevice> device1;
+            openCameraDevice(name, mProvider, &device1 /*out*/);
+            ASSERT_NE(nullptr, device1.get());
 
-                native_handle_t* raw_handle = native_handle_create(1, 0);
-                raw_handle->data[0] = open(kDumpOutput, O_RDWR);
-                ASSERT_GE(raw_handle->data[0], 0);
-                hidl_handle handle = raw_handle;
-                Return<Status> returnStatus = device1->dumpState(handle);
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-                close(raw_handle->data[0]);
-                native_handle_delete(raw_handle);
+            native_handle_t* raw_handle = native_handle_create(1, 0);
+            raw_handle->data[0] = open(kDumpOutput, O_RDWR);
+            ASSERT_GE(raw_handle->data[0], 0);
+            hidl_handle handle = raw_handle;
+            Return<Status> returnStatus = device1->dumpState(handle);
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+            close(raw_handle->data[0]);
+            native_handle_delete(raw_handle);
 
-                ret = device1->close();
-                ASSERT_TRUE(ret.isOk());
-            }
+            ret = device1->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2336,46 +2104,38 @@
 // Check whether all common default request settings can be sucessfully
 // constructed.
 TEST_F(CameraHidlTest, constructDefaultRequestSettings) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
-                Return<void> ret;
-                ALOGI("constructDefaultRequestSettings: Testing camera device %s",
-                      name.c_str());
-                ret = provider.second->getCameraDeviceInterface_V3_x(
-                    name,
-                    [&](auto status, const auto& device) {
-                        ALOGI("getCameraDeviceInterface_V3_x returns status:%d",
-                              (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(device, nullptr);
-                        device3_2 = device;
-                    });
-                ASSERT_TRUE(ret.isOk());
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_2;
+            Return<void> ret;
+            ALOGI("constructDefaultRequestSettings: Testing camera device %s", name.c_str());
+            ret = mProvider->getCameraDeviceInterface_V3_x(
+                name, [&](auto status, const auto& device) {
+                    ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
+                    ASSERT_EQ(Status::OK, status);
+                    ASSERT_NE(device, nullptr);
+                    device3_2 = device;
+                });
+            ASSERT_TRUE(ret.isOk());
 
-                sp<EmptyDeviceCb> cb = new EmptyDeviceCb;
-                sp<ICameraDeviceSession> session;
-                ret = device3_2->open(
-                    cb,
-                    [&](auto status, const auto& newSession) {
-                        ALOGI("device::open returns status:%d", (int)status);
-                        ASSERT_EQ(Status::OK, status);
-                        ASSERT_NE(newSession, nullptr);
-                        session = newSession;
-                    });
-                ASSERT_TRUE(ret.isOk());
+            sp<EmptyDeviceCb> cb = new EmptyDeviceCb;
+            sp<ICameraDeviceSession> session;
+            ret = device3_2->open(cb, [&](auto status, const auto& newSession) {
+                ALOGI("device::open returns status:%d", (int)status);
+                ASSERT_EQ(Status::OK, status);
+                ASSERT_NE(newSession, nullptr);
+                session = newSession;
+            });
+            ASSERT_TRUE(ret.isOk());
 
-                for (uint32_t t = (uint32_t) RequestTemplate::PREVIEW;
-                        t <= (uint32_t) RequestTemplate::MANUAL; t++) {
-                    RequestTemplate reqTemplate = (RequestTemplate) t;
-                    ret = session->constructDefaultRequestSettings(
-                        reqTemplate,
-                        [&](auto status, const auto& req) {
+            for (uint32_t t = (uint32_t)RequestTemplate::PREVIEW;
+                 t <= (uint32_t)RequestTemplate::MANUAL; t++) {
+                RequestTemplate reqTemplate = (RequestTemplate)t;
+                ret =
+                    session->constructDefaultRequestSettings(
+                        reqTemplate, [&](auto status, const auto& req) {
                             ALOGI("constructDefaultRequestSettings returns status:%d",
                                   (int)status);
                             if (reqTemplate == RequestTemplate::ZERO_SHUTTER_LAG ||
@@ -2406,11 +2166,10 @@
                                 ASSERT_EQ(0u, req.size());
                             }
                         });
-                    ASSERT_TRUE(ret.isOk());
-                }
-                ret = session->close();
                 ASSERT_TRUE(ret.isOk());
             }
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2418,138 +2177,131 @@
 // Verify that all supported stream formats and sizes can be configured
 // successfully.
 TEST_F(CameraHidlTest, configureStreamsAvailableOutputs) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputStreams;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputStreams;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                camera_metadata_t *staticMeta;
-                Return<void> ret;
-                sp<ICameraDeviceSession> session;
-                openEmptyDeviceSession(name, provider.second, &session /*out*/,
-                        &staticMeta /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            camera_metadata_t* staticMeta;
+            Return<void> ret;
+            sp<ICameraDeviceSession> session;
+            openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/);
 
-                outputStreams.clear();
-                ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                        outputStreams));
-                ASSERT_NE(0u, outputStreams.size());
+            outputStreams.clear();
+            ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams));
+            ASSERT_NE(0u, outputStreams.size());
 
-                int32_t streamId = 0;
-                for (auto &it : outputStreams) {
-                    Stream stream = {streamId, StreamType::OUTPUT,
-                            static_cast<uint32_t> (it.width),
-                            static_cast<uint32_t> (it.height),
-                            static_cast<PixelFormat> (it.format), 0, 0,
-                            StreamRotation::ROTATION_0};
-                    ::android::hardware::hidl_vec<Stream> streams = {stream};
-                    StreamConfiguration config = {streams,
-                            StreamConfigurationMode::NORMAL_MODE};
-                    ret = session->configureStreams(config, [streamId] (Status s,
-                            HalStreamConfiguration halConfig) {
+            int32_t streamId = 0;
+            for (auto& it : outputStreams) {
+                Stream stream = {streamId,
+                                 StreamType::OUTPUT,
+                                 static_cast<uint32_t>(it.width),
+                                 static_cast<uint32_t>(it.height),
+                                 static_cast<PixelFormat>(it.format),
+                                 0,
+                                 0,
+                                 StreamRotation::ROTATION_0};
+                ::android::hardware::hidl_vec<Stream> streams = {stream};
+                StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE};
+                ret = session->configureStreams(
+                    config, [streamId](Status s, HalStreamConfiguration halConfig) {
                         ASSERT_EQ(Status::OK, s);
                         ASSERT_EQ(1u, halConfig.streams.size());
                         ASSERT_EQ(halConfig.streams[0].id, streamId);
                     });
-                    ASSERT_TRUE(ret.isOk());
-                    streamId++;
-                }
-
-                free_camera_metadata(staticMeta);
-                ret = session->close();
                 ASSERT_TRUE(ret.isOk());
+                streamId++;
             }
+
+            free_camera_metadata(staticMeta);
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
 
 // Check for correct handling of invalid/incorrect configuration parameters.
 TEST_F(CameraHidlTest, configureStreamsInvalidOutputs) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputStreams;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputStreams;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                camera_metadata_t *staticMeta;
-                Return<void> ret;
-                sp<ICameraDeviceSession> session;
-                openEmptyDeviceSession(name, provider.second, &session /*out*/,
-                        &staticMeta /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            camera_metadata_t* staticMeta;
+            Return<void> ret;
+            sp<ICameraDeviceSession> session;
+            openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/);
 
-                outputStreams.clear();
-                ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                        outputStreams));
-                ASSERT_NE(0u, outputStreams.size());
+            outputStreams.clear();
+            ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams));
+            ASSERT_NE(0u, outputStreams.size());
 
-                int32_t streamId = 0;
-                Stream stream = {streamId++, StreamType::OUTPUT,
-                        static_cast<uint32_t> (0),
-                        static_cast<uint32_t> (0),
-                        static_cast<PixelFormat> (outputStreams[0].format),
-                        0, 0, StreamRotation::ROTATION_0};
-                ::android::hardware::hidl_vec<Stream> streams = {stream};
-                StreamConfiguration config = {streams,
-                        StreamConfigurationMode::NORMAL_MODE};
-                ret = session->configureStreams(config, [] (Status s,
-                        HalStreamConfiguration) {
-                    ASSERT_TRUE((Status::ILLEGAL_ARGUMENT == s) ||
-                                (Status::INTERNAL_ERROR == s));
-                });
-                ASSERT_TRUE(ret.isOk());
+            int32_t streamId = 0;
+            Stream stream = {streamId++,
+                             StreamType::OUTPUT,
+                             static_cast<uint32_t>(0),
+                             static_cast<uint32_t>(0),
+                             static_cast<PixelFormat>(outputStreams[0].format),
+                             0,
+                             0,
+                             StreamRotation::ROTATION_0};
+            ::android::hardware::hidl_vec<Stream> streams = {stream};
+            StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE};
+            ret = session->configureStreams(config, [](Status s, HalStreamConfiguration) {
+                ASSERT_TRUE((Status::ILLEGAL_ARGUMENT == s) || (Status::INTERNAL_ERROR == s));
+            });
+            ASSERT_TRUE(ret.isOk());
 
-                stream = {streamId++, StreamType::OUTPUT,
-                        static_cast<uint32_t> (UINT32_MAX),
-                        static_cast<uint32_t> (UINT32_MAX),
-                        static_cast<PixelFormat> (outputStreams[0].format),
-                        0, 0, StreamRotation::ROTATION_0};
+            stream = {streamId++,
+                      StreamType::OUTPUT,
+                      static_cast<uint32_t>(UINT32_MAX),
+                      static_cast<uint32_t>(UINT32_MAX),
+                      static_cast<PixelFormat>(outputStreams[0].format),
+                      0,
+                      0,
+                      StreamRotation::ROTATION_0};
+            streams[0] = stream;
+            config = {streams, StreamConfigurationMode::NORMAL_MODE};
+            ret = session->configureStreams(config, [](Status s, HalStreamConfiguration) {
+                ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
+            });
+            ASSERT_TRUE(ret.isOk());
+
+            for (auto& it : outputStreams) {
+                stream = {streamId++,
+                          StreamType::OUTPUT,
+                          static_cast<uint32_t>(it.width),
+                          static_cast<uint32_t>(it.height),
+                          static_cast<PixelFormat>(UINT32_MAX),
+                          0,
+                          0,
+                          StreamRotation::ROTATION_0};
                 streams[0] = stream;
-                config = {streams,
-                        StreamConfigurationMode::NORMAL_MODE};
-                ret = session->configureStreams(config, [] (Status s,
-                        HalStreamConfiguration) {
+                config = {streams, StreamConfigurationMode::NORMAL_MODE};
+                ret = session->configureStreams(config, [](Status s, HalStreamConfiguration) {
                     ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
                 });
                 ASSERT_TRUE(ret.isOk());
 
-                for (auto &it : outputStreams) {
-                    stream = {streamId++, StreamType::OUTPUT,
-                            static_cast<uint32_t> (it.width),
-                            static_cast<uint32_t> (it.height),
-                            static_cast<PixelFormat> (UINT32_MAX),
-                            0, 0, StreamRotation::ROTATION_0};
-                    streams[0] = stream;
-                    config = {streams,
-                            StreamConfigurationMode::NORMAL_MODE};
-                    ret = session->configureStreams(config, [] (Status s,
-                            HalStreamConfiguration) {
-                        ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
-                    });
-                    ASSERT_TRUE(ret.isOk());
-
-                    stream = {streamId++, StreamType::OUTPUT,
-                            static_cast<uint32_t> (it.width),
-                            static_cast<uint32_t> (it.height),
-                            static_cast<PixelFormat> (it.format),
-                            0, 0, static_cast<StreamRotation> (UINT32_MAX)};
-                    streams[0] = stream;
-                    config = {streams,
-                            StreamConfigurationMode::NORMAL_MODE};
-                    ret = session->configureStreams(config, [] (Status s,
-                            HalStreamConfiguration) {
-                        ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
-                    });
-                    ASSERT_TRUE(ret.isOk());
-                }
-
-                free_camera_metadata(staticMeta);
-                ret = session->close();
+                stream = {streamId++,
+                          StreamType::OUTPUT,
+                          static_cast<uint32_t>(it.width),
+                          static_cast<uint32_t>(it.height),
+                          static_cast<PixelFormat>(it.format),
+                          0,
+                          0,
+                          static_cast<StreamRotation>(UINT32_MAX)};
+                streams[0] = stream;
+                config = {streams, StreamConfigurationMode::NORMAL_MODE};
+                ret = session->configureStreams(config, [](Status s, HalStreamConfiguration) {
+                    ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
+                });
                 ASSERT_TRUE(ret.isOk());
             }
+
+            free_camera_metadata(staticMeta);
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2557,86 +2309,84 @@
 // Check whether all supported ZSL output stream combinations can be
 // configured successfully.
 TEST_F(CameraHidlTest, configureStreamsZSLInputOutputs) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> inputStreams;
-        std::vector<AvailableZSLInputOutput> inputOutputMap;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> inputStreams;
+    std::vector<AvailableZSLInputOutput> inputOutputMap;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                camera_metadata_t *staticMeta;
-                Return<void> ret;
-                sp<ICameraDeviceSession> session;
-                openEmptyDeviceSession(name, provider.second, &session /*out*/,
-                        &staticMeta /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            camera_metadata_t* staticMeta;
+            Return<void> ret;
+            sp<ICameraDeviceSession> session;
+            openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/);
 
-                Status rc = isZSLModeAvailable(staticMeta);
-                if (Status::METHOD_NOT_SUPPORTED == rc) {
-                    ret = session->close();
-                    ASSERT_TRUE(ret.isOk());
-                    continue;
-                }
-                ASSERT_EQ(Status::OK, rc);
+            Status rc = isZSLModeAvailable(staticMeta);
+            if (Status::METHOD_NOT_SUPPORTED == rc) {
+                ret = session->close();
+                ASSERT_TRUE(ret.isOk());
+                continue;
+            }
+            ASSERT_EQ(Status::OK, rc);
 
-                inputStreams.clear();
-                ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                        inputStreams));
+            inputStreams.clear();
+            ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, inputStreams));
+            ASSERT_NE(0u, inputStreams.size());
+
+            inputOutputMap.clear();
+            ASSERT_EQ(Status::OK, getZSLInputOutputMap(staticMeta, inputOutputMap));
+            ASSERT_NE(0u, inputOutputMap.size());
+
+            int32_t streamId = 0;
+            for (auto& inputIter : inputOutputMap) {
+                AvailableStream input;
+                ASSERT_EQ(Status::OK, findLargestSize(inputStreams, inputIter.inputFormat, input));
                 ASSERT_NE(0u, inputStreams.size());
 
-                inputOutputMap.clear();
-                ASSERT_EQ(Status::OK, getZSLInputOutputMap(staticMeta,
-                        inputOutputMap));
-                ASSERT_NE(0u, inputOutputMap.size());
+                AvailableStream outputThreshold = {INT32_MAX, INT32_MAX, inputIter.outputFormat};
+                std::vector<AvailableStream> outputStreams;
+                ASSERT_EQ(Status::OK,
+                          getAvailableOutputStreams(staticMeta, outputStreams, &outputThreshold));
+                for (auto& outputIter : outputStreams) {
+                    Stream zslStream = {streamId++,
+                                        StreamType::OUTPUT,
+                                        static_cast<uint32_t>(input.width),
+                                        static_cast<uint32_t>(input.height),
+                                        static_cast<PixelFormat>(input.format),
+                                        GRALLOC_USAGE_HW_CAMERA_ZSL,
+                                        0,
+                                        StreamRotation::ROTATION_0};
+                    Stream inputStream = {streamId++,
+                                          StreamType::INPUT,
+                                          static_cast<uint32_t>(input.width),
+                                          static_cast<uint32_t>(input.height),
+                                          static_cast<PixelFormat>(input.format),
+                                          0,
+                                          0,
+                                          StreamRotation::ROTATION_0};
+                    Stream outputStream = {streamId++,
+                                           StreamType::OUTPUT,
+                                           static_cast<uint32_t>(outputIter.width),
+                                           static_cast<uint32_t>(outputIter.height),
+                                           static_cast<PixelFormat>(outputIter.format),
+                                           0,
+                                           0,
+                                           StreamRotation::ROTATION_0};
 
-                int32_t streamId = 0;
-                for (auto &inputIter : inputOutputMap) {
-                    AvailableStream input;
-                    ASSERT_EQ(Status::OK,
-                            findLargestSize(inputStreams, inputIter.inputFormat, input));
-                    ASSERT_NE(0u, inputStreams.size());
-
-                    AvailableStream outputThreshold = {INT32_MAX, INT32_MAX,
-                            inputIter.outputFormat};
-                    std::vector<AvailableStream> outputStreams;
-                    ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                            outputStreams, &outputThreshold));
-                    for (auto &outputIter : outputStreams) {
-                        Stream zslStream = {streamId++, StreamType::OUTPUT,
-                                static_cast<uint32_t> (input.width),
-                                static_cast<uint32_t> (input.height),
-                                static_cast<PixelFormat> (input.format),
-                                GRALLOC_USAGE_HW_CAMERA_ZSL, 0,
-                                StreamRotation::ROTATION_0};
-                        Stream inputStream = {streamId++, StreamType::INPUT,
-                                static_cast<uint32_t> (input.width),
-                                static_cast<uint32_t> (input.height),
-                                static_cast<PixelFormat> (input.format), 0, 0,
-                                StreamRotation::ROTATION_0};
-                        Stream outputStream = {streamId++, StreamType::OUTPUT,
-                                static_cast<uint32_t> (outputIter.width),
-                                static_cast<uint32_t> (outputIter.height),
-                                static_cast<PixelFormat> (outputIter.format), 0, 0,
-                                StreamRotation::ROTATION_0};
-
-                        ::android::hardware::hidl_vec<Stream> streams = {
-                                inputStream, zslStream, outputStream};
-                        StreamConfiguration config = {streams,
-                                StreamConfigurationMode::NORMAL_MODE};
-                        ret = session->configureStreams(config,
+                    ::android::hardware::hidl_vec<Stream> streams = {inputStream, zslStream,
+                                                                     outputStream};
+                    StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE};
+                    ret = session->configureStreams(config,
                                                     [](Status s, HalStreamConfiguration halConfig) {
                                                         ASSERT_EQ(Status::OK, s);
                                                         ASSERT_EQ(3u, halConfig.streams.size());
                                                     });
-                        ASSERT_TRUE(ret.isOk());
-                    }
+                    ASSERT_TRUE(ret.isOk());
                 }
-
-                free_camera_metadata(staticMeta);
-                ret = session->close();
-                ASSERT_TRUE(ret.isOk());
             }
+
+            free_camera_metadata(staticMeta);
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2644,65 +2394,63 @@
 // Verify that all supported preview + still capture stream combinations
 // can be configured successfully.
 TEST_F(CameraHidlTest, configureStreamsPreviewStillOutputs) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputBlobStreams;
-        std::vector<AvailableStream> outputPreviewStreams;
-        AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
-                static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
-        AvailableStream blobThreshold = {INT32_MAX, INT32_MAX,
-                static_cast<int32_t>(PixelFormat::BLOB)};
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputBlobStreams;
+    std::vector<AvailableStream> outputPreviewStreams;
+    AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+                                        static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
+    AvailableStream blobThreshold = {INT32_MAX, INT32_MAX, static_cast<int32_t>(PixelFormat::BLOB)};
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                camera_metadata_t *staticMeta;
-                Return<void> ret;
-                sp<ICameraDeviceSession> session;
-                openEmptyDeviceSession(name, provider.second, &session /*out*/,
-                        &staticMeta /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            camera_metadata_t* staticMeta;
+            Return<void> ret;
+            sp<ICameraDeviceSession> session;
+            openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/);
 
-                outputBlobStreams.clear();
-                ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                        outputBlobStreams, &blobThreshold));
-                ASSERT_NE(0u, outputBlobStreams.size());
+            outputBlobStreams.clear();
+            ASSERT_EQ(Status::OK,
+                      getAvailableOutputStreams(staticMeta, outputBlobStreams, &blobThreshold));
+            ASSERT_NE(0u, outputBlobStreams.size());
 
-                outputPreviewStreams.clear();
-                ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                        outputPreviewStreams, &previewThreshold));
-                ASSERT_NE(0u, outputPreviewStreams.size());
+            outputPreviewStreams.clear();
+            ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputPreviewStreams,
+                                                            &previewThreshold));
+            ASSERT_NE(0u, outputPreviewStreams.size());
 
-                int32_t streamId = 0;
-                for (auto &blobIter : outputBlobStreams) {
-                    for (auto &previewIter : outputPreviewStreams) {
-                        Stream previewStream = {streamId++, StreamType::OUTPUT,
-                                static_cast<uint32_t> (previewIter.width),
-                                static_cast<uint32_t> (previewIter.height),
-                                static_cast<PixelFormat> (previewIter.format), 0, 0,
-                                StreamRotation::ROTATION_0};
-                        Stream blobStream = {streamId++, StreamType::OUTPUT,
-                                static_cast<uint32_t> (blobIter.width),
-                                static_cast<uint32_t> (blobIter.height),
-                                static_cast<PixelFormat> (blobIter.format), 0, 0,
-                                StreamRotation::ROTATION_0};
-                        ::android::hardware::hidl_vec<Stream> streams = {
-                                previewStream, blobStream};
-                        StreamConfiguration config = {streams,
-                                StreamConfigurationMode::NORMAL_MODE};
-                        ret = session->configureStreams(config,
+            int32_t streamId = 0;
+            for (auto& blobIter : outputBlobStreams) {
+                for (auto& previewIter : outputPreviewStreams) {
+                    Stream previewStream = {streamId++,
+                                            StreamType::OUTPUT,
+                                            static_cast<uint32_t>(previewIter.width),
+                                            static_cast<uint32_t>(previewIter.height),
+                                            static_cast<PixelFormat>(previewIter.format),
+                                            0,
+                                            0,
+                                            StreamRotation::ROTATION_0};
+                    Stream blobStream = {streamId++,
+                                         StreamType::OUTPUT,
+                                         static_cast<uint32_t>(blobIter.width),
+                                         static_cast<uint32_t>(blobIter.height),
+                                         static_cast<PixelFormat>(blobIter.format),
+                                         0,
+                                         0,
+                                         StreamRotation::ROTATION_0};
+                    ::android::hardware::hidl_vec<Stream> streams = {previewStream, blobStream};
+                    StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE};
+                    ret = session->configureStreams(config,
                                                     [](Status s, HalStreamConfiguration halConfig) {
                                                         ASSERT_EQ(Status::OK, s);
                                                         ASSERT_EQ(2u, halConfig.streams.size());
                                                     });
-                        ASSERT_TRUE(ret.isOk());
-                    }
+                    ASSERT_TRUE(ret.isOk());
                 }
-
-                free_camera_metadata(staticMeta);
-                ret = session->close();
-                ASSERT_TRUE(ret.isOk());
             }
+
+            free_camera_metadata(staticMeta);
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2711,95 +2459,95 @@
 // configured. Additionally check for common invalid inputs when
 // using this mode.
 TEST_F(CameraHidlTest, configureStreamsConstrainedOutputs) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                camera_metadata_t *staticMeta;
-                Return<void> ret;
-                sp<ICameraDeviceSession> session;
-                openEmptyDeviceSession(name, provider.second, &session /*out*/,
-                        &staticMeta /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            camera_metadata_t* staticMeta;
+            Return<void> ret;
+            sp<ICameraDeviceSession> session;
+            openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/);
 
-                Status rc = isConstrainedModeAvailable(staticMeta);
-                if (Status::METHOD_NOT_SUPPORTED == rc) {
-                    ret = session->close();
-                    ASSERT_TRUE(ret.isOk());
-                    continue;
-                }
-                ASSERT_EQ(Status::OK, rc);
-
-                AvailableStream hfrStream;
-                rc = pickConstrainedModeSize(staticMeta, hfrStream);
-                ASSERT_EQ(Status::OK, rc);
-
-                int32_t streamId = 0;
-                Stream stream = {streamId, StreamType::OUTPUT,
-                        static_cast<uint32_t> (hfrStream.width),
-                        static_cast<uint32_t> (hfrStream.height),
-                        static_cast<PixelFormat> (hfrStream.format), 0, 0,
-                        StreamRotation::ROTATION_0};
-                ::android::hardware::hidl_vec<Stream> streams = {stream};
-                StreamConfiguration config = {streams,
-                        StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
-                ret = session->configureStreams(config, [streamId] (Status s,
-                        HalStreamConfiguration halConfig) {
-                    ASSERT_EQ(Status::OK, s);
-                    ASSERT_EQ(1u, halConfig.streams.size());
-                    ASSERT_EQ(halConfig.streams[0].id, streamId);
-                });
-                ASSERT_TRUE(ret.isOk());
-
-                stream = {streamId++, StreamType::OUTPUT,
-                        static_cast<uint32_t> (0),
-                        static_cast<uint32_t> (0),
-                        static_cast<PixelFormat> (hfrStream.format), 0, 0,
-                        StreamRotation::ROTATION_0};
-                streams[0] = stream;
-                config = {streams,
-                        StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
-                ret = session->configureStreams(config, [] (Status s,
-                        HalStreamConfiguration) {
-                    ASSERT_TRUE((Status::ILLEGAL_ARGUMENT == s) ||
-                                (Status::INTERNAL_ERROR == s));
-                });
-                ASSERT_TRUE(ret.isOk());
-
-                stream = {streamId++, StreamType::OUTPUT,
-                        static_cast<uint32_t> (UINT32_MAX),
-                        static_cast<uint32_t> (UINT32_MAX),
-                        static_cast<PixelFormat> (hfrStream.format), 0, 0,
-                        StreamRotation::ROTATION_0};
-                streams[0] = stream;
-                config = {streams,
-                        StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
-                ret = session->configureStreams(config, [] (Status s,
-                        HalStreamConfiguration) {
-                    ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
-                });
-                ASSERT_TRUE(ret.isOk());
-
-                stream = {streamId++, StreamType::OUTPUT,
-                        static_cast<uint32_t> (hfrStream.width),
-                        static_cast<uint32_t> (hfrStream.height),
-                        static_cast<PixelFormat> (UINT32_MAX), 0, 0,
-                        StreamRotation::ROTATION_0};
-                streams[0] = stream;
-                config = {streams,
-                        StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
-                ret = session->configureStreams(config, [] (Status s,
-                        HalStreamConfiguration) {
-                    ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
-                });
-                ASSERT_TRUE(ret.isOk());
-
-                free_camera_metadata(staticMeta);
+            Status rc = isConstrainedModeAvailable(staticMeta);
+            if (Status::METHOD_NOT_SUPPORTED == rc) {
                 ret = session->close();
                 ASSERT_TRUE(ret.isOk());
+                continue;
             }
+            ASSERT_EQ(Status::OK, rc);
+
+            AvailableStream hfrStream;
+            rc = pickConstrainedModeSize(staticMeta, hfrStream);
+            ASSERT_EQ(Status::OK, rc);
+
+            int32_t streamId = 0;
+            Stream stream = {streamId,
+                             StreamType::OUTPUT,
+                             static_cast<uint32_t>(hfrStream.width),
+                             static_cast<uint32_t>(hfrStream.height),
+                             static_cast<PixelFormat>(hfrStream.format),
+                             0,
+                             0,
+                             StreamRotation::ROTATION_0};
+            ::android::hardware::hidl_vec<Stream> streams = {stream};
+            StreamConfiguration config = {streams,
+                                          StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
+            ret = session->configureStreams(config,
+                                            [streamId](Status s, HalStreamConfiguration halConfig) {
+                                                ASSERT_EQ(Status::OK, s);
+                                                ASSERT_EQ(1u, halConfig.streams.size());
+                                                ASSERT_EQ(halConfig.streams[0].id, streamId);
+                                            });
+            ASSERT_TRUE(ret.isOk());
+
+            stream = {streamId++,
+                      StreamType::OUTPUT,
+                      static_cast<uint32_t>(0),
+                      static_cast<uint32_t>(0),
+                      static_cast<PixelFormat>(hfrStream.format),
+                      0,
+                      0,
+                      StreamRotation::ROTATION_0};
+            streams[0] = stream;
+            config = {streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
+            ret = session->configureStreams(config, [](Status s, HalStreamConfiguration) {
+                ASSERT_TRUE((Status::ILLEGAL_ARGUMENT == s) || (Status::INTERNAL_ERROR == s));
+            });
+            ASSERT_TRUE(ret.isOk());
+
+            stream = {streamId++,
+                      StreamType::OUTPUT,
+                      static_cast<uint32_t>(UINT32_MAX),
+                      static_cast<uint32_t>(UINT32_MAX),
+                      static_cast<PixelFormat>(hfrStream.format),
+                      0,
+                      0,
+                      StreamRotation::ROTATION_0};
+            streams[0] = stream;
+            config = {streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
+            ret = session->configureStreams(config, [](Status s, HalStreamConfiguration) {
+                ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
+            });
+            ASSERT_TRUE(ret.isOk());
+
+            stream = {streamId++,
+                      StreamType::OUTPUT,
+                      static_cast<uint32_t>(hfrStream.width),
+                      static_cast<uint32_t>(hfrStream.height),
+                      static_cast<PixelFormat>(UINT32_MAX),
+                      0,
+                      0,
+                      StreamRotation::ROTATION_0};
+            streams[0] = stream;
+            config = {streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE};
+            ret = session->configureStreams(config, [](Status s, HalStreamConfiguration) {
+                ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
+            });
+            ASSERT_TRUE(ret.isOk());
+
+            free_camera_metadata(staticMeta);
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -2807,96 +2555,91 @@
 // Verify that all supported video + snapshot stream combinations can
 // be configured successfully.
 TEST_F(CameraHidlTest, configureStreamsVideoStillOutputs) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputBlobStreams;
-        std::vector<AvailableStream> outputVideoStreams;
-        AvailableStream videoThreshold = {kMaxVideoWidth, kMaxVideoHeight,
-                static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
-        AvailableStream blobThreshold = {kMaxVideoWidth, kMaxVideoHeight,
-                static_cast<int32_t>(PixelFormat::BLOB)};
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputBlobStreams;
+    std::vector<AvailableStream> outputVideoStreams;
+    AvailableStream videoThreshold = {kMaxVideoWidth, kMaxVideoHeight,
+                                      static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
+    AvailableStream blobThreshold = {kMaxVideoWidth, kMaxVideoHeight,
+                                     static_cast<int32_t>(PixelFormat::BLOB)};
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                camera_metadata_t *staticMeta;
-                Return<void> ret;
-                sp<ICameraDeviceSession> session;
-                openEmptyDeviceSession(name, provider.second, &session /*out*/,
-                        &staticMeta /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            camera_metadata_t* staticMeta;
+            Return<void> ret;
+            sp<ICameraDeviceSession> session;
+            openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/);
 
-                outputBlobStreams.clear();
-                ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                        outputBlobStreams, &blobThreshold));
-                ASSERT_NE(0u, outputBlobStreams.size());
+            outputBlobStreams.clear();
+            ASSERT_EQ(Status::OK,
+                      getAvailableOutputStreams(staticMeta, outputBlobStreams, &blobThreshold));
+            ASSERT_NE(0u, outputBlobStreams.size());
 
-                outputVideoStreams.clear();
-                ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta,
-                        outputVideoStreams, &videoThreshold));
-                ASSERT_NE(0u, outputVideoStreams.size());
+            outputVideoStreams.clear();
+            ASSERT_EQ(Status::OK,
+                      getAvailableOutputStreams(staticMeta, outputVideoStreams, &videoThreshold));
+            ASSERT_NE(0u, outputVideoStreams.size());
 
-                int32_t streamId = 0;
-                for (auto &blobIter : outputBlobStreams) {
-                    for (auto &videoIter : outputVideoStreams) {
-                        Stream videoStream = {streamId++, StreamType::OUTPUT,
-                                static_cast<uint32_t> (videoIter.width),
-                                static_cast<uint32_t> (videoIter.height),
-                                static_cast<PixelFormat> (videoIter.format),
-                                0, 0, StreamRotation::ROTATION_0};
-                        Stream blobStream = {streamId++, StreamType::OUTPUT,
-                                static_cast<uint32_t> (blobIter.width),
-                                static_cast<uint32_t> (blobIter.height),
-                                static_cast<PixelFormat> (blobIter.format),
-                                GRALLOC_USAGE_HW_VIDEO_ENCODER, 0,
-                                StreamRotation::ROTATION_0};
-                        ::android::hardware::hidl_vec<Stream> streams = {
-                                videoStream, blobStream};
-                        StreamConfiguration config = {streams,
-                                StreamConfigurationMode::NORMAL_MODE};
-                        ret = session->configureStreams(config,
+            int32_t streamId = 0;
+            for (auto& blobIter : outputBlobStreams) {
+                for (auto& videoIter : outputVideoStreams) {
+                    Stream videoStream = {streamId++,
+                                          StreamType::OUTPUT,
+                                          static_cast<uint32_t>(videoIter.width),
+                                          static_cast<uint32_t>(videoIter.height),
+                                          static_cast<PixelFormat>(videoIter.format),
+                                          0,
+                                          0,
+                                          StreamRotation::ROTATION_0};
+                    Stream blobStream = {streamId++,
+                                         StreamType::OUTPUT,
+                                         static_cast<uint32_t>(blobIter.width),
+                                         static_cast<uint32_t>(blobIter.height),
+                                         static_cast<PixelFormat>(blobIter.format),
+                                         GRALLOC_USAGE_HW_VIDEO_ENCODER,
+                                         0,
+                                         StreamRotation::ROTATION_0};
+                    ::android::hardware::hidl_vec<Stream> streams = {videoStream, blobStream};
+                    StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE};
+                    ret = session->configureStreams(config,
                                                     [](Status s, HalStreamConfiguration halConfig) {
                                                         ASSERT_EQ(Status::OK, s);
                                                         ASSERT_EQ(2u, halConfig.streams.size());
                                                     });
-                        ASSERT_TRUE(ret.isOk());
-                    }
+                    ASSERT_TRUE(ret.isOk());
                 }
-
-                free_camera_metadata(staticMeta);
-                ret = session->close();
-                ASSERT_TRUE(ret.isOk());
             }
+
+            free_camera_metadata(staticMeta);
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
 
 // Generate and verify a camera capture request
 TEST_F(CameraHidlTest, processCaptureRequestPreview) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
-                static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
-        uint64_t bufferId = 1;
-        uint32_t frameNumber = 1;
-        ::android::hardware::hidl_vec<uint8_t> settings;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+                                        static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
+    uint64_t bufferId = 1;
+    uint32_t frameNumber = 1;
+    ::android::hardware::hidl_vec<uint8_t> settings;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                Stream previewStream;
-                HalStreamConfiguration halStreamConfig;
-                sp<ICameraDeviceSession> session;
-                bool supportsPartialResults = false;
-                uint32_t partialResultCount = 0;
-                configurePreviewStream(name, provider.second, &previewThreshold,
-                        &session /*out*/, &previewStream /*out*/,
-                        &halStreamConfig /*out*/, &supportsPartialResults /*out*/,
-                        &partialResultCount/*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            Stream previewStream;
+            HalStreamConfiguration halStreamConfig;
+            sp<ICameraDeviceSession> session;
+            bool supportsPartialResults = false;
+            uint32_t partialResultCount = 0;
+            configurePreviewStream(name, mProvider, &previewThreshold, &session /*out*/,
+                                   &previewStream /*out*/, &halStreamConfig /*out*/,
+                                   &supportsPartialResults /*out*/, &partialResultCount /*out*/);
 
-                std::shared_ptr<ResultMetadataQueue> resultQueue;
-                auto resultQueueRet = session->getCaptureResultMetadataQueue(
+            std::shared_ptr<ResultMetadataQueue> resultQueue;
+            auto resultQueueRet =
+                session->getCaptureResultMetadataQueue(
                     [&resultQueue](const auto& descriptor) {
                         resultQueue = std::make_shared<ResultMetadataQueue>(
                                 descriptor);
@@ -2908,114 +2651,103 @@
                             // Don't use the queue onwards.
                         }
                     });
-                ASSERT_TRUE(resultQueueRet.isOk());
-                ASSERT_NE(nullptr, resultQueue);
+            ASSERT_TRUE(resultQueueRet.isOk());
+            ASSERT_NE(nullptr, resultQueue);
 
-                InFlightRequest inflightReq = {1, false, supportsPartialResults,
-                        partialResultCount, resultQueue};
+            InFlightRequest inflightReq = {1, false, supportsPartialResults, partialResultCount,
+                                           resultQueue};
 
-                RequestTemplate reqTemplate = RequestTemplate::PREVIEW;
-                Return<void> ret;
-                ret = session->constructDefaultRequestSettings(reqTemplate,
-                    [&](auto status, const auto& req) {
-                        ASSERT_EQ(Status::OK, status);
-                        settings = req; });
-                ASSERT_TRUE(ret.isOk());
+            RequestTemplate reqTemplate = RequestTemplate::PREVIEW;
+            Return<void> ret;
+            ret = session->constructDefaultRequestSettings(reqTemplate,
+                                                           [&](auto status, const auto& req) {
+                                                               ASSERT_EQ(Status::OK, status);
+                                                               settings = req;
+                                                           });
+            ASSERT_TRUE(ret.isOk());
 
-                sp<GraphicBuffer> gb = new GraphicBuffer(
-                    previewStream.width, previewStream.height,
-                    static_cast<int32_t>(halStreamConfig.streams[0].overrideFormat),
-                    1, android_convertGralloc1To0Usage(
-                           halStreamConfig.streams[0].producerUsage,
-                           halStreamConfig.streams[0].consumerUsage));
-                ASSERT_NE(nullptr, gb.get());
-                StreamBuffer outputBuffer = {halStreamConfig.streams[0].id,
-                        bufferId, hidl_handle(gb->getNativeBuffer()->handle),
-                        BufferStatus::OK, nullptr, nullptr};
-                ::android::hardware::hidl_vec<StreamBuffer> outputBuffers = {
-                        outputBuffer};
-                StreamBuffer emptyInputBuffer = {-1, 0, nullptr,
-                        BufferStatus::ERROR, nullptr, nullptr};
-                CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */,
-                        settings, emptyInputBuffer, outputBuffers};
+            sp<GraphicBuffer> gb = new GraphicBuffer(
+                previewStream.width, previewStream.height,
+                static_cast<int32_t>(halStreamConfig.streams[0].overrideFormat), 1,
+                android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage,
+                                                halStreamConfig.streams[0].consumerUsage));
+            ASSERT_NE(nullptr, gb.get());
+            StreamBuffer outputBuffer = {halStreamConfig.streams[0].id,
+                                         bufferId,
+                                         hidl_handle(gb->getNativeBuffer()->handle),
+                                         BufferStatus::OK,
+                                         nullptr,
+                                         nullptr};
+            ::android::hardware::hidl_vec<StreamBuffer> outputBuffers = {outputBuffer};
+            StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr};
+            CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings,
+                                      emptyInputBuffer, outputBuffers};
 
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    mInflightMap.clear();
-                    mInflightMap.add(frameNumber, &inflightReq);
-                }
-
-                Status status = Status::INTERNAL_ERROR;
-                uint32_t numRequestProcessed = 0;
-                hidl_vec<BufferCache> cachesToRemove;
-                Return<void> returnStatus = session->processCaptureRequest(
-                        {request},
-                        cachesToRemove,
-                        [&status, &numRequestProcessed] (auto s, uint32_t n) {
-                            status = s;
-                            numRequestProcessed = n;
-                        });
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, status);
-                ASSERT_EQ(numRequestProcessed, 1u);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    while (!inflightReq.errorCodeValid &&
-                            ((0 < inflightReq.numBuffersLeft) ||
-                                    (!inflightReq.haveResultMetadata))) {
-                        auto timeout = std::chrono::system_clock::now() +
-                                std::chrono::seconds(kStreamBufferTimeoutSec);
-                        ASSERT_NE(std::cv_status::timeout,
-                                mResultCondition.wait_until(l, timeout));
-                    }
-
-                    ASSERT_FALSE(inflightReq.errorCodeValid);
-                    ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
-                    ASSERT_EQ(previewStream.id,
-                              inflightReq.resultOutputBuffers[0].streamId);
-
-                    request.frameNumber++;
-                    //Empty settings should be supported after the first call
-                    //for repeating requests.
-                    request.settings.setToExternal(nullptr, 0, true);
-                    mInflightMap.clear();
-                    inflightReq = {1, false, supportsPartialResults,
-                                        partialResultCount, resultQueue};
-                    mInflightMap.add(request.frameNumber, &inflightReq);
-                }
-
-                returnStatus = session->processCaptureRequest(
-                        {request},
-                        cachesToRemove,
-                        [&status, &numRequestProcessed] (auto s, uint32_t n) {
-                            status = s;
-                            numRequestProcessed = n;
-                        });
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, status);
-                ASSERT_EQ(numRequestProcessed, 1u);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    while (!inflightReq.errorCodeValid &&
-                            ((0 < inflightReq.numBuffersLeft) ||
-                                    (!inflightReq.haveResultMetadata))) {
-                        auto timeout = std::chrono::system_clock::now() +
-                                std::chrono::seconds(kStreamBufferTimeoutSec);
-                        ASSERT_NE(std::cv_status::timeout,
-                                mResultCondition.wait_until(l, timeout));
-                    }
-
-                    ASSERT_FALSE(inflightReq.errorCodeValid);
-                    ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
-                    ASSERT_EQ(previewStream.id,
-                              inflightReq.resultOutputBuffers[0].streamId);
-                }
-
-                ret = session->close();
-                ASSERT_TRUE(ret.isOk());
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                mInflightMap.clear();
+                mInflightMap.add(frameNumber, &inflightReq);
             }
+
+            Status status = Status::INTERNAL_ERROR;
+            uint32_t numRequestProcessed = 0;
+            hidl_vec<BufferCache> cachesToRemove;
+            Return<void> returnStatus = session->processCaptureRequest(
+                {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) {
+                    status = s;
+                    numRequestProcessed = n;
+                });
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, status);
+            ASSERT_EQ(numRequestProcessed, 1u);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                while (!inflightReq.errorCodeValid &&
+                       ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) {
+                    auto timeout = std::chrono::system_clock::now() +
+                                   std::chrono::seconds(kStreamBufferTimeoutSec);
+                    ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
+                }
+
+                ASSERT_FALSE(inflightReq.errorCodeValid);
+                ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
+                ASSERT_EQ(previewStream.id, inflightReq.resultOutputBuffers[0].streamId);
+
+                request.frameNumber++;
+                // Empty settings should be supported after the first call
+                // for repeating requests.
+                request.settings.setToExternal(nullptr, 0, true);
+                mInflightMap.clear();
+                inflightReq = {1, false, supportsPartialResults, partialResultCount, resultQueue};
+                mInflightMap.add(request.frameNumber, &inflightReq);
+            }
+
+            returnStatus = session->processCaptureRequest(
+                {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) {
+                    status = s;
+                    numRequestProcessed = n;
+                });
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, status);
+            ASSERT_EQ(numRequestProcessed, 1u);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                while (!inflightReq.errorCodeValid &&
+                       ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) {
+                    auto timeout = std::chrono::system_clock::now() +
+                                   std::chrono::seconds(kStreamBufferTimeoutSec);
+                    ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
+                }
+
+                ASSERT_FALSE(inflightReq.errorCodeValid);
+                ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
+                ASSERT_EQ(previewStream.id, inflightReq.resultOutputBuffers[0].streamId);
+            }
+
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -3023,64 +2755,57 @@
 // Test whether an incorrect capture request with missing settings will
 // be reported correctly.
 TEST_F(CameraHidlTest, processCaptureRequestInvalidSinglePreview) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputPreviewStreams;
-        AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
-                static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
-        uint64_t bufferId = 1;
-        uint32_t frameNumber = 1;
-        ::android::hardware::hidl_vec<uint8_t> settings;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputPreviewStreams;
+    AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+                                        static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
+    uint64_t bufferId = 1;
+    uint32_t frameNumber = 1;
+    ::android::hardware::hidl_vec<uint8_t> settings;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                Stream previewStream;
-                HalStreamConfiguration halStreamConfig;
-                sp<ICameraDeviceSession> session;
-                bool supportsPartialResults = false;
-                uint32_t partialResultCount = 0;
-                configurePreviewStream(name, provider.second, &previewThreshold,
-                        &session /*out*/, &previewStream /*out*/,
-                        &halStreamConfig /*out*/, &supportsPartialResults /*out*/,
-                        &partialResultCount /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            Stream previewStream;
+            HalStreamConfiguration halStreamConfig;
+            sp<ICameraDeviceSession> session;
+            bool supportsPartialResults = false;
+            uint32_t partialResultCount = 0;
+            configurePreviewStream(name, mProvider, &previewThreshold, &session /*out*/,
+                                   &previewStream /*out*/, &halStreamConfig /*out*/,
+                                   &supportsPartialResults /*out*/, &partialResultCount /*out*/);
 
-                sp<GraphicBuffer> gb = new GraphicBuffer(
-                    previewStream.width, previewStream.height,
-                    static_cast<int32_t>(halStreamConfig.streams[0].overrideFormat),
-                    1, android_convertGralloc1To0Usage(
-                           halStreamConfig.streams[0].producerUsage,
-                           halStreamConfig.streams[0].consumerUsage));
+            sp<GraphicBuffer> gb = new GraphicBuffer(
+                previewStream.width, previewStream.height,
+                static_cast<int32_t>(halStreamConfig.streams[0].overrideFormat), 1,
+                android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage,
+                                                halStreamConfig.streams[0].consumerUsage));
 
-                StreamBuffer outputBuffer = {halStreamConfig.streams[0].id,
-                        bufferId, hidl_handle(gb->getNativeBuffer()->handle),
-                        BufferStatus::OK, nullptr, nullptr};
-                ::android::hardware::hidl_vec<StreamBuffer> outputBuffers = {
-                        outputBuffer};
-                StreamBuffer emptyInputBuffer = {-1, 0, nullptr,
-                        BufferStatus::ERROR, nullptr, nullptr};
-                CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings,
-                        emptyInputBuffer, outputBuffers};
+            StreamBuffer outputBuffer = {halStreamConfig.streams[0].id,
+                                         bufferId,
+                                         hidl_handle(gb->getNativeBuffer()->handle),
+                                         BufferStatus::OK,
+                                         nullptr,
+                                         nullptr};
+            ::android::hardware::hidl_vec<StreamBuffer> outputBuffers = {outputBuffer};
+            StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr};
+            CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings,
+                                      emptyInputBuffer, outputBuffers};
 
-                //Settings were not correctly initialized, we should fail here
-                Status status = Status::OK;
-                uint32_t numRequestProcessed = 0;
-                hidl_vec<BufferCache> cachesToRemove;
-                Return<void> ret = session->processCaptureRequest(
-                        {request},
-                        cachesToRemove,
-                        [&status, &numRequestProcessed] (auto s, uint32_t n) {
-                            status = s;
-                            numRequestProcessed = n;
-                        });
-                ASSERT_TRUE(ret.isOk());
-                ASSERT_EQ(Status::INTERNAL_ERROR, status);
-                ASSERT_EQ(numRequestProcessed, 0u);
+            // Settings were not correctly initialized, we should fail here
+            Status status = Status::OK;
+            uint32_t numRequestProcessed = 0;
+            hidl_vec<BufferCache> cachesToRemove;
+            Return<void> ret = session->processCaptureRequest(
+                {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) {
+                    status = s;
+                    numRequestProcessed = n;
+                });
+            ASSERT_TRUE(ret.isOk());
+            ASSERT_EQ(Status::INTERNAL_ERROR, status);
+            ASSERT_EQ(numRequestProcessed, 0u);
 
-                ret = session->close();
-                ASSERT_TRUE(ret.isOk());
-            }
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -3088,91 +2813,81 @@
 // Check whether an invalid capture request with missing output buffers
 // will be reported correctly.
 TEST_F(CameraHidlTest, processCaptureRequestInvalidBuffer) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputBlobStreams;
-        AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
-                static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
-        uint32_t frameNumber = 1;
-        ::android::hardware::hidl_vec<uint8_t> settings;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputBlobStreams;
+    AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+                                        static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
+    uint32_t frameNumber = 1;
+    ::android::hardware::hidl_vec<uint8_t> settings;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                Stream previewStream;
-                HalStreamConfiguration halStreamConfig;
-                sp<ICameraDeviceSession> session;
-                bool supportsPartialResults = false;
-                uint32_t partialResultCount = 0;
-                configurePreviewStream(name, provider.second, &previewThreshold,
-                        &session /*out*/, &previewStream /*out*/,
-                        &halStreamConfig /*out*/, &supportsPartialResults/*out*/,
-                        &partialResultCount /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            Stream previewStream;
+            HalStreamConfiguration halStreamConfig;
+            sp<ICameraDeviceSession> session;
+            bool supportsPartialResults = false;
+            uint32_t partialResultCount = 0;
+            configurePreviewStream(name, mProvider, &previewThreshold, &session /*out*/,
+                                   &previewStream /*out*/, &halStreamConfig /*out*/,
+                                   &supportsPartialResults /*out*/, &partialResultCount /*out*/);
 
-                RequestTemplate reqTemplate = RequestTemplate::PREVIEW;
-                Return<void> ret;
-                ret = session->constructDefaultRequestSettings(reqTemplate,
-                    [&](auto status, const auto& req) {
-                        ASSERT_EQ(Status::OK, status);
-                        settings = req; });
-                ASSERT_TRUE(ret.isOk());
+            RequestTemplate reqTemplate = RequestTemplate::PREVIEW;
+            Return<void> ret;
+            ret = session->constructDefaultRequestSettings(reqTemplate,
+                                                           [&](auto status, const auto& req) {
+                                                               ASSERT_EQ(Status::OK, status);
+                                                               settings = req;
+                                                           });
+            ASSERT_TRUE(ret.isOk());
 
-                ::android::hardware::hidl_vec<StreamBuffer> emptyOutputBuffers;
-                StreamBuffer emptyInputBuffer = {-1, 0, nullptr,
-                        BufferStatus::ERROR, nullptr, nullptr};
-                CaptureRequest request = {frameNumber, 0/* fmqSettingsSize */,
-                        settings, emptyInputBuffer, emptyOutputBuffers};
+            ::android::hardware::hidl_vec<StreamBuffer> emptyOutputBuffers;
+            StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr};
+            CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings,
+                                      emptyInputBuffer, emptyOutputBuffers};
 
-                //Output buffers are missing, we should fail here
-                Status status = Status::OK;
-                uint32_t numRequestProcessed = 0;
-                hidl_vec<BufferCache> cachesToRemove;
-                ret = session->processCaptureRequest(
-                        {request},
-                        cachesToRemove,
-                        [&status, &numRequestProcessed] (auto s, uint32_t n) {
-                            status = s;
-                            numRequestProcessed = n;
-                        });
-                ASSERT_TRUE(ret.isOk());
-                ASSERT_EQ(Status::INTERNAL_ERROR, status);
-                ASSERT_EQ(numRequestProcessed, 0u);
+            // Output buffers are missing, we should fail here
+            Status status = Status::OK;
+            uint32_t numRequestProcessed = 0;
+            hidl_vec<BufferCache> cachesToRemove;
+            ret = session->processCaptureRequest(
+                {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) {
+                    status = s;
+                    numRequestProcessed = n;
+                });
+            ASSERT_TRUE(ret.isOk());
+            ASSERT_EQ(Status::INTERNAL_ERROR, status);
+            ASSERT_EQ(numRequestProcessed, 0u);
 
-                ret = session->close();
-                ASSERT_TRUE(ret.isOk());
-            }
+            ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
 
 // Generate, trigger and flush a preview request
 TEST_F(CameraHidlTest, flushPreviewRequest) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputPreviewStreams;
-        AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
-                static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
-        uint64_t bufferId = 1;
-        uint32_t frameNumber = 1;
-        ::android::hardware::hidl_vec<uint8_t> settings;
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputPreviewStreams;
+    AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+                                        static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
+    uint64_t bufferId = 1;
+    uint32_t frameNumber = 1;
+    ::android::hardware::hidl_vec<uint8_t> settings;
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                Stream previewStream;
-                HalStreamConfiguration halStreamConfig;
-                sp<ICameraDeviceSession> session;
-                bool supportsPartialResults = false;
-                uint32_t partialResultCount = 0;
-                configurePreviewStream(name, provider.second, &previewThreshold,
-                        &session /*out*/, &previewStream /*out*/,
-                        &halStreamConfig /*out*/, &supportsPartialResults /*out*/,
-                        &partialResultCount /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            Stream previewStream;
+            HalStreamConfiguration halStreamConfig;
+            sp<ICameraDeviceSession> session;
+            bool supportsPartialResults = false;
+            uint32_t partialResultCount = 0;
+            configurePreviewStream(name, mProvider, &previewThreshold, &session /*out*/,
+                                   &previewStream /*out*/, &halStreamConfig /*out*/,
+                                   &supportsPartialResults /*out*/, &partialResultCount /*out*/);
 
-                std::shared_ptr<ResultMetadataQueue> resultQueue;
-                auto resultQueueRet = session->getCaptureResultMetadataQueue(
+            std::shared_ptr<ResultMetadataQueue> resultQueue;
+            auto resultQueueRet =
+                session->getCaptureResultMetadataQueue(
                     [&resultQueue](const auto& descriptor) {
                         resultQueue = std::make_shared<ResultMetadataQueue>(
                                 descriptor);
@@ -3184,93 +2899,89 @@
                             // Don't use the queue onwards.
                         }
                     });
-                ASSERT_TRUE(resultQueueRet.isOk());
-                ASSERT_NE(nullptr, resultQueue);
+            ASSERT_TRUE(resultQueueRet.isOk());
+            ASSERT_NE(nullptr, resultQueue);
 
-                InFlightRequest inflightReq = {1, false, supportsPartialResults,
-                        partialResultCount, resultQueue};
-                RequestTemplate reqTemplate = RequestTemplate::PREVIEW;
-                Return<void> ret;
-                ret = session->constructDefaultRequestSettings(reqTemplate,
-                    [&](auto status, const auto& req) {
-                        ASSERT_EQ(Status::OK, status);
-                        settings = req; });
-                ASSERT_TRUE(ret.isOk());
+            InFlightRequest inflightReq = {1, false, supportsPartialResults, partialResultCount,
+                                           resultQueue};
+            RequestTemplate reqTemplate = RequestTemplate::PREVIEW;
+            Return<void> ret;
+            ret = session->constructDefaultRequestSettings(reqTemplate,
+                                                           [&](auto status, const auto& req) {
+                                                               ASSERT_EQ(Status::OK, status);
+                                                               settings = req;
+                                                           });
+            ASSERT_TRUE(ret.isOk());
 
-                sp<GraphicBuffer> gb = new GraphicBuffer(
-                    previewStream.width, previewStream.height,
-                    static_cast<int32_t>(halStreamConfig.streams[0].overrideFormat),
-                    1, android_convertGralloc1To0Usage(
-                           halStreamConfig.streams[0].producerUsage,
-                           halStreamConfig.streams[0].consumerUsage));
-                ASSERT_NE(nullptr, gb.get());
-                StreamBuffer outputBuffer = {halStreamConfig.streams[0].id,
-                        bufferId, hidl_handle(gb->getNativeBuffer()->handle),
-                        BufferStatus::OK, nullptr, nullptr};
-                ::android::hardware::hidl_vec<StreamBuffer> outputBuffers = {
-                        outputBuffer};
-                const StreamBuffer emptyInputBuffer = {-1, 0, nullptr,
-                        BufferStatus::ERROR, nullptr, nullptr};
-                CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */,
-                        settings, emptyInputBuffer, outputBuffers};
+            sp<GraphicBuffer> gb = new GraphicBuffer(
+                previewStream.width, previewStream.height,
+                static_cast<int32_t>(halStreamConfig.streams[0].overrideFormat), 1,
+                android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage,
+                                                halStreamConfig.streams[0].consumerUsage));
+            ASSERT_NE(nullptr, gb.get());
+            StreamBuffer outputBuffer = {halStreamConfig.streams[0].id,
+                                         bufferId,
+                                         hidl_handle(gb->getNativeBuffer()->handle),
+                                         BufferStatus::OK,
+                                         nullptr,
+                                         nullptr};
+            ::android::hardware::hidl_vec<StreamBuffer> outputBuffers = {outputBuffer};
+            const StreamBuffer emptyInputBuffer = {-1,      0,      nullptr, BufferStatus::ERROR,
+                                                   nullptr, nullptr};
+            CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings,
+                                      emptyInputBuffer, outputBuffers};
 
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    mInflightMap.clear();
-                    mInflightMap.add(frameNumber, &inflightReq);
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                mInflightMap.clear();
+                mInflightMap.add(frameNumber, &inflightReq);
+            }
+
+            Status status = Status::INTERNAL_ERROR;
+            uint32_t numRequestProcessed = 0;
+            hidl_vec<BufferCache> cachesToRemove;
+            ret = session->processCaptureRequest(
+                {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) {
+                    status = s;
+                    numRequestProcessed = n;
+                });
+
+            ASSERT_TRUE(ret.isOk());
+            ASSERT_EQ(Status::OK, status);
+            ASSERT_EQ(numRequestProcessed, 1u);
+            // Flush before waiting for request to complete.
+            Return<Status> returnStatus = session->flush();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
+
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                while (!inflightReq.errorCodeValid &&
+                       ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) {
+                    auto timeout = std::chrono::system_clock::now() +
+                                   std::chrono::seconds(kStreamBufferTimeoutSec);
+                    ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
                 }
 
-                Status status = Status::INTERNAL_ERROR;
-                uint32_t numRequestProcessed = 0;
-                hidl_vec<BufferCache> cachesToRemove;
-                ret = session->processCaptureRequest(
-                        {request},
-                        cachesToRemove,
-                        [&status, &numRequestProcessed] (auto s, uint32_t n) {
-                            status = s;
-                            numRequestProcessed = n;
-                        });
-
-                ASSERT_TRUE(ret.isOk());
-                ASSERT_EQ(Status::OK, status);
-                ASSERT_EQ(numRequestProcessed, 1u);
-                //Flush before waiting for request to complete.
-                Return<Status> returnStatus = session->flush();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
-
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    while (!inflightReq.errorCodeValid &&
-                            ((0 < inflightReq.numBuffersLeft) ||
-                                    (!inflightReq.haveResultMetadata))) {
-                        auto timeout = std::chrono::system_clock::now() +
-                                std::chrono::seconds(kStreamBufferTimeoutSec);
-                        ASSERT_NE(std::cv_status::timeout,
-                                mResultCondition.wait_until(l, timeout));
+                if (!inflightReq.errorCodeValid) {
+                    ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
+                    ASSERT_EQ(previewStream.id, inflightReq.resultOutputBuffers[0].streamId);
+                } else {
+                    switch (inflightReq.errorCode) {
+                        case ErrorCode::ERROR_REQUEST:
+                        case ErrorCode::ERROR_RESULT:
+                        case ErrorCode::ERROR_BUFFER:
+                            // Expected
+                            break;
+                        case ErrorCode::ERROR_DEVICE:
+                        default:
+                            FAIL() << "Unexpected error:"
+                                   << static_cast<uint32_t>(inflightReq.errorCode);
                     }
-
-                    if (!inflightReq.errorCodeValid) {
-                        ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
-                        ASSERT_EQ(previewStream.id,
-                                  inflightReq.resultOutputBuffers[0].streamId);
-                    } else {
-                        switch (inflightReq.errorCode) {
-                            case ErrorCode::ERROR_REQUEST:
-                            case ErrorCode::ERROR_RESULT:
-                            case ErrorCode::ERROR_BUFFER:
-                                //Expected
-                                break;
-                            case ErrorCode::ERROR_DEVICE:
-                            default:
-                                FAIL() << "Unexpected error:" << static_cast<uint32_t> (
-                                        inflightReq.errorCode);
-                        }
-                    }
-
-                    ret = session->close();
-                    ASSERT_TRUE(ret.isOk());
                 }
+
+                ret = session->close();
+                ASSERT_TRUE(ret.isOk());
             }
         }
     }
@@ -3278,41 +2989,35 @@
 
 // Verify that camera flushes correctly without any pending requests.
 TEST_F(CameraHidlTest, flushEmpty) {
-    for (auto provider : CameraHidlEnvironment::Instance()->mProviders) {
-        hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(
-                provider.second);
-        std::vector<AvailableStream> outputPreviewStreams;
-        AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
-                static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
+    hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+    std::vector<AvailableStream> outputPreviewStreams;
+    AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+                                        static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
 
-        for (const auto& name : cameraDeviceNames) {
-            if (getCameraDeviceVersion(name, provider.first) ==
-                    CAMERA_DEVICE_API_VERSION_3_2) {
-                Stream previewStream;
-                HalStreamConfiguration halStreamConfig;
-                sp<ICameraDeviceSession> session;
-                bool supportsPartialResults = false;
-                uint32_t partialResultCount = 0;
-                configurePreviewStream(name, provider.second, &previewThreshold,
-                        &session /*out*/, &previewStream /*out*/,
-                        &halStreamConfig /*out*/, &supportsPartialResults /*out*/,
-                        &partialResultCount /*out*/);
+    for (const auto& name : cameraDeviceNames) {
+        if (getCameraDeviceVersion(name, mProviderType) == CAMERA_DEVICE_API_VERSION_3_2) {
+            Stream previewStream;
+            HalStreamConfiguration halStreamConfig;
+            sp<ICameraDeviceSession> session;
+            bool supportsPartialResults = false;
+            uint32_t partialResultCount = 0;
+            configurePreviewStream(name, mProvider, &previewThreshold, &session /*out*/,
+                                   &previewStream /*out*/, &halStreamConfig /*out*/,
+                                   &supportsPartialResults /*out*/, &partialResultCount /*out*/);
 
-                Return<Status> returnStatus = session->flush();
-                ASSERT_TRUE(returnStatus.isOk());
-                ASSERT_EQ(Status::OK, returnStatus);
+            Return<Status> returnStatus = session->flush();
+            ASSERT_TRUE(returnStatus.isOk());
+            ASSERT_EQ(Status::OK, returnStatus);
 
-                {
-                    std::unique_lock<std::mutex> l(mLock);
-                    auto timeout = std::chrono::system_clock::now() +
-                            std::chrono::milliseconds(kEmptyFlushTimeoutMSec);
-                    ASSERT_EQ(std::cv_status::timeout,
-                            mResultCondition.wait_until(l, timeout));
-                }
-
-                Return<void> ret = session->close();
-                ASSERT_TRUE(ret.isOk());
+            {
+                std::unique_lock<std::mutex> l(mLock);
+                auto timeout = std::chrono::system_clock::now() +
+                               std::chrono::milliseconds(kEmptyFlushTimeoutMSec);
+                ASSERT_EQ(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
             }
+
+            Return<void> ret = session->close();
+            ASSERT_TRUE(ret.isOk());
         }
     }
 }
@@ -3753,6 +3458,7 @@
 int main(int argc, char **argv) {
   ::testing::AddGlobalTestEnvironment(CameraHidlEnvironment::Instance());
   ::testing::InitGoogleTest(&argc, argv);
+  CameraHidlEnvironment::Instance()->init(&argc, argv);
   int status = RUN_ALL_TESTS();
   ALOGI("Test result = %d", status);
   return status;
diff --git a/radio/1.0/vts/functional/Android.bp b/radio/1.0/vts/functional/Android.bp
index 8cd823e..eb11b54 100644
--- a/radio/1.0/vts/functional/Android.bp
+++ b/radio/1.0/vts/functional/Android.bp
@@ -26,6 +26,7 @@
            "radio_hidl_hal_stk.cpp",
            "radio_hidl_hal_test.cpp",
            "radio_hidl_hal_voice.cpp",
+           "radio_indication.cpp",
            "radio_response.cpp",
            "VtsHalRadioV1_0TargetTest.cpp",
            "vts_test_util.cpp"],
@@ -72,29 +73,6 @@
 }
 
 cc_library_static {
-    name: "RadioHidlHalUtilsBase",
-    srcs : [
-        "radio_hidl_hal_test.cpp",
-        "radio_response.cpp"
-    ],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.radio@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-}
-
-cc_library_static {
     name: "RadioVtsTestUtilBase",
     srcs : [
         "vts_test_util.cpp"
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
index 13c23a8..864f844 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -248,7 +248,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
     }
 }
 
@@ -280,7 +281,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -345,7 +347,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -361,7 +364,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -494,7 +498,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -562,7 +567,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -651,7 +657,6 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
         ASSERT_TRUE(CheckGeneralError() ||
                     radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
                     radioRsp->rspInfo.error == RadioError::INVALID_STATE);
@@ -670,7 +675,6 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
         ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
                     radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED ||
                     radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
@@ -690,7 +694,8 @@
 
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
-                    radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED);
+                    radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -724,7 +729,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -778,7 +784,8 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -793,9 +800,11 @@
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
+    std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
+
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(CheckGeneralError() ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -810,9 +819,11 @@
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
+    std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
+
     if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(CheckGeneralError() ||
-                    radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+        ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+                    radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -828,7 +839,6 @@
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
-        std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
         ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
                     radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
index 2fa2827..5f28155 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
@@ -19,14 +19,16 @@
 void RadioHidlTest::SetUp() {
     radio =
         ::testing::VtsHalHidlTargetTestBase::getService<IRadio>(hidl_string(RADIO_SERVICE_NAME));
-    ASSERT_NE(radio, nullptr);
+    ASSERT_NE(nullptr, radio.get());
 
-    radioRsp = new RadioResponse(*this);
-    ASSERT_NE(radioRsp, nullptr);
+    radioRsp = new (std::nothrow) RadioResponse(*this);
+    ASSERT_NE(nullptr, radioRsp.get());
 
     count = 0;
 
-    radioInd = NULL;
+    radioInd = new (std::nothrow) RadioIndication(*this);
+    ASSERT_NE(nullptr, radioInd.get());
+
     radio->setResponseFunctions(radioRsp, radioInd);
 
     int serial = GetRandomSerialNumber();
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
index c126da4..b0d67da 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
+++ b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
@@ -28,53 +28,7 @@
 
 #include "vts_test_util.h"
 
-using ::android::hardware::radio::V1_0::ActivityStatsInfo;
-using ::android::hardware::radio::V1_0::AppType;
-using ::android::hardware::radio::V1_0::CardStatus;
-using ::android::hardware::radio::V1_0::CardState;
-using ::android::hardware::radio::V1_0::Call;
-using ::android::hardware::radio::V1_0::CallForwardInfo;
-using ::android::hardware::radio::V1_0::CarrierMatchType;
-using ::android::hardware::radio::V1_0::CarrierRestrictions;
-using ::android::hardware::radio::V1_0::CdmaRoamingType;
-using ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo;
-using ::android::hardware::radio::V1_0::CdmaSubscriptionSource;
-using ::android::hardware::radio::V1_0::CellInfo;
-using ::android::hardware::radio::V1_0::ClipStatus;
-using ::android::hardware::radio::V1_0::DataRegStateResult;
-using ::android::hardware::radio::V1_0::DeviceStateType;
-using ::android::hardware::radio::V1_0::Dial;
-using ::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo;
-using ::android::hardware::radio::V1_0::HardwareConfig;
-using ::android::hardware::radio::V1_0::IccIo;
-using ::android::hardware::radio::V1_0::IccIoResult;
-using ::android::hardware::radio::V1_0::IRadio;
-using ::android::hardware::radio::V1_0::IRadioResponse;
-using ::android::hardware::radio::V1_0::IRadioIndication;
-using ::android::hardware::radio::V1_0::RadioConst;
-using ::android::hardware::radio::V1_0::RadioError;
-using ::android::hardware::radio::V1_0::RadioResponseInfo;
-using ::android::hardware::radio::V1_0::LastCallFailCauseInfo;
-using ::android::hardware::radio::V1_0::LceDataInfo;
-using ::android::hardware::radio::V1_0::LceStatusInfo;
-using ::android::hardware::radio::V1_0::NeighboringCell;
-using ::android::hardware::radio::V1_0::NvItem;
-using ::android::hardware::radio::V1_0::NvWriteItem;
-using ::android::hardware::radio::V1_0::OperatorInfo;
-using ::android::hardware::radio::V1_0::PreferredNetworkType;
-using ::android::hardware::radio::V1_0::RadioBandMode;
-using ::android::hardware::radio::V1_0::RadioCapability;
-using ::android::hardware::radio::V1_0::RadioResponseType;
-using ::android::hardware::radio::V1_0::RadioTechnology;
-using ::android::hardware::radio::V1_0::RadioTechnologyFamily;
-using ::android::hardware::radio::V1_0::ResetNvType;
-using ::android::hardware::radio::V1_0::SelectUiccSub;
-using ::android::hardware::radio::V1_0::SendSmsResult;
-using ::android::hardware::radio::V1_0::SetupDataCallResult;
-using ::android::hardware::radio::V1_0::SignalStrength;
-using ::android::hardware::radio::V1_0::SimApdu;
-using ::android::hardware::radio::V1_0::TtyMode;
-using ::android::hardware::radio::V1_0::VoiceRegStateResult;
+using namespace ::android::hardware::radio::V1_0;
 
 using ::android::hardware::hidl_string;
 using ::android::hardware::hidl_vec;
@@ -440,6 +394,123 @@
     Return<void> acknowledgeRequest(int32_t serial);
 };
 
+/* Callback class for radio indication */
+class RadioIndication : public IRadioIndication {
+   protected:
+    RadioHidlTest& parent;
+
+   public:
+    RadioIndication(RadioHidlTest& parent);
+    virtual ~RadioIndication() = default;
+
+    Return<void> radioStateChanged(RadioIndicationType type, RadioState radioState);
+
+    Return<void> callStateChanged(RadioIndicationType type);
+
+    Return<void> networkStateChanged(RadioIndicationType type);
+
+    Return<void> newSms(RadioIndicationType type,
+                        const ::android::hardware::hidl_vec<uint8_t>& pdu);
+
+    Return<void> newSmsStatusReport(RadioIndicationType type,
+                                    const ::android::hardware::hidl_vec<uint8_t>& pdu);
+
+    Return<void> newSmsOnSim(RadioIndicationType type, int32_t recordNumber);
+
+    Return<void> onUssd(RadioIndicationType type, UssdModeType modeType,
+                        const ::android::hardware::hidl_string& msg);
+
+    Return<void> nitzTimeReceived(RadioIndicationType type,
+                                  const ::android::hardware::hidl_string& nitzTime,
+                                  uint64_t receivedTime);
+
+    Return<void> currentSignalStrength(RadioIndicationType type,
+                                       const SignalStrength& signalStrength);
+
+    Return<void> dataCallListChanged(
+        RadioIndicationType type, const ::android::hardware::hidl_vec<SetupDataCallResult>& dcList);
+
+    Return<void> suppSvcNotify(RadioIndicationType type, const SuppSvcNotification& suppSvc);
+
+    Return<void> stkSessionEnd(RadioIndicationType type);
+
+    Return<void> stkProactiveCommand(RadioIndicationType type,
+                                     const ::android::hardware::hidl_string& cmd);
+
+    Return<void> stkEventNotify(RadioIndicationType type,
+                                const ::android::hardware::hidl_string& cmd);
+
+    Return<void> stkCallSetup(RadioIndicationType type, int64_t timeout);
+
+    Return<void> simSmsStorageFull(RadioIndicationType type);
+
+    Return<void> simRefresh(RadioIndicationType type, const SimRefreshResult& refreshResult);
+
+    Return<void> callRing(RadioIndicationType type, bool isGsm, const CdmaSignalInfoRecord& record);
+
+    Return<void> simStatusChanged(RadioIndicationType type);
+
+    Return<void> cdmaNewSms(RadioIndicationType type, const CdmaSmsMessage& msg);
+
+    Return<void> newBroadcastSms(RadioIndicationType type,
+                                 const ::android::hardware::hidl_vec<uint8_t>& data);
+
+    Return<void> cdmaRuimSmsStorageFull(RadioIndicationType type);
+
+    Return<void> restrictedStateChanged(RadioIndicationType type, PhoneRestrictedState state);
+
+    Return<void> enterEmergencyCallbackMode(RadioIndicationType type);
+
+    Return<void> cdmaCallWaiting(RadioIndicationType type,
+                                 const CdmaCallWaiting& callWaitingRecord);
+
+    Return<void> cdmaOtaProvisionStatus(RadioIndicationType type, CdmaOtaProvisionStatus status);
+
+    Return<void> cdmaInfoRec(RadioIndicationType type, const CdmaInformationRecords& records);
+
+    Return<void> indicateRingbackTone(RadioIndicationType type, bool start);
+
+    Return<void> resendIncallMute(RadioIndicationType type);
+
+    Return<void> cdmaSubscriptionSourceChanged(RadioIndicationType type,
+                                               CdmaSubscriptionSource cdmaSource);
+
+    Return<void> cdmaPrlChanged(RadioIndicationType type, int32_t version);
+
+    Return<void> exitEmergencyCallbackMode(RadioIndicationType type);
+
+    Return<void> rilConnected(RadioIndicationType type);
+
+    Return<void> voiceRadioTechChanged(RadioIndicationType type, RadioTechnology rat);
+
+    Return<void> cellInfoList(RadioIndicationType type,
+                              const ::android::hardware::hidl_vec<CellInfo>& records);
+
+    Return<void> imsNetworkStateChanged(RadioIndicationType type);
+
+    Return<void> subscriptionStatusChanged(RadioIndicationType type, bool activate);
+
+    Return<void> srvccStateNotify(RadioIndicationType type, SrvccState state);
+
+    Return<void> hardwareConfigChanged(
+        RadioIndicationType type, const ::android::hardware::hidl_vec<HardwareConfig>& configs);
+
+    Return<void> radioCapabilityIndication(RadioIndicationType type, const RadioCapability& rc);
+
+    Return<void> onSupplementaryServiceIndication(RadioIndicationType type,
+                                                  const StkCcUnsolSsResult& ss);
+
+    Return<void> stkCallControlAlphaNotify(RadioIndicationType type,
+                                           const ::android::hardware::hidl_string& alpha);
+
+    Return<void> lceData(RadioIndicationType type, const LceDataInfo& lce);
+
+    Return<void> pcoData(RadioIndicationType type, const PcoDataInfo& pco);
+
+    Return<void> modemReset(RadioIndicationType type,
+                            const ::android::hardware::hidl_string& reason);
+};
+
 // The main test class for Radio HIDL.
 class RadioHidlTest : public ::testing::VtsHalHidlTargetTestBase {
    protected:
@@ -466,7 +537,7 @@
 
     sp<IRadio> radio;
     sp<RadioResponse> radioRsp;
-    sp<IRadioIndication> radioInd;
+    sp<RadioIndication> radioInd;
 };
 
 // A class for test environment setup
diff --git a/radio/1.0/vts/functional/radio_indication.cpp b/radio/1.0/vts/functional/radio_indication.cpp
new file mode 100644
index 0000000..97b0d26
--- /dev/null
+++ b/radio/1.0/vts/functional/radio_indication.cpp
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <radio_hidl_hal_utils_v1_0.h>
+
+RadioIndication::RadioIndication(RadioHidlTest& parent) : parent(parent) {}
+
+Return<void> RadioIndication::radioStateChanged(RadioIndicationType /*type*/,
+                                                RadioState /*radioState*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::callStateChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::networkStateChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::newSms(RadioIndicationType /*type*/,
+                                     const ::android::hardware::hidl_vec<uint8_t>& /*pdu*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::newSmsStatusReport(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_vec<uint8_t>& /*pdu*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::newSmsOnSim(RadioIndicationType /*type*/, int32_t /*recordNumber*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::onUssd(RadioIndicationType /*type*/, UssdModeType /*modeType*/,
+                                     const ::android::hardware::hidl_string& /*msg*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::nitzTimeReceived(RadioIndicationType /*type*/,
+                                               const ::android::hardware::hidl_string& /*nitzTime*/,
+                                               uint64_t /*receivedTime*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::currentSignalStrength(RadioIndicationType /*type*/,
+                                                    const SignalStrength& /*signalStrength*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::dataCallListChanged(
+    RadioIndicationType /*type*/,
+    const ::android::hardware::hidl_vec<SetupDataCallResult>& /*dcList*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::suppSvcNotify(RadioIndicationType /*type*/,
+                                            const SuppSvcNotification& /*suppSvc*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::stkSessionEnd(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::stkProactiveCommand(RadioIndicationType /*type*/,
+                                                  const ::android::hardware::hidl_string& /*cmd*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::stkEventNotify(RadioIndicationType /*type*/,
+                                             const ::android::hardware::hidl_string& /*cmd*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::stkCallSetup(RadioIndicationType /*type*/, int64_t /*timeout*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::simSmsStorageFull(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::simRefresh(RadioIndicationType /*type*/,
+                                         const SimRefreshResult& /*refreshResult*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::callRing(RadioIndicationType /*type*/, bool /*isGsm*/,
+                                       const CdmaSignalInfoRecord& /*record*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::simStatusChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cdmaNewSms(RadioIndicationType /*type*/,
+                                         const CdmaSmsMessage& /*msg*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::newBroadcastSms(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_vec<uint8_t>& /*data*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cdmaRuimSmsStorageFull(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::restrictedStateChanged(RadioIndicationType /*type*/,
+                                                     PhoneRestrictedState /*state*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::enterEmergencyCallbackMode(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cdmaCallWaiting(RadioIndicationType /*type*/,
+                                              const CdmaCallWaiting& /*callWaitingRecord*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cdmaOtaProvisionStatus(RadioIndicationType /*type*/,
+                                                     CdmaOtaProvisionStatus /*status*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cdmaInfoRec(RadioIndicationType /*type*/,
+                                          const CdmaInformationRecords& /*records*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::indicateRingbackTone(RadioIndicationType /*type*/, bool /*start*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::resendIncallMute(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cdmaSubscriptionSourceChanged(RadioIndicationType /*type*/,
+                                                            CdmaSubscriptionSource /*cdmaSource*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cdmaPrlChanged(RadioIndicationType /*type*/, int32_t /*version*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::exitEmergencyCallbackMode(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::rilConnected(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::voiceRadioTechChanged(RadioIndicationType /*type*/,
+                                                    RadioTechnology /*rat*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::cellInfoList(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_vec<CellInfo>& /*records*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::imsNetworkStateChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::subscriptionStatusChanged(RadioIndicationType /*type*/,
+                                                        bool /*activate*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::srvccStateNotify(RadioIndicationType /*type*/, SrvccState /*state*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::hardwareConfigChanged(
+    RadioIndicationType /*type*/,
+    const ::android::hardware::hidl_vec<HardwareConfig>& /*configs*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::radioCapabilityIndication(RadioIndicationType /*type*/,
+                                                        const RadioCapability& /*rc*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::onSupplementaryServiceIndication(RadioIndicationType /*type*/,
+                                                               const StkCcUnsolSsResult& /*ss*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::stkCallControlAlphaNotify(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_string& /*alpha*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::lceData(RadioIndicationType /*type*/, const LceDataInfo& /*lce*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::pcoData(RadioIndicationType /*type*/, const PcoDataInfo& /*pco*/) {
+    return Void();
+}
+
+Return<void> RadioIndication::modemReset(RadioIndicationType /*type*/,
+                                         const ::android::hardware::hidl_string& /*reason*/) {
+    return Void();
+}
\ No newline at end of file
diff --git a/radio/1.1/vts/functional/Android.bp b/radio/1.1/vts/functional/Android.bp
index 14a2544..9000eb2 100644
--- a/radio/1.1/vts/functional/Android.bp
+++ b/radio/1.1/vts/functional/Android.bp
@@ -19,6 +19,7 @@
     defaults: ["hidl_defaults"],
     srcs: ["radio_hidl_hal_api.cpp",
            "radio_hidl_hal_test.cpp",
+           "radio_indication.cpp",
            "radio_response.cpp",
            "VtsHalRadioV1_1TargetTest.cpp"],
     shared_libs: [
@@ -33,7 +34,6 @@
         "android.hardware.radio@1.0",
     ],
     static_libs: ["VtsHalHidlTargetTestBase",
-                  "RadioHidlHalUtilsBase",
                   "RadioVtsTestUtilBase"],
     header_libs: [
         "radio.util.header@1.0",
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
index 164128b..770b599 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
@@ -20,14 +20,16 @@
     radio_v1_1 =
         ::testing::VtsHalHidlTargetTestBase::getService<::android::hardware::radio::V1_1::IRadio>(
             hidl_string(RADIO_SERVICE_NAME));
-    ASSERT_NE(radio_v1_1, nullptr);
+    ASSERT_NE(nullptr, radio_v1_1.get());
 
-    radioRsp_v1_1 = new RadioResponse_v1_1(*this);
-    ASSERT_NE(radioRsp_v1_1, nullptr);
+    radioRsp_v1_1 = new (std::nothrow) RadioResponse_v1_1(*this);
+    ASSERT_NE(nullptr, radioRsp_v1_1.get());
 
     count = 0;
 
-    radioInd_v1_1 = NULL;
+    radioInd_v1_1 = new (std::nothrow) RadioIndication_v1_1(*this);
+    ASSERT_NE(nullptr, radioInd_v1_1.get());
+
     radio_v1_1->setResponseFunctions(radioRsp_v1_1, radioInd_v1_1);
 
     int serial = GetRandomSerialNumber();
@@ -36,4 +38,41 @@
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
     EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
     EXPECT_EQ(RadioError::NONE, radioRsp_v1_1->rspInfo.error);
-}
\ No newline at end of file
+}
+
+void RadioHidlTest_v1_1::TearDown() {}
+
+void RadioHidlTest_v1_1::notify() {
+    std::unique_lock<std::mutex> lock(mtx);
+    count++;
+    cv.notify_one();
+}
+
+std::cv_status RadioHidlTest_v1_1::wait() {
+    std::unique_lock<std::mutex> lock(mtx);
+
+    std::cv_status status = std::cv_status::no_timeout;
+    auto now = std::chrono::system_clock::now();
+    while (count == 0) {
+        status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
+        if (status == std::cv_status::timeout) {
+            return status;
+        }
+    }
+    count--;
+    return status;
+}
+
+bool RadioHidlTest_v1_1::CheckGeneralError() {
+    return (radioRsp_v1_1->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
+            radioRsp_v1_1->rspInfo.error == RadioError::NO_MEMORY ||
+            radioRsp_v1_1->rspInfo.error == RadioError::INTERNAL_ERR ||
+            radioRsp_v1_1->rspInfo.error == RadioError::SYSTEM_ERR ||
+            radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
+            radioRsp_v1_1->rspInfo.error == RadioError::CANCELLED);
+}
+
+bool RadioHidlTest_v1_1::CheckOEMError() {
+    return (radioRsp_v1_1->rspInfo.error >= RadioError::OEM_ERROR_1 &&
+            radioRsp_v1_1->rspInfo.error <= RadioError::OEM_ERROR_25);
+}
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
index ae72d8f..dd4f1ef 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
+++ b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
@@ -14,26 +14,385 @@
  * limitations under the License.
  */
 
+#include <android-base/logging.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+#include <chrono>
+#include <condition_variable>
+#include <mutex>
+
 #include <android/hardware/radio/1.1/IRadio.h>
 #include <android/hardware/radio/1.1/IRadioIndication.h>
 #include <android/hardware/radio/1.1/IRadioResponse.h>
 #include <android/hardware/radio/1.1/types.h>
 
-#include "radio_hidl_hal_utils_v1_0.h"
+#include "vts_test_util.h"
 
+using namespace ::android::hardware::radio::V1_0;
 using namespace ::android::hardware::radio::V1_1;
 
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+#define TIMEOUT_PERIOD 75
+#define RADIO_SERVICE_NAME "slot1"
+
 class RadioHidlTest_v1_1;
+extern CardStatus cardStatus;
 
 /* Callback class for radio response v1_1*/
-class RadioResponse_v1_1 : public RadioResponse {
+class RadioResponse_v1_1 : public ::android::hardware::radio::V1_1::IRadioResponse {
    protected:
     RadioHidlTest_v1_1& parent_v1_1;
 
    public:
+    RadioResponseInfo rspInfo;
+    hidl_string imsi;
+    IccIoResult iccIoResult;
+    int channelId;
+
+    // Sms
+    SendSmsResult sendSmsResult;
+    hidl_string smscAddress;
+    uint32_t writeSmsToSimIndex;
+    uint32_t writeSmsToRuimIndex;
+
     RadioResponse_v1_1(RadioHidlTest_v1_1& parent_v1_1);
     virtual ~RadioResponse_v1_1() = default;
 
+    Return<void> getIccCardStatusResponse(const RadioResponseInfo& info,
+                                          const CardStatus& cardStatus);
+
+    Return<void> supplyIccPinForAppResponse(const RadioResponseInfo& info,
+                                            int32_t remainingRetries);
+
+    Return<void> supplyIccPukForAppResponse(const RadioResponseInfo& info,
+                                            int32_t remainingRetries);
+
+    Return<void> supplyIccPin2ForAppResponse(const RadioResponseInfo& info,
+                                             int32_t remainingRetries);
+
+    Return<void> supplyIccPuk2ForAppResponse(const RadioResponseInfo& info,
+                                             int32_t remainingRetries);
+
+    Return<void> changeIccPinForAppResponse(const RadioResponseInfo& info,
+                                            int32_t remainingRetries);
+
+    Return<void> changeIccPin2ForAppResponse(const RadioResponseInfo& info,
+                                             int32_t remainingRetries);
+
+    Return<void> supplyNetworkDepersonalizationResponse(const RadioResponseInfo& info,
+                                                        int32_t remainingRetries);
+
+    Return<void> getCurrentCallsResponse(const RadioResponseInfo& info,
+                                         const ::android::hardware::hidl_vec<Call>& calls);
+
+    Return<void> dialResponse(const RadioResponseInfo& info);
+
+    Return<void> getIMSIForAppResponse(const RadioResponseInfo& info,
+                                       const ::android::hardware::hidl_string& imsi);
+
+    Return<void> hangupConnectionResponse(const RadioResponseInfo& info);
+
+    Return<void> hangupWaitingOrBackgroundResponse(const RadioResponseInfo& info);
+
+    Return<void> hangupForegroundResumeBackgroundResponse(const RadioResponseInfo& info);
+
+    Return<void> switchWaitingOrHoldingAndActiveResponse(const RadioResponseInfo& info);
+
+    Return<void> conferenceResponse(const RadioResponseInfo& info);
+
+    Return<void> rejectCallResponse(const RadioResponseInfo& info);
+
+    Return<void> getLastCallFailCauseResponse(const RadioResponseInfo& info,
+                                              const LastCallFailCauseInfo& failCauseInfo);
+
+    Return<void> getSignalStrengthResponse(const RadioResponseInfo& info,
+                                           const SignalStrength& sigStrength);
+
+    Return<void> getVoiceRegistrationStateResponse(const RadioResponseInfo& info,
+                                                   const VoiceRegStateResult& voiceRegResponse);
+
+    Return<void> getDataRegistrationStateResponse(const RadioResponseInfo& info,
+                                                  const DataRegStateResult& dataRegResponse);
+
+    Return<void> getOperatorResponse(const RadioResponseInfo& info,
+                                     const ::android::hardware::hidl_string& longName,
+                                     const ::android::hardware::hidl_string& shortName,
+                                     const ::android::hardware::hidl_string& numeric);
+
+    Return<void> setRadioPowerResponse(const RadioResponseInfo& info);
+
+    Return<void> sendDtmfResponse(const RadioResponseInfo& info);
+
+    Return<void> sendSmsResponse(const RadioResponseInfo& info, const SendSmsResult& sms);
+
+    Return<void> sendSMSExpectMoreResponse(const RadioResponseInfo& info, const SendSmsResult& sms);
+
+    Return<void> setupDataCallResponse(const RadioResponseInfo& info,
+                                       const SetupDataCallResult& dcResponse);
+
+    Return<void> iccIOForAppResponse(const RadioResponseInfo& info, const IccIoResult& iccIo);
+
+    Return<void> sendUssdResponse(const RadioResponseInfo& info);
+
+    Return<void> cancelPendingUssdResponse(const RadioResponseInfo& info);
+
+    Return<void> getClirResponse(const RadioResponseInfo& info, int32_t n, int32_t m);
+
+    Return<void> setClirResponse(const RadioResponseInfo& info);
+
+    Return<void> getCallForwardStatusResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<CallForwardInfo>& call_forwardInfos);
+
+    Return<void> setCallForwardResponse(const RadioResponseInfo& info);
+
+    Return<void> getCallWaitingResponse(const RadioResponseInfo& info, bool enable,
+                                        int32_t serviceClass);
+
+    Return<void> setCallWaitingResponse(const RadioResponseInfo& info);
+
+    Return<void> acknowledgeLastIncomingGsmSmsResponse(const RadioResponseInfo& info);
+
+    Return<void> acceptCallResponse(const RadioResponseInfo& info);
+
+    Return<void> deactivateDataCallResponse(const RadioResponseInfo& info);
+
+    Return<void> getFacilityLockForAppResponse(const RadioResponseInfo& info, int32_t response);
+
+    Return<void> setFacilityLockForAppResponse(const RadioResponseInfo& info, int32_t retry);
+
+    Return<void> setBarringPasswordResponse(const RadioResponseInfo& info);
+
+    Return<void> getNetworkSelectionModeResponse(const RadioResponseInfo& info, bool manual);
+
+    Return<void> setNetworkSelectionModeAutomaticResponse(const RadioResponseInfo& info);
+
+    Return<void> setNetworkSelectionModeManualResponse(const RadioResponseInfo& info);
+
+    Return<void> getAvailableNetworksResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<OperatorInfo>& networkInfos);
+
+    Return<void> startDtmfResponse(const RadioResponseInfo& info);
+
+    Return<void> stopDtmfResponse(const RadioResponseInfo& info);
+
+    Return<void> getBasebandVersionResponse(const RadioResponseInfo& info,
+                                            const ::android::hardware::hidl_string& version);
+
+    Return<void> separateConnectionResponse(const RadioResponseInfo& info);
+
+    Return<void> setMuteResponse(const RadioResponseInfo& info);
+
+    Return<void> getMuteResponse(const RadioResponseInfo& info, bool enable);
+
+    Return<void> getClipResponse(const RadioResponseInfo& info, ClipStatus status);
+
+    Return<void> getDataCallListResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<SetupDataCallResult>& dcResponse);
+
+    Return<void> sendOemRilRequestRawResponse(const RadioResponseInfo& info,
+                                              const ::android::hardware::hidl_vec<uint8_t>& data);
+
+    Return<void> sendOemRilRequestStringsResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& data);
+
+    Return<void> setSuppServiceNotificationsResponse(const RadioResponseInfo& info);
+
+    Return<void> writeSmsToSimResponse(const RadioResponseInfo& info, int32_t index);
+
+    Return<void> deleteSmsOnSimResponse(const RadioResponseInfo& info);
+
+    Return<void> setBandModeResponse(const RadioResponseInfo& info);
+
+    Return<void> getAvailableBandModesResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<RadioBandMode>& bandModes);
+
+    Return<void> sendEnvelopeResponse(const RadioResponseInfo& info,
+                                      const ::android::hardware::hidl_string& commandResponse);
+
+    Return<void> sendTerminalResponseToSimResponse(const RadioResponseInfo& info);
+
+    Return<void> handleStkCallSetupRequestFromSimResponse(const RadioResponseInfo& info);
+
+    Return<void> explicitCallTransferResponse(const RadioResponseInfo& info);
+
+    Return<void> setPreferredNetworkTypeResponse(const RadioResponseInfo& info);
+
+    Return<void> getPreferredNetworkTypeResponse(const RadioResponseInfo& info,
+                                                 PreferredNetworkType nwType);
+
+    Return<void> getNeighboringCidsResponse(
+        const RadioResponseInfo& info, const ::android::hardware::hidl_vec<NeighboringCell>& cells);
+
+    Return<void> setLocationUpdatesResponse(const RadioResponseInfo& info);
+
+    Return<void> setCdmaSubscriptionSourceResponse(const RadioResponseInfo& info);
+
+    Return<void> setCdmaRoamingPreferenceResponse(const RadioResponseInfo& info);
+
+    Return<void> getCdmaRoamingPreferenceResponse(const RadioResponseInfo& info,
+                                                  CdmaRoamingType type);
+
+    Return<void> setTTYModeResponse(const RadioResponseInfo& info);
+
+    Return<void> getTTYModeResponse(const RadioResponseInfo& info, TtyMode mode);
+
+    Return<void> setPreferredVoicePrivacyResponse(const RadioResponseInfo& info);
+
+    Return<void> getPreferredVoicePrivacyResponse(const RadioResponseInfo& info, bool enable);
+
+    Return<void> sendCDMAFeatureCodeResponse(const RadioResponseInfo& info);
+
+    Return<void> sendBurstDtmfResponse(const RadioResponseInfo& info);
+
+    Return<void> sendCdmaSmsResponse(const RadioResponseInfo& info, const SendSmsResult& sms);
+
+    Return<void> acknowledgeLastIncomingCdmaSmsResponse(const RadioResponseInfo& info);
+
+    Return<void> getGsmBroadcastConfigResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<GsmBroadcastSmsConfigInfo>& configs);
+
+    Return<void> setGsmBroadcastConfigResponse(const RadioResponseInfo& info);
+
+    Return<void> setGsmBroadcastActivationResponse(const RadioResponseInfo& info);
+
+    Return<void> getCdmaBroadcastConfigResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<CdmaBroadcastSmsConfigInfo>& configs);
+
+    Return<void> setCdmaBroadcastConfigResponse(const RadioResponseInfo& info);
+
+    Return<void> setCdmaBroadcastActivationResponse(const RadioResponseInfo& info);
+
+    Return<void> getCDMASubscriptionResponse(const RadioResponseInfo& info,
+                                             const ::android::hardware::hidl_string& mdn,
+                                             const ::android::hardware::hidl_string& hSid,
+                                             const ::android::hardware::hidl_string& hNid,
+                                             const ::android::hardware::hidl_string& min,
+                                             const ::android::hardware::hidl_string& prl);
+
+    Return<void> writeSmsToRuimResponse(const RadioResponseInfo& info, uint32_t index);
+
+    Return<void> deleteSmsOnRuimResponse(const RadioResponseInfo& info);
+
+    Return<void> getDeviceIdentityResponse(const RadioResponseInfo& info,
+                                           const ::android::hardware::hidl_string& imei,
+                                           const ::android::hardware::hidl_string& imeisv,
+                                           const ::android::hardware::hidl_string& esn,
+                                           const ::android::hardware::hidl_string& meid);
+
+    Return<void> exitEmergencyCallbackModeResponse(const RadioResponseInfo& info);
+
+    Return<void> getSmscAddressResponse(const RadioResponseInfo& info,
+                                        const ::android::hardware::hidl_string& smsc);
+
+    Return<void> setSmscAddressResponse(const RadioResponseInfo& info);
+
+    Return<void> reportSmsMemoryStatusResponse(const RadioResponseInfo& info);
+
+    Return<void> reportStkServiceIsRunningResponse(const RadioResponseInfo& info);
+
+    Return<void> getCdmaSubscriptionSourceResponse(const RadioResponseInfo& info,
+                                                   CdmaSubscriptionSource source);
+
+    Return<void> requestIsimAuthenticationResponse(
+        const RadioResponseInfo& info, const ::android::hardware::hidl_string& response);
+
+    Return<void> acknowledgeIncomingGsmSmsWithPduResponse(const RadioResponseInfo& info);
+
+    Return<void> sendEnvelopeWithStatusResponse(const RadioResponseInfo& info,
+                                                const IccIoResult& iccIo);
+
+    Return<void> getVoiceRadioTechnologyResponse(const RadioResponseInfo& info,
+                                                 RadioTechnology rat);
+
+    Return<void> getCellInfoListResponse(const RadioResponseInfo& info,
+                                         const ::android::hardware::hidl_vec<CellInfo>& cellInfo);
+
+    Return<void> setCellInfoListRateResponse(const RadioResponseInfo& info);
+
+    Return<void> setInitialAttachApnResponse(const RadioResponseInfo& info);
+
+    Return<void> getImsRegistrationStateResponse(const RadioResponseInfo& info, bool isRegistered,
+                                                 RadioTechnologyFamily ratFamily);
+
+    Return<void> sendImsSmsResponse(const RadioResponseInfo& info, const SendSmsResult& sms);
+
+    Return<void> iccTransmitApduBasicChannelResponse(const RadioResponseInfo& info,
+                                                     const IccIoResult& result);
+
+    Return<void> iccOpenLogicalChannelResponse(
+        const RadioResponseInfo& info, int32_t channelId,
+        const ::android::hardware::hidl_vec<int8_t>& selectResponse);
+
+    Return<void> iccCloseLogicalChannelResponse(const RadioResponseInfo& info);
+
+    Return<void> iccTransmitApduLogicalChannelResponse(const RadioResponseInfo& info,
+                                                       const IccIoResult& result);
+
+    Return<void> nvReadItemResponse(const RadioResponseInfo& info,
+                                    const ::android::hardware::hidl_string& result);
+
+    Return<void> nvWriteItemResponse(const RadioResponseInfo& info);
+
+    Return<void> nvWriteCdmaPrlResponse(const RadioResponseInfo& info);
+
+    Return<void> nvResetConfigResponse(const RadioResponseInfo& info);
+
+    Return<void> setUiccSubscriptionResponse(const RadioResponseInfo& info);
+
+    Return<void> setDataAllowedResponse(const RadioResponseInfo& info);
+
+    Return<void> getHardwareConfigResponse(
+        const RadioResponseInfo& info, const ::android::hardware::hidl_vec<HardwareConfig>& config);
+
+    Return<void> requestIccSimAuthenticationResponse(const RadioResponseInfo& info,
+                                                     const IccIoResult& result);
+
+    Return<void> setDataProfileResponse(const RadioResponseInfo& info);
+
+    Return<void> requestShutdownResponse(const RadioResponseInfo& info);
+
+    Return<void> getRadioCapabilityResponse(const RadioResponseInfo& info,
+                                            const RadioCapability& rc);
+
+    Return<void> setRadioCapabilityResponse(const RadioResponseInfo& info,
+                                            const RadioCapability& rc);
+
+    Return<void> startLceServiceResponse(const RadioResponseInfo& info,
+                                         const LceStatusInfo& statusInfo);
+
+    Return<void> stopLceServiceResponse(const RadioResponseInfo& info,
+                                        const LceStatusInfo& statusInfo);
+
+    Return<void> pullLceDataResponse(const RadioResponseInfo& info, const LceDataInfo& lceInfo);
+
+    Return<void> getModemActivityInfoResponse(const RadioResponseInfo& info,
+                                              const ActivityStatsInfo& activityInfo);
+
+    Return<void> setAllowedCarriersResponse(const RadioResponseInfo& info, int32_t numAllowed);
+
+    Return<void> getAllowedCarriersResponse(const RadioResponseInfo& info, bool allAllowed,
+                                            const CarrierRestrictions& carriers);
+
+    Return<void> sendDeviceStateResponse(const RadioResponseInfo& info);
+
+    Return<void> setIndicationFilterResponse(const RadioResponseInfo& info);
+
+    Return<void> setSimCardPowerResponse(const RadioResponseInfo& info);
+
+    Return<void> acknowledgeRequest(int32_t serial);
+
     /* 1.1 Api */
     Return<void> setCarrierInfoForImsiEncryptionResponse(const RadioResponseInfo& info);
 
@@ -42,13 +401,170 @@
     Return<void> startNetworkScanResponse(const RadioResponseInfo& info);
 
     Return<void> stopNetworkScanResponse(const RadioResponseInfo& info);
+
+    Return<void> startKeepaliveResponse(const RadioResponseInfo& info,
+                                        const KeepaliveStatus& status);
+
+    Return<void> stopKeepaliveResponse(const RadioResponseInfo& info);
+};
+
+/* Callback class for radio indication */
+class RadioIndication_v1_1 : public ::android::hardware::radio::V1_1::IRadioIndication {
+   protected:
+    RadioHidlTest_v1_1& parent_v1_1;
+
+   public:
+    RadioIndication_v1_1(RadioHidlTest_v1_1& parent_v1_1);
+    virtual ~RadioIndication_v1_1() = default;
+
+    /* 1.1 Api */
+    Return<void> carrierInfoForImsiEncryption(RadioIndicationType info);
+
+    Return<void> networkScanResult(RadioIndicationType type, const NetworkScanResult& result);
+
+    Return<void> keepaliveStatus(RadioIndicationType type, const KeepaliveStatus& status);
+
+    /* 1.0 Api */
+    Return<void> radioStateChanged(RadioIndicationType type, RadioState radioState);
+
+    Return<void> callStateChanged(RadioIndicationType type);
+
+    Return<void> networkStateChanged(RadioIndicationType type);
+
+    Return<void> newSms(RadioIndicationType type,
+                        const ::android::hardware::hidl_vec<uint8_t>& pdu);
+
+    Return<void> newSmsStatusReport(RadioIndicationType type,
+                                    const ::android::hardware::hidl_vec<uint8_t>& pdu);
+
+    Return<void> newSmsOnSim(RadioIndicationType type, int32_t recordNumber);
+
+    Return<void> onUssd(RadioIndicationType type, UssdModeType modeType,
+                        const ::android::hardware::hidl_string& msg);
+
+    Return<void> nitzTimeReceived(RadioIndicationType type,
+                                  const ::android::hardware::hidl_string& nitzTime,
+                                  uint64_t receivedTime);
+
+    Return<void> currentSignalStrength(RadioIndicationType type,
+                                       const SignalStrength& signalStrength);
+
+    Return<void> dataCallListChanged(
+        RadioIndicationType type, const ::android::hardware::hidl_vec<SetupDataCallResult>& dcList);
+
+    Return<void> suppSvcNotify(RadioIndicationType type, const SuppSvcNotification& suppSvc);
+
+    Return<void> stkSessionEnd(RadioIndicationType type);
+
+    Return<void> stkProactiveCommand(RadioIndicationType type,
+                                     const ::android::hardware::hidl_string& cmd);
+
+    Return<void> stkEventNotify(RadioIndicationType type,
+                                const ::android::hardware::hidl_string& cmd);
+
+    Return<void> stkCallSetup(RadioIndicationType type, int64_t timeout);
+
+    Return<void> simSmsStorageFull(RadioIndicationType type);
+
+    Return<void> simRefresh(RadioIndicationType type, const SimRefreshResult& refreshResult);
+
+    Return<void> callRing(RadioIndicationType type, bool isGsm, const CdmaSignalInfoRecord& record);
+
+    Return<void> simStatusChanged(RadioIndicationType type);
+
+    Return<void> cdmaNewSms(RadioIndicationType type, const CdmaSmsMessage& msg);
+
+    Return<void> newBroadcastSms(RadioIndicationType type,
+                                 const ::android::hardware::hidl_vec<uint8_t>& data);
+
+    Return<void> cdmaRuimSmsStorageFull(RadioIndicationType type);
+
+    Return<void> restrictedStateChanged(RadioIndicationType type, PhoneRestrictedState state);
+
+    Return<void> enterEmergencyCallbackMode(RadioIndicationType type);
+
+    Return<void> cdmaCallWaiting(RadioIndicationType type,
+                                 const CdmaCallWaiting& callWaitingRecord);
+
+    Return<void> cdmaOtaProvisionStatus(RadioIndicationType type, CdmaOtaProvisionStatus status);
+
+    Return<void> cdmaInfoRec(RadioIndicationType type, const CdmaInformationRecords& records);
+
+    Return<void> indicateRingbackTone(RadioIndicationType type, bool start);
+
+    Return<void> resendIncallMute(RadioIndicationType type);
+
+    Return<void> cdmaSubscriptionSourceChanged(RadioIndicationType type,
+                                               CdmaSubscriptionSource cdmaSource);
+
+    Return<void> cdmaPrlChanged(RadioIndicationType type, int32_t version);
+
+    Return<void> exitEmergencyCallbackMode(RadioIndicationType type);
+
+    Return<void> rilConnected(RadioIndicationType type);
+
+    Return<void> voiceRadioTechChanged(RadioIndicationType type, RadioTechnology rat);
+
+    Return<void> cellInfoList(RadioIndicationType type,
+                              const ::android::hardware::hidl_vec<CellInfo>& records);
+
+    Return<void> imsNetworkStateChanged(RadioIndicationType type);
+
+    Return<void> subscriptionStatusChanged(RadioIndicationType type, bool activate);
+
+    Return<void> srvccStateNotify(RadioIndicationType type, SrvccState state);
+
+    Return<void> hardwareConfigChanged(
+        RadioIndicationType type, const ::android::hardware::hidl_vec<HardwareConfig>& configs);
+
+    Return<void> radioCapabilityIndication(RadioIndicationType type, const RadioCapability& rc);
+
+    Return<void> onSupplementaryServiceIndication(RadioIndicationType type,
+                                                  const StkCcUnsolSsResult& ss);
+
+    Return<void> stkCallControlAlphaNotify(RadioIndicationType type,
+                                           const ::android::hardware::hidl_string& alpha);
+
+    Return<void> lceData(RadioIndicationType type, const LceDataInfo& lce);
+
+    Return<void> pcoData(RadioIndicationType type, const PcoDataInfo& pco);
+
+    Return<void> modemReset(RadioIndicationType type,
+                            const ::android::hardware::hidl_string& reason);
 };
 
 // The main test class for Radio HIDL.
-class RadioHidlTest_v1_1 : public RadioHidlTest {
+class RadioHidlTest_v1_1 : public ::testing::VtsHalHidlTargetTestBase {
+   protected:
+    std::mutex mtx;
+    std::condition_variable cv;
+    int count;
+
    public:
     virtual void SetUp() override;
+
+    virtual void TearDown() override;
+
+    /* Used as a mechanism to inform the test about data/event callback */
+    void notify();
+
+    /* Test code calls this function to wait for response */
+    std::cv_status wait();
+
+    /* Used for checking General Errors */
+    bool CheckGeneralError();
+
+    /* Used for checking OEM Errors */
+    bool CheckOEMError();
+
     sp<::android::hardware::radio::V1_1::IRadio> radio_v1_1;
     sp<RadioResponse_v1_1> radioRsp_v1_1;
-    sp<::android::hardware::radio::V1_1::IRadioIndication> radioInd_v1_1;
+    sp<RadioIndication_v1_1> radioInd_v1_1;
+};
+
+// A class for test environment setup
+class RadioHidlEnvironment : public ::testing::Environment {
+   public:
+    virtual void SetUp() {}
+    virtual void TearDown() {}
 };
\ No newline at end of file
diff --git a/radio/1.1/vts/functional/radio_indication.cpp b/radio/1.1/vts/functional/radio_indication.cpp
new file mode 100644
index 0000000..652e555
--- /dev/null
+++ b/radio/1.1/vts/functional/radio_indication.cpp
@@ -0,0 +1,251 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <radio_hidl_hal_utils_v1_1.h>
+
+RadioIndication_v1_1::RadioIndication_v1_1(RadioHidlTest_v1_1& parent) : parent_v1_1(parent) {}
+
+/* 1.1 Apis */
+Return<void> RadioIndication_v1_1::carrierInfoForImsiEncryption(RadioIndicationType /*info*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::networkScanResult(RadioIndicationType /*type*/,
+                                                     const NetworkScanResult& /*result*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::keepaliveStatus(RadioIndicationType /*type*/,
+                                                   const KeepaliveStatus& /*status*/) {
+    return Void();
+}
+
+/* 1.0 Apis */
+Return<void> RadioIndication_v1_1::radioStateChanged(RadioIndicationType /*type*/,
+                                                     RadioState /*radioState*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::callStateChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::networkStateChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::newSms(RadioIndicationType /*type*/,
+                                          const ::android::hardware::hidl_vec<uint8_t>& /*pdu*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::newSmsStatusReport(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_vec<uint8_t>& /*pdu*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::newSmsOnSim(RadioIndicationType /*type*/,
+                                               int32_t /*recordNumber*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::onUssd(RadioIndicationType /*type*/, UssdModeType /*modeType*/,
+                                          const ::android::hardware::hidl_string& /*msg*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::nitzTimeReceived(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_string& /*nitzTime*/,
+    uint64_t /*receivedTime*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::currentSignalStrength(RadioIndicationType /*type*/,
+                                                         const SignalStrength& /*signalStrength*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::dataCallListChanged(
+    RadioIndicationType /*type*/,
+    const ::android::hardware::hidl_vec<SetupDataCallResult>& /*dcList*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::suppSvcNotify(RadioIndicationType /*type*/,
+                                                 const SuppSvcNotification& /*suppSvc*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::stkSessionEnd(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::stkProactiveCommand(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_string& /*cmd*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::stkEventNotify(RadioIndicationType /*type*/,
+                                                  const ::android::hardware::hidl_string& /*cmd*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::stkCallSetup(RadioIndicationType /*type*/, int64_t /*timeout*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::simSmsStorageFull(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::simRefresh(RadioIndicationType /*type*/,
+                                              const SimRefreshResult& /*refreshResult*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::callRing(RadioIndicationType /*type*/, bool /*isGsm*/,
+                                            const CdmaSignalInfoRecord& /*record*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::simStatusChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cdmaNewSms(RadioIndicationType /*type*/,
+                                              const CdmaSmsMessage& /*msg*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::newBroadcastSms(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_vec<uint8_t>& /*data*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cdmaRuimSmsStorageFull(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::restrictedStateChanged(RadioIndicationType /*type*/,
+                                                          PhoneRestrictedState /*state*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::enterEmergencyCallbackMode(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cdmaCallWaiting(RadioIndicationType /*type*/,
+                                                   const CdmaCallWaiting& /*callWaitingRecord*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cdmaOtaProvisionStatus(RadioIndicationType /*type*/,
+                                                          CdmaOtaProvisionStatus /*status*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cdmaInfoRec(RadioIndicationType /*type*/,
+                                               const CdmaInformationRecords& /*records*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::indicateRingbackTone(RadioIndicationType /*type*/,
+                                                        bool /*start*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::resendIncallMute(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cdmaSubscriptionSourceChanged(
+    RadioIndicationType /*type*/, CdmaSubscriptionSource /*cdmaSource*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cdmaPrlChanged(RadioIndicationType /*type*/,
+                                                  int32_t /*version*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::exitEmergencyCallbackMode(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::rilConnected(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::voiceRadioTechChanged(RadioIndicationType /*type*/,
+                                                         RadioTechnology /*rat*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::cellInfoList(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_vec<CellInfo>& /*records*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::imsNetworkStateChanged(RadioIndicationType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::subscriptionStatusChanged(RadioIndicationType /*type*/,
+                                                             bool /*activate*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::srvccStateNotify(RadioIndicationType /*type*/,
+                                                    SrvccState /*state*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::hardwareConfigChanged(
+    RadioIndicationType /*type*/,
+    const ::android::hardware::hidl_vec<HardwareConfig>& /*configs*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::radioCapabilityIndication(RadioIndicationType /*type*/,
+                                                             const RadioCapability& /*rc*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::onSupplementaryServiceIndication(
+    RadioIndicationType /*type*/, const StkCcUnsolSsResult& /*ss*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::stkCallControlAlphaNotify(
+    RadioIndicationType /*type*/, const ::android::hardware::hidl_string& /*alpha*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::lceData(RadioIndicationType /*type*/,
+                                           const LceDataInfo& /*lce*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::pcoData(RadioIndicationType /*type*/,
+                                           const PcoDataInfo& /*pco*/) {
+    return Void();
+}
+
+Return<void> RadioIndication_v1_1::modemReset(RadioIndicationType /*type*/,
+                                              const ::android::hardware::hidl_string& /*reason*/) {
+    return Void();
+}
\ No newline at end of file
diff --git a/radio/1.1/vts/functional/radio_response.cpp b/radio/1.1/vts/functional/radio_response.cpp
index c5c8fd7..98cab98 100644
--- a/radio/1.1/vts/functional/radio_response.cpp
+++ b/radio/1.1/vts/functional/radio_response.cpp
@@ -16,8 +16,646 @@
 
 #include <radio_hidl_hal_utils_v1_1.h>
 
-RadioResponse_v1_1::RadioResponse_v1_1(RadioHidlTest_v1_1& parent)
-    : RadioResponse(parent), parent_v1_1(parent) {}
+CardStatus cardStatus;
+
+RadioResponse_v1_1::RadioResponse_v1_1(RadioHidlTest_v1_1& parent) : parent_v1_1(parent) {}
+
+/* 1.0 Apis */
+Return<void> RadioResponse_v1_1::getIccCardStatusResponse(const RadioResponseInfo& info,
+                                                          const CardStatus& card_status) {
+    rspInfo = info;
+    cardStatus = card_status;
+    parent_v1_1.notify();
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::supplyIccPinForAppResponse(const RadioResponseInfo& /*info*/,
+                                                            int32_t /*remainingRetries*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::supplyIccPukForAppResponse(const RadioResponseInfo& /*info*/,
+                                                            int32_t /*remainingRetries*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::supplyIccPin2ForAppResponse(const RadioResponseInfo& /*info*/,
+                                                             int32_t /*remainingRetries*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::supplyIccPuk2ForAppResponse(const RadioResponseInfo& /*info*/,
+                                                             int32_t /*remainingRetries*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::changeIccPinForAppResponse(const RadioResponseInfo& /*info*/,
+                                                            int32_t /*remainingRetries*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::changeIccPin2ForAppResponse(const RadioResponseInfo& /*info*/,
+                                                             int32_t /*remainingRetries*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::supplyNetworkDepersonalizationResponse(
+    const RadioResponseInfo& /*info*/, int32_t /*remainingRetries*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCurrentCallsResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_vec<Call>& /*calls*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::dialResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getIMSIForAppResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*imsi*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::hangupConnectionResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::hangupWaitingOrBackgroundResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::hangupForegroundResumeBackgroundResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::switchWaitingOrHoldingAndActiveResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::conferenceResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::rejectCallResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getLastCallFailCauseResponse(
+    const RadioResponseInfo& /*info*/, const LastCallFailCauseInfo& /*failCauseInfo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getSignalStrengthResponse(const RadioResponseInfo& /*info*/,
+                                                           const SignalStrength& /*sig_strength*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getVoiceRegistrationStateResponse(
+    const RadioResponseInfo& /*info*/, const VoiceRegStateResult& /*voiceRegResponse*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getDataRegistrationStateResponse(
+    const RadioResponseInfo& /*info*/, const DataRegStateResult& /*dataRegResponse*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getOperatorResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*longName*/,
+    const ::android::hardware::hidl_string& /*shortName*/,
+    const ::android::hardware::hidl_string& /*numeric*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setRadioPowerResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendDtmfResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendSmsResponse(const RadioResponseInfo& /*info*/,
+                                                 const SendSmsResult& /*sms*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendSMSExpectMoreResponse(const RadioResponseInfo& /*info*/,
+                                                           const SendSmsResult& /*sms*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setupDataCallResponse(const RadioResponseInfo& /*info*/,
+                                                       const SetupDataCallResult& /*dcResponse*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::iccIOForAppResponse(const RadioResponseInfo& /*info*/,
+                                                     const IccIoResult& /*iccIo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendUssdResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::cancelPendingUssdResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getClirResponse(const RadioResponseInfo& /*info*/, int32_t /*n*/,
+                                                 int32_t /*m*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setClirResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCallForwardStatusResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_vec<CallForwardInfo>&
+    /*callForwardInfos*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setCallForwardResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCallWaitingResponse(const RadioResponseInfo& /*info*/,
+                                                        bool /*enable*/, int32_t /*serviceClass*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setCallWaitingResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::acknowledgeLastIncomingGsmSmsResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::acceptCallResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::deactivateDataCallResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getFacilityLockForAppResponse(const RadioResponseInfo& /*info*/,
+                                                               int32_t /*response*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setFacilityLockForAppResponse(const RadioResponseInfo& /*info*/,
+                                                               int32_t /*retry*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setBarringPasswordResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getNetworkSelectionModeResponse(const RadioResponseInfo& /*info*/,
+                                                                 bool /*manual*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setNetworkSelectionModeAutomaticResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setNetworkSelectionModeManualResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getAvailableNetworksResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<OperatorInfo>& /*networkInfos*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::startDtmfResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::stopDtmfResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getBasebandVersionResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*version*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::separateConnectionResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setMuteResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getMuteResponse(const RadioResponseInfo& /*info*/,
+                                                 bool /*enable*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getClipResponse(const RadioResponseInfo& /*info*/,
+                                                 ClipStatus /*status*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getDataCallListResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<SetupDataCallResult>& /*dcResponse*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendOemRilRequestRawResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_vec<uint8_t>& /*data*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendOemRilRequestStringsResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec< ::android::hardware::hidl_string>& /*data*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setSuppServiceNotificationsResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::writeSmsToSimResponse(const RadioResponseInfo& /*info*/,
+                                                       int32_t /*index*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::deleteSmsOnSimResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setBandModeResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getAvailableBandModesResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<RadioBandMode>& /*bandModes*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendEnvelopeResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_string& /*commandResponse*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendTerminalResponseToSimResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::handleStkCallSetupRequestFromSimResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::explicitCallTransferResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setPreferredNetworkTypeResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getPreferredNetworkTypeResponse(const RadioResponseInfo& /*info*/,
+                                                                 PreferredNetworkType /*nw_type*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getNeighboringCidsResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<NeighboringCell>& /*cells*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setLocationUpdatesResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setCdmaSubscriptionSourceResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setCdmaRoamingPreferenceResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCdmaRoamingPreferenceResponse(const RadioResponseInfo& /*info*/,
+                                                                  CdmaRoamingType /*type*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setTTYModeResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getTTYModeResponse(const RadioResponseInfo& /*info*/,
+                                                    TtyMode /*mode*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setPreferredVoicePrivacyResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getPreferredVoicePrivacyResponse(const RadioResponseInfo& /*info*/,
+                                                                  bool /*enable*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendCDMAFeatureCodeResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendBurstDtmfResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendCdmaSmsResponse(const RadioResponseInfo& /*info*/,
+                                                     const SendSmsResult& /*sms*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::acknowledgeLastIncomingCdmaSmsResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getGsmBroadcastConfigResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<GsmBroadcastSmsConfigInfo>& /*configs*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setGsmBroadcastConfigResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setGsmBroadcastActivationResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCdmaBroadcastConfigResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setCdmaBroadcastConfigResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setCdmaBroadcastActivationResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCDMASubscriptionResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*mdn*/,
+    const ::android::hardware::hidl_string& /*hSid*/,
+    const ::android::hardware::hidl_string& /*hNid*/,
+    const ::android::hardware::hidl_string& /*min*/,
+    const ::android::hardware::hidl_string& /*prl*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::writeSmsToRuimResponse(const RadioResponseInfo& /*info*/,
+                                                        uint32_t /*index*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::deleteSmsOnRuimResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getDeviceIdentityResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*imei*/,
+    const ::android::hardware::hidl_string& /*imeisv*/,
+    const ::android::hardware::hidl_string& /*esn*/,
+    const ::android::hardware::hidl_string& /*meid*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::exitEmergencyCallbackModeResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getSmscAddressResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*smsc*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setSmscAddressResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::reportSmsMemoryStatusResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::reportStkServiceIsRunningResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCdmaSubscriptionSourceResponse(
+    const RadioResponseInfo& /*info*/, CdmaSubscriptionSource /*source*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::requestIsimAuthenticationResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*response*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::acknowledgeIncomingGsmSmsWithPduResponse(
+    const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendEnvelopeWithStatusResponse(const RadioResponseInfo& /*info*/,
+                                                                const IccIoResult& /*iccIo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getVoiceRadioTechnologyResponse(const RadioResponseInfo& /*info*/,
+                                                                 RadioTechnology /*rat*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getCellInfoListResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<CellInfo>& /*cellInfo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setCellInfoListRateResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setInitialAttachApnResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getImsRegistrationStateResponse(
+    const RadioResponseInfo& /*info*/, bool /*isRegistered*/, RadioTechnologyFamily /*ratFamily*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendImsSmsResponse(const RadioResponseInfo& /*info*/,
+                                                    const SendSmsResult& /*sms*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::iccTransmitApduBasicChannelResponse(
+    const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::iccOpenLogicalChannelResponse(
+    const RadioResponseInfo& /*info*/, int32_t /*channelId*/,
+    const ::android::hardware::hidl_vec<int8_t>& /*selectResponse*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::iccCloseLogicalChannelResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::iccTransmitApduLogicalChannelResponse(
+    const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::nvReadItemResponse(
+    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*result*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::nvWriteItemResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::nvWriteCdmaPrlResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::nvResetConfigResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setUiccSubscriptionResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setDataAllowedResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getHardwareConfigResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<HardwareConfig>& /*config*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::requestIccSimAuthenticationResponse(
+    const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setDataProfileResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::requestShutdownResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getRadioCapabilityResponse(const RadioResponseInfo& /*info*/,
+                                                            const RadioCapability& /*rc*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setRadioCapabilityResponse(const RadioResponseInfo& /*info*/,
+                                                            const RadioCapability& /*rc*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::startLceServiceResponse(const RadioResponseInfo& /*info*/,
+                                                         const LceStatusInfo& /*statusInfo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::stopLceServiceResponse(const RadioResponseInfo& /*info*/,
+                                                        const LceStatusInfo& /*statusInfo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::pullLceDataResponse(const RadioResponseInfo& /*info*/,
+                                                     const LceDataInfo& /*lceInfo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getModemActivityInfoResponse(
+    const RadioResponseInfo& /*info*/, const ActivityStatsInfo& /*activityInfo*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setAllowedCarriersResponse(const RadioResponseInfo& /*info*/,
+                                                            int32_t /*numAllowed*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::getAllowedCarriersResponse(
+    const RadioResponseInfo& /*info*/, bool /*allAllowed*/,
+    const CarrierRestrictions& /*carriers*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::sendDeviceStateResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setIndicationFilterResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::setSimCardPowerResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::acknowledgeRequest(int32_t /*serial*/) {
+    return Void();
+}
 
 /* 1.1 Apis */
 Return<void> RadioResponse_v1_1::setCarrierInfoForImsiEncryptionResponse(
@@ -37,4 +675,13 @@
 
 Return<void> RadioResponse_v1_1::stopNetworkScanResponse(const RadioResponseInfo& /*info*/) {
     return Void();
+}
+
+Return<void> RadioResponse_v1_1::startKeepaliveResponse(const RadioResponseInfo& /*info*/,
+                                                        const KeepaliveStatus& /*status*/) {
+    return Void();
+}
+
+Return<void> RadioResponse_v1_1::stopKeepaliveResponse(const RadioResponseInfo& /*info*/) {
+    return Void();
 }
\ No newline at end of file
diff --git a/tests/bar/1.0/default/Android.bp b/tests/bar/1.0/default/Android.bp
index 2a9607b..82d34a9 100644
--- a/tests/bar/1.0/default/Android.bp
+++ b/tests/bar/1.0/default/Android.bp
@@ -4,7 +4,6 @@
     name: "android.hardware.tests.bar@1.0-impl",
     defaults: ["hidl_defaults"],
     relative_install_path: "hw",
-    proprietary: true,
     srcs: [
         "Bar.cpp",
         "ImportTypes.cpp",
diff --git a/tests/baz/1.0/default/Android.bp b/tests/baz/1.0/default/Android.bp
index ef1c28e..f247b83 100644
--- a/tests/baz/1.0/default/Android.bp
+++ b/tests/baz/1.0/default/Android.bp
@@ -2,7 +2,6 @@
     name: "android.hardware.tests.baz@1.0-impl",
     defaults: ["hidl_defaults"],
     relative_install_path: "hw",
-    proprietary: true,
     srcs: [
         "Baz.cpp",
     ],
diff --git a/tests/foo/1.0/default/Android.bp b/tests/foo/1.0/default/Android.bp
index f8acf9d..0e1d34d 100644
--- a/tests/foo/1.0/default/Android.bp
+++ b/tests/foo/1.0/default/Android.bp
@@ -4,7 +4,6 @@
     name: "android.hardware.tests.foo@1.0-impl",
     defaults: ["hidl_defaults"],
     relative_install_path: "hw",
-    proprietary: true,
     srcs: [
         "Foo.cpp",
     ],
diff --git a/tests/foo/1.0/default/lib/Android.bp b/tests/foo/1.0/default/lib/Android.bp
index b512311..895582c 100644
--- a/tests/foo/1.0/default/lib/Android.bp
+++ b/tests/foo/1.0/default/lib/Android.bp
@@ -1,6 +1,5 @@
 cc_library_shared {
     name: "libfootest",
-    vendor: true,
     defaults: ["hidl_defaults"],
     srcs: [
         "FooHelper.cpp"
diff --git a/tests/hash/1.0/default/Android.bp b/tests/hash/1.0/default/Android.bp
index d6e9630..ae44876 100644
--- a/tests/hash/1.0/default/Android.bp
+++ b/tests/hash/1.0/default/Android.bp
@@ -1,7 +1,6 @@
 cc_library_shared {
     name: "android.hardware.tests.hash@1.0-impl",
     relative_install_path: "hw",
-    proprietary: true,
     srcs: [
         "Hash.cpp",
     ],
diff --git a/tests/inheritance/1.0/default/Android.bp b/tests/inheritance/1.0/default/Android.bp
index f6ca88a..158da4b 100644
--- a/tests/inheritance/1.0/default/Android.bp
+++ b/tests/inheritance/1.0/default/Android.bp
@@ -4,7 +4,6 @@
     name: "android.hardware.tests.inheritance@1.0-impl",
     defaults: ["hidl_defaults"],
     relative_install_path: "hw",
-    proprietary: true,
     srcs: [
         "Fetcher.cpp",
         "Parent.cpp",
diff --git a/tests/memory/1.0/default/Android.bp b/tests/memory/1.0/default/Android.bp
index e889bd8..efd4165 100644
--- a/tests/memory/1.0/default/Android.bp
+++ b/tests/memory/1.0/default/Android.bp
@@ -15,7 +15,6 @@
 cc_library_shared {
     name: "android.hardware.tests.memory@1.0-impl",
     defaults: ["hidl_defaults"],
-    proprietary: true,
     relative_install_path: "hw",
     srcs: [
         "MemoryTest.cpp",
diff --git a/tests/pointer/1.0/default/Android.bp b/tests/pointer/1.0/default/Android.bp
index 4615463..0c91edb 100644
--- a/tests/pointer/1.0/default/Android.bp
+++ b/tests/pointer/1.0/default/Android.bp
@@ -4,7 +4,6 @@
     name: "android.hardware.tests.pointer@1.0-impl",
     defaults: ["hidl_defaults"],
     relative_install_path: "hw",
-    proprietary: true,
     srcs: [
         "Graph.cpp",
         "Pointer.cpp",
diff --git a/tests/pointer/1.0/default/lib/Android.bp b/tests/pointer/1.0/default/lib/Android.bp
index 1fe0896..ae07b04 100644
--- a/tests/pointer/1.0/default/lib/Android.bp
+++ b/tests/pointer/1.0/default/lib/Android.bp
@@ -1,6 +1,5 @@
 cc_library_shared {
     name: "libpointertest",
-    vendor: true,
     defaults: ["hidl_defaults"],
     srcs: [
         "PointerHelper.cpp"