Merge a58e9dd5f320809806b7d686d9eb66356dda99f8 on remote branch

Change-Id: I59217a61531cd5a47133d6a118fc7a8f37520195
diff --git a/libplatformconfig/Android.mk b/libplatformconfig/Android.mk
index e82921b..023ac75 100644
--- a/libplatformconfig/Android.mk
+++ b/libplatformconfig/Android.mk
@@ -36,16 +36,6 @@
 LOCAL_SRC_FILES := PlatformConfig.cpp
 LOCAL_SRC_FILES += ConfigParser.cpp
 
-####################
-ENABLE_CONFIGSTORE = true
-ifeq ($(ENABLE_CONFIGSTORE),true)
-LOCAL_SRC_FILES += ConfigStore.cpp
-LOCAL_CFLAGS += -DENABLE_CONFIGSTORE
-LOCAL_SHARED_LIBRARIES += libhidlbase
-LOCAL_SHARED_LIBRARIES += vendor.qti.hardware.capabilityconfigstore@1.0
-endif
-####################
-
 LOCAL_MODULE := libplatformconfig
 LOCAL_VENDOR_MODULE := true
 
diff --git a/libplatformconfig/ConfigStore.cpp b/libplatformconfig/ConfigStore.cpp
deleted file mode 100644
index 05c2aaa..0000000
--- a/libplatformconfig/ConfigStore.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- *       copyright notice, this list of conditions and the following
- *       disclaimer in the documentation and/or other materials provided
- *       with the distribution.
- *     * Neither the name of The Linux Foundation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include "ConfigStore.h"
-#include "PlatformConfig.h"
-
-bool isConfigStoreEnabled()
-{
-    return Platform::Config::isConfigStoreEnabled();
-}
-
-uint32_t getConfigStoreBool(const char *area, const char *config,
-        bool *value, const bool defaultValue)
-{
-    using Platform::ConfigError_t;
-
-    ConfigError_t err = ConfigError_t::OK;
-
-    if (!area || !config || !value) {
-        err = ConfigError_t::FAIL;
-    }
-
-    if (err == ConfigError_t::OK) {
-        err = Platform::Config::getConfigStoreBool(area, config, *value, defaultValue);
-    }
-
-    return static_cast<uint32_t>(err);
-}
diff --git a/libplatformconfig/ConfigStore.h b/libplatformconfig/ConfigStore.h
deleted file mode 100644
index 2c75fb1..0000000
--- a/libplatformconfig/ConfigStore.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- *       copyright notice, this list of conditions and the following
- *       disclaimer in the documentation and/or other materials provided
- *       with the distribution.
- *     * Neither the name of The Linux Foundation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __CONFIG_STORE_H__
-#define __CONFIG_STORE_H__
-
-//////////////////////////////////////////////////////////////////////////////
-//                             Include Files
-//////////////////////////////////////////////////////////////////////////////
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// wrappers to allow C files to access ConfigStore
-bool isConfigStoreEnabled();
-uint32_t getConfigStoreBool(const char *area, const char *config,
-        bool *value, const bool defaultValue);
-
-#ifdef __cplusplus
-}
-#endif
-#endif // __CONFIG_STORE_H__
diff --git a/libplatformconfig/PlatformConfig.cpp b/libplatformconfig/PlatformConfig.cpp
index 7c3af9c..35237e8 100644
--- a/libplatformconfig/PlatformConfig.cpp
+++ b/libplatformconfig/PlatformConfig.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 - 2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017 - 2018, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -35,11 +35,6 @@
 #include "PlatformConfig.h"
 #include "ConfigParser.h"
 
-#ifdef ENABLE_CONFIGSTORE
-#include <vendor/qti/hardware/capabilityconfigstore/1.0/types.h>
-#include <vendor/qti/hardware/capabilityconfigstore/1.0/ICapabilityConfigStore.h>
-#endif
-
 namespace Platform {
 
 #define PLAT_CONFIG_FILE "/vendor/etc/system_properties.xml"
@@ -76,68 +71,4 @@
     return OK;
 }
 
-bool Config::isConfigStoreEnabled()
-{
-#ifdef ENABLE_CONFIGSTORE
-    return true;
-#else
-    return false;
-#endif
-}
-
-ConfigError_t Config::getConfigStoreBool(const char *area, const char *config,
-        bool &value, const bool defaultValue)
-{
-#ifdef ENABLE_CONFIGSTORE
-    using vendor::qti::hardware::capabilityconfigstore::V1_0::Result;
-    using vendor::qti::hardware::capabilityconfigstore::V1_0::CommandResult;
-    if (area == nullptr || config == nullptr) {
-        return FAIL;
-    }
-
-    value = defaultValue;
-
-    Config *conf = getInstance();
-    if (conf == nullptr) {
-        return FAIL;
-    }
-
-    // load on demand
-    if (conf->mConfigStore == nullptr) {
-        conf->mConfigStore = ICapabilityConfigStore::tryGetService();
-    }
-
-    if (conf->mConfigStore == nullptr) {
-        VIDC_PLAT_LOGH("%s: unable to get configstore service", __func__);
-        return FAIL;
-    }
-
-    CommandResult result;
-    result.result_type = Result::NOT_FOUND;
-    conf->mConfigStore->getConfig(area, config, [&](const CommandResult &res) {
-        result = res;
-    });
-
-    if (result.result_type != Result::SUCCESS) {
-        VIDC_PLAT_LOGH("%s: %s/%s not found(%u)", __func__, area, config,
-                       result.result_type);
-        return FAIL;
-    }
-
-    if (strncasecmp("true", result.value.c_str(), result.value.size()) == 0) {
-        value = true;
-    } else {
-        value = false;
-    }
-    VIDC_PLAT_LOGH("%s: %s/%s=%s, returning %s ", __func__, area, config,
-            result.value.c_str(), value ? "true" : "false");
-    return OK;
-#else
-    (void)(area);
-    (void)(config);
-    value = defaultValue;
-    return OK;
-#endif
-}
-
 }
diff --git a/libplatformconfig/PlatformConfig.h b/libplatformconfig/PlatformConfig.h
index cbbb4d2..0ab40ba 100644
--- a/libplatformconfig/PlatformConfig.h
+++ b/libplatformconfig/PlatformConfig.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -36,10 +36,6 @@
 #include <string>
 #include <map>
 
-#ifdef ENABLE_CONFIGSTORE
-#include <vendor/qti/hardware/capabilityconfigstore/1.0/ICapabilityConfigStore.h>
-#endif
-
 #ifdef __cplusplus
     extern "C" {
 #endif
@@ -48,11 +44,6 @@
 
 typedef std::map<std::string, std::string> ConfigMap;
 
-#ifdef ENABLE_CONFIGSTORE
-using namespace android;
-using vendor::qti::hardware::capabilityconfigstore::V1_0::ICapabilityConfigStore;
-#endif
-
 typedef enum {
     OK = 0,
     FAIL = 1,
@@ -108,17 +99,9 @@
         ConfigMap mConfigMap;
         static Config* mInstance;
 
-#ifdef ENABLE_CONFIGSTORE
-        android::sp<ICapabilityConfigStore> mConfigStore;
-#endif
-
     public:
         static ConfigError_t getInt32(Config_t config, int32_t *value,
                 const int32_t defaultValue);
-
-        static bool isConfigStoreEnabled();
-        static ConfigError_t getConfigStoreBool(const char *area,
-                const char *config, bool &value, const bool defaultValue);
 };
 
 }
diff --git a/mm-core/Android.mk b/mm-core/Android.mk
index 77e7edd..07f800f 100644
--- a/mm-core/Android.mk
+++ b/mm-core/Android.mk
@@ -35,7 +35,7 @@
 #===============================================================================
 
 LOCAL_C_INCLUDES        := $(LOCAL_PATH)/src/common
-LOCAL_C_INCLUDES        += $(TOP)/$(QCOM_MEDIA_ROOT)/libplatformconfig
+LOCAL_C_INCLUDES        += $(LOCAL_PATH)/inc
 
 LOCAL_HEADER_LIBRARIES := \
         libutils_headers \
@@ -76,7 +76,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_C_INCLUDES        := $(LOCAL_PATH)/src/common
-LOCAL_C_INCLUDES        += $(TOP)/$(QCOM_MEDIA_ROOT)/libplatformconfig
+LOCAL_C_INCLUDES        += $(LOCAL_PATH)/inc
 
 LOCAL_HEADER_LIBRARIES := \
         libutils_headers \
diff --git a/mm-core/src/common/qc_omx_core.c b/mm-core/src/common/qc_omx_core.c
index c0f639c..d9d9f54 100644
--- a/mm-core/src/common/qc_omx_core.c
+++ b/mm-core/src/common/qc_omx_core.c
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2009, 2015, 2018-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, 2015, 2018, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -84,10 +84,6 @@
 #include "omx_core_cmp.h"
 #include <cutils/properties.h>
 
-#ifndef VIDC_STUB_HAL
-#include "ConfigStore.h"
-#endif
-
 extern omx_core_cb_type core[];
 extern const unsigned int SIZE_OF_CORE;
 static pthread_mutex_t lock_core = PTHREAD_MUTEX_INITIALIZER;
@@ -464,30 +460,16 @@
     }
     if(cmp_index >= 0)
     {
+      char value[PROPERTY_VALUE_MAX];
       DEBUG_PRINT("getting fn pointer\n");
 
-      // Load VPP omx component for decoder if vpp property is enabled
-      const char *hwDecLib = "libOmxVdec.so";
-      const char *swDecLib = "libOmxSwVdec.so";
-      if (!strncmp(core[cmp_index].so_lib_name, hwDecLib, strlen(hwDecLib)) ||
-          !strncmp(core[cmp_index].so_lib_name, swDecLib, strlen(swDecLib))) {
-        bool isVppEnabled = false;
-        bool isCSEnabled = false;
-#ifndef VIDC_STUB_HAL
-        isCSEnabled = isConfigStoreEnabled();
-        if (isCSEnabled) {
-          getConfigStoreBool("vpp", "enable", &isVppEnabled, false);
-        }
-#endif
-        if (!isCSEnabled) {
-          char value[PROPERTY_VALUE_MAX];
-          if ((property_get("vendor.media.vpp.enable", value, NULL))
-               && (!strcmp("1", value) || !strcmp("true", value))) {
-            isVppEnabled = true;
-          }
-        }
-        if (isVppEnabled) {
-          DEBUG_PRINT("VPP property is enabled");
+      // Load VPP omx component for decoder if vpp
+      // property is enabled
+      if ((property_get("vendor.media.vpp.enable", value, NULL))
+           && (!strcmp("1", value) || !strcmp("true", value))) {
+        DEBUG_PRINT("VPP property is enabled");
+        if (!strcmp(core[cmp_index].so_lib_name, "libOmxVdec.so")
+                || !strcmp(core[cmp_index].so_lib_name, "libOmxSwVdec.so")) {
           vpp_cmp_index = get_cmp_index("OMX.qti.vdec.vpp");
           if (vpp_cmp_index < 0) {
             DEBUG_PRINT_ERROR("Unable to find VPP OMX lib in registry ");
diff --git a/product.mk b/product.mk
index 0ad03fa..c6e9021 100644
--- a/product.mk
+++ b/product.mk
@@ -13,7 +13,8 @@
 #---------------------------------------------------------------------------------------------------
 # TODO(PC): Override ccodec selection option back to defult (4).
 #           QSSI is forcing this to '1'. Must be reverted
-ifeq ($(call is-board-platform-in-list, crow blair bengal neo parrot taro lahaina holi kona trinket), true)
+ifeq ($(call is-board-platform-in-list, crow blair pitti bengal neo parrot taro lahaina holi \
+        kona trinket qcs605), true)
     $(warning "Default Codec2.0 Enabled")
     PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.ccodec=4
 endif