From 0bdc6b82ee5c4be42601101d2ea9c2a80bf31df9 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 21 Jan 2022 09:03:45 -0800 Subject: [PATCH] Remove unused ActiveLocale from ConfigurationMgr --- src/include/platform/ConfigurationManager.h | 2 -- .../GenericConfigurationManagerImpl.cpp | 12 ------------ .../GenericConfigurationManagerImpl.h | 2 -- src/platform/Ameba/AmebaConfig.cpp | 1 - src/platform/Ameba/AmebaConfig.h | 1 - src/platform/CYW30739/CYW30739Config.h | 1 - .../Darwin/ConfigurationManagerImpl.cpp | 12 ------------ .../Darwin/ConfigurationManagerImpl.h | 2 -- src/platform/Darwin/PosixConfig.cpp | 1 - src/platform/Darwin/PosixConfig.h | 1 - src/platform/EFR32/EFR32Config.h | 11 +++++------ src/platform/ESP32/ESP32Config.cpp | 1 - src/platform/ESP32/ESP32Config.h | 1 - .../Linux/ConfigurationManagerImpl.cpp | 6 ------ src/platform/Linux/PosixConfig.cpp | 1 - src/platform/Linux/PosixConfig.h | 1 - src/platform/P6/P6Config.cpp | 1 - src/platform/P6/P6Config.h | 1 - src/platform/Tizen/PosixConfig.cpp | 1 - src/platform/Tizen/PosixConfig.h | 1 - src/platform/Zephyr/ZephyrConfig.cpp | 3 +-- src/platform/Zephyr/ZephyrConfig.h | 1 - src/platform/android/AndroidConfig.cpp | 1 - src/platform/android/AndroidConfig.h | 1 - .../chip/platform/ConfigurationManager.java | 1 - .../cc13x2_26x2/CC13X2_26X2Config.cpp | 6 ++---- src/platform/cc13x2_26x2/CC13X2_26X2Config.h | 1 - src/platform/fake/ConfigurationManagerImpl.h | 2 -- src/platform/mbed/MbedConfig.cpp | 1 - src/platform/mbed/MbedConfig.h | 1 - src/platform/nxp/k32w/k32w0/K32W0Config.h | 1 - src/platform/qpg/qpgConfig.h | 1 - src/platform/tests/TestConfigurationMgr.cpp | 19 ------------------- 33 files changed, 8 insertions(+), 91 deletions(-) diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index a8977307b14aee..fd32b997c7954a 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -101,7 +101,6 @@ class ConfigurationManager virtual CHIP_ERROR IncrementLifetimeCounter() = 0; virtual CHIP_ERROR GetRegulatoryLocation(uint8_t & location) = 0; virtual CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) = 0; - virtual CHIP_ERROR GetActiveLocale(char * buf, size_t bufSize, size_t & codeLen) = 0; virtual CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) = 0; virtual CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) = 0; virtual CHIP_ERROR StorePrimaryWiFiMACAddress(const uint8_t * buf) = 0; @@ -112,7 +111,6 @@ class ConfigurationManager virtual CHIP_ERROR StoreSetupDiscriminator(uint16_t setupDiscriminator) = 0; virtual CHIP_ERROR StoreRegulatoryLocation(uint8_t location) = 0; virtual CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) = 0; - virtual CHIP_ERROR StoreActiveLocale(const char * code, size_t codeLen) = 0; virtual CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) = 0; virtual CHIP_ERROR GetRebootCount(uint32_t & rebootCount) = 0; virtual CHIP_ERROR StoreRebootCount(uint32_t rebootCount) = 0; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp index e327da4cfd38d3..c5c0c7e5a61ca5 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp @@ -332,24 +332,12 @@ CHIP_ERROR GenericConfigurationManagerImpl::GetCountryCode(char * b return ReadConfigValueStr(ConfigClass::kConfigKey_CountryCode, buf, bufSize, codeLen); } -template -CHIP_ERROR GenericConfigurationManagerImpl::GetActiveLocale(char * buf, size_t bufSize, size_t & codeLen) -{ - return ReadConfigValueStr(ConfigClass::kConfigKey_ActiveLocale, buf, bufSize, codeLen); -} - template CHIP_ERROR GenericConfigurationManagerImpl::StoreCountryCode(const char * code, size_t codeLen) { return WriteConfigValueStr(ConfigClass::kConfigKey_CountryCode, code, codeLen); } -template -CHIP_ERROR GenericConfigurationManagerImpl::StoreActiveLocale(const char * code, size_t codeLen) -{ - return WriteConfigValueStr(ConfigClass::kConfigKey_ActiveLocale, code, codeLen); -} - template CHIP_ERROR GenericConfigurationManagerImpl::GetBreadcrumb(uint64_t & breadcrumb) { diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index e498eb0e60854e..3cb2ddc6a4da41 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -91,9 +91,7 @@ class GenericConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR GetRegulatoryLocation(uint8_t & location) override; CHIP_ERROR StoreRegulatoryLocation(uint8_t location) override; CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) override; - CHIP_ERROR GetActiveLocale(char * buf, size_t bufSize, size_t & codeLen) override; CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) override; - CHIP_ERROR StoreActiveLocale(const char * code, size_t codeLen) override; CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) override; CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) override; CHIP_ERROR GetRebootCount(uint32_t & rebootCount) override; diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index 56de35a1e38b9b..02d0580ca82c4c 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -72,7 +72,6 @@ const AmebaConfig::Key AmebaConfig::kConfigKey_OperationalDeviceICACerts = { k const AmebaConfig::Key AmebaConfig::kConfigKey_OperationalDevicePrivateKey = { kConfigNamespace_ChipConfig, "op-device-key" }; const AmebaConfig::Key AmebaConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const AmebaConfig::Key AmebaConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const AmebaConfig::Key AmebaConfig::kConfigKey_ActiveLocale = { kConfigNamespace_ChipConfig, "active-locale" }; const AmebaConfig::Key AmebaConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Keys stored in the Chip-counters namespace diff --git a/src/platform/Ameba/AmebaConfig.h b/src/platform/Ameba/AmebaConfig.h index 1bc3b21aa82e02..19e85972fcc567 100755 --- a/src/platform/Ameba/AmebaConfig.h +++ b/src/platform/Ameba/AmebaConfig.h @@ -66,7 +66,6 @@ class AmebaConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; // Counter keys diff --git a/src/platform/CYW30739/CYW30739Config.h b/src/platform/CYW30739/CYW30739Config.h index 11fd35b9a2ed4c..a18dea30d43185 100644 --- a/src/platform/CYW30739/CYW30739Config.h +++ b/src/platform/CYW30739/CYW30739Config.h @@ -62,7 +62,6 @@ class CYW30739Config static constexpr Key kConfigKey_HardwareVersion = 16; static constexpr Key kConfigKey_RegulatoryLocation = 17; static constexpr Key kConfigKey_CountryCode = 18; - static constexpr Key kConfigKey_ActiveLocale = 19; static constexpr Key kConfigKey_HourFormat = 20; static constexpr Key kConfigKey_CalendarType = 21; static constexpr Key kConfigKey_Breadcrumb = 22; diff --git a/src/platform/Darwin/ConfigurationManagerImpl.cpp b/src/platform/Darwin/ConfigurationManagerImpl.cpp index e774115bb3d061..3011c9e97ea266 100644 --- a/src/platform/Darwin/ConfigurationManagerImpl.cpp +++ b/src/platform/Darwin/ConfigurationManagerImpl.cpp @@ -164,18 +164,6 @@ CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) #endif // TARGET_OS_OSX } -CHIP_ERROR ConfigurationManagerImpl::GetActiveLocale(char * buf, size_t bufSize, size_t & codeLen) -{ - // TODO: read current active locale. - return CHIP_NO_ERROR; -} - -CHIP_ERROR ConfigurationManagerImpl::StoreActiveLocale(const char * code, size_t codeLen) -{ - // TODO: write current active locale. - return CHIP_NO_ERROR; -} - bool ConfigurationManagerImpl::CanFactoryReset() { // TODO(#742): query the application to determine if factory reset is allowed. diff --git a/src/platform/Darwin/ConfigurationManagerImpl.h b/src/platform/Darwin/ConfigurationManagerImpl.h index 386e66a9733db5..364ffdd035e533 100644 --- a/src/platform/Darwin/ConfigurationManagerImpl.h +++ b/src/platform/Darwin/ConfigurationManagerImpl.h @@ -44,8 +44,6 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp CHIP_ERROR Init(void) override; CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) override; - CHIP_ERROR GetActiveLocale(char * buf, size_t bufSize, size_t & codeLen) override; - CHIP_ERROR StoreActiveLocale(const char * code, size_t codeLen) override; bool CanFactoryReset(void) override; void InitiateFactoryReset(void) override; CHIP_ERROR ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value) override; diff --git a/src/platform/Darwin/PosixConfig.cpp b/src/platform/Darwin/PosixConfig.cpp index 5ee3104038b4d4..5215d7bbf997da 100644 --- a/src/platform/Darwin/PosixConfig.cpp +++ b/src/platform/Darwin/PosixConfig.cpp @@ -65,7 +65,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNam const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const PosixConfig::Key PosixConfig::kConfigKey_ActiveLocale = { kConfigNamespace_ChipConfig, "active-locale" }; const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Prefix used for NVS keys that contain Chip group encryption keys. diff --git a/src/platform/Darwin/PosixConfig.h b/src/platform/Darwin/PosixConfig.h index 009433a91d4a5a..f45026905d6edd 100644 --- a/src/platform/Darwin/PosixConfig.h +++ b/src/platform/Darwin/PosixConfig.h @@ -72,7 +72,6 @@ class PosixConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; static const char kGroupKeyNamePrefix[]; diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index ea66ef9cf92df5..c3bba3235b5569 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -94,12 +94,11 @@ class EFR32Config static constexpr Key kConfigKey_RegulatoryLocation = EFR32ConfigKey(kChipConfig_KeyBase, 0x09); static constexpr Key kConfigKey_CountryCode = EFR32ConfigKey(kChipConfig_KeyBase, 0x0A); static constexpr Key kConfigKey_Breadcrumb = EFR32ConfigKey(kChipConfig_KeyBase, 0x0B); - static constexpr Key kConfigKey_ActiveLocale = EFR32ConfigKey(kChipConfig_KeyBase, 0x0C); - static constexpr Key kConfigKey_WiFiSSID = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); - static constexpr Key kConfigKey_WiFiPSK = EFR32ConfigKey(kChipConfig_KeyBase, 0x0E); - static constexpr Key kConfigKey_WiFiSEC = EFR32ConfigKey(kChipConfig_KeyBase, 0x0F); - static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x10); - static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1F); // Allows 16 Group Keys to be created. + static constexpr Key kConfigKey_WiFiSSID = EFR32ConfigKey(kChipConfig_KeyBase, 0x0C); + static constexpr Key kConfigKey_WiFiPSK = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); + static constexpr Key kConfigKey_WiFiSEC = EFR32ConfigKey(kChipConfig_KeyBase, 0x0E); + static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x0F); + static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1E); // Allows 16 Group Keys to be created. // CHIP Counter Keys static constexpr Key kConfigKey_BootCount = EFR32ConfigKey(kChipCounter_KeyBase, 0x00); diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index 5b2d6ea2f3073e..62fbddfc51ee71 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -71,7 +71,6 @@ const ESP32Config::Key ESP32Config::kConfigKey_FailSafeArmed = { kConfigNam const ESP32Config::Key ESP32Config::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const ESP32Config::Key ESP32Config::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const ESP32Config::Key ESP32Config::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const ESP32Config::Key ESP32Config::kConfigKey_ActiveLocale = { kConfigNamespace_ChipConfig, "active-locale" }; const ESP32Config::Key ESP32Config::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Keys stored in the Chip-counters namespace diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index 75ff577b28c0e6..1f7fdc501b46a8 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -73,7 +73,6 @@ class ESP32Config static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; // CHIP Counter keys diff --git a/src/platform/Linux/ConfigurationManagerImpl.cpp b/src/platform/Linux/ConfigurationManagerImpl.cpp index 6d4282bf0440ca..d536cf672a9dec 100644 --- a/src/platform/Linux/ConfigurationManagerImpl.cpp +++ b/src/platform/Linux/ConfigurationManagerImpl.cpp @@ -106,12 +106,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() SuccessOrExit(err); } - if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_ActiveLocale)) - { - err = WriteConfigValueStr(PosixConfig::kConfigKey_ActiveLocale, "en-US", strlen("en-US")); - SuccessOrExit(err); - } - // If the fail-safe was armed when the device last shutdown, initiate a factory reset. if (GetFailSafeArmed(failSafeArmed) == CHIP_NO_ERROR && failSafeArmed) { diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp index 3c09fa7b7a7808..69242ae05189e8 100644 --- a/src/platform/Linux/PosixConfig.cpp +++ b/src/platform/Linux/PosixConfig.cpp @@ -70,7 +70,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNam const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const PosixConfig::Key PosixConfig::kConfigKey_ActiveLocale = { kConfigNamespace_ChipConfig, "active-locale" }; const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const PosixConfig::Key PosixConfig::kConfigKey_LocationCapability = { kConfigNamespace_ChipConfig, "location-capability" }; diff --git a/src/platform/Linux/PosixConfig.h b/src/platform/Linux/PosixConfig.h index e4361af27e216e..97ab64b80a5d12 100644 --- a/src/platform/Linux/PosixConfig.h +++ b/src/platform/Linux/PosixConfig.h @@ -74,7 +74,6 @@ class PosixConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_LocationCapability; diff --git a/src/platform/P6/P6Config.cpp b/src/platform/P6/P6Config.cpp index a41e744d6eaa17..b44d6f2baf9680 100644 --- a/src/platform/P6/P6Config.cpp +++ b/src/platform/P6/P6Config.cpp @@ -69,7 +69,6 @@ const P6Config::Key P6Config::kConfigKey_FailSafeArmed = { kConfigNamespace const P6Config::Key P6Config::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const P6Config::Key P6Config::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const P6Config::Key P6Config::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const P6Config::Key P6Config::kConfigKey_ActiveLocale = { kConfigNamespace_ChipConfig, "active-locale" }; const P6Config::Key P6Config::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const P6Config::Key P6Config::kConfigKey_WiFiSSID = { kConfigNamespace_ChipConfig, "wifi-ssid" }; const P6Config::Key P6Config::kConfigKey_WiFiPassword = { kConfigNamespace_ChipConfig, "wifi-password" }; diff --git a/src/platform/P6/P6Config.h b/src/platform/P6/P6Config.h index 58981769415557..afadb7087005de 100644 --- a/src/platform/P6/P6Config.h +++ b/src/platform/P6/P6Config.h @@ -74,7 +74,6 @@ class P6Config static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_WiFiSSID; static const Key kConfigKey_WiFiPassword; diff --git a/src/platform/Tizen/PosixConfig.cpp b/src/platform/Tizen/PosixConfig.cpp index 92d0009356d685..61acb6720d83fc 100644 --- a/src/platform/Tizen/PosixConfig.cpp +++ b/src/platform/Tizen/PosixConfig.cpp @@ -67,7 +67,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNam const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; -const PosixConfig::Key PosixConfig::kConfigKey_ActiveLocale = { kConfigNamespace_ChipConfig, "active-locale" }; // Prefix used for NVS keys that contain Chip group encryption keys. const char PosixConfig::kGroupKeyNamePrefix[] = "gk-"; diff --git a/src/platform/Tizen/PosixConfig.h b/src/platform/Tizen/PosixConfig.h index e4beca4391b5b7..6a2c9c5e2f842a 100644 --- a/src/platform/Tizen/PosixConfig.h +++ b/src/platform/Tizen/PosixConfig.h @@ -73,7 +73,6 @@ class PosixConfig static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; static const Key kConfigKey_Breadcrumb; - static const Key kConfigKey_ActiveLocale; static const char kGroupKeyNamePrefix[]; diff --git a/src/platform/Zephyr/ZephyrConfig.cpp b/src/platform/Zephyr/ZephyrConfig.cpp index 2bf321b4582ef3..df687f7471ffbc 100644 --- a/src/platform/Zephyr/ZephyrConfig.cpp +++ b/src/platform/Zephyr/ZephyrConfig.cpp @@ -70,7 +70,6 @@ const ZephyrConfig::Key ZephyrConfig::kConfigKey_LastUsedEpochKeyId = CONFIG_KEY const ZephyrConfig::Key ZephyrConfig::kConfigKey_FailSafeArmed = CONFIG_KEY(NAMESPACE_CONFIG "fail-safe-armed"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_RegulatoryLocation = CONFIG_KEY(NAMESPACE_CONFIG "regulatory-location"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_CountryCode = CONFIG_KEY(NAMESPACE_CONFIG "country-code"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_ActiveLocale = CONFIG_KEY(NAMESPACE_CONFIG "active-locale"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_Breadcrumb = CONFIG_KEY(NAMESPACE_CONFIG "breadcrumb"); // Keys stored in the counters namespace @@ -86,7 +85,7 @@ constexpr const char * sAllResettableConfigKeys[] = { ZephyrConfig::kConfigKey_FabricSecret, ZephyrConfig::kConfigKey_GroupKeyIndex, ZephyrConfig::kConfigKey_LastUsedEpochKeyId, ZephyrConfig::kConfigKey_FailSafeArmed, ZephyrConfig::kConfigKey_RegulatoryLocation, ZephyrConfig::kConfigKey_CountryCode, - ZephyrConfig::kConfigKey_ActiveLocale, ZephyrConfig::kConfigKey_Breadcrumb, + ZephyrConfig::kConfigKey_Breadcrumb, }; // Data structure to be passed as a parameter of Zephyr's settings_load_subtree_direct() function diff --git a/src/platform/Zephyr/ZephyrConfig.h b/src/platform/Zephyr/ZephyrConfig.h index b7e3c63f63da21..9593920a944498 100644 --- a/src/platform/Zephyr/ZephyrConfig.h +++ b/src/platform/Zephyr/ZephyrConfig.h @@ -62,7 +62,6 @@ class ZephyrConfig static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; static const Key kCounterKey_RebootCount; diff --git a/src/platform/android/AndroidConfig.cpp b/src/platform/android/AndroidConfig.cpp index cf6f4d506a9f8b..d02fe792653ef7 100644 --- a/src/platform/android/AndroidConfig.cpp +++ b/src/platform/android/AndroidConfig.cpp @@ -91,7 +91,6 @@ const AndroidConfig::Key AndroidConfig::kConfigKey_FailSafeArmed = { kConfi const AndroidConfig::Key AndroidConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const AndroidConfig::Key AndroidConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const AndroidConfig::Key AndroidConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_ActiveLocale = { kConfigNamespace_ChipConfig, "active-locale" }; const AndroidConfig::Key AndroidConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Prefix used for NVS keys that contain Chip group encryption keys. diff --git a/src/platform/android/AndroidConfig.h b/src/platform/android/AndroidConfig.h index d1c92fe518a166..eac793f25a4b25 100644 --- a/src/platform/android/AndroidConfig.h +++ b/src/platform/android/AndroidConfig.h @@ -76,7 +76,6 @@ class AndroidConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_ProductId; static const Key kConfigKey_ProductName; diff --git a/src/platform/android/java/chip/platform/ConfigurationManager.java b/src/platform/android/java/chip/platform/ConfigurationManager.java index a3aed3df257ecf..4751974356cbae 100644 --- a/src/platform/android/java/chip/platform/ConfigurationManager.java +++ b/src/platform/android/java/chip/platform/ConfigurationManager.java @@ -59,7 +59,6 @@ public interface ConfigurationManager { String kConfigKey_WiFiStationSecType = "sta-sec-type"; String kConfigKey_RegulatoryLocation = "regulatory-location"; String kConfigKey_CountryCode = "country-code"; - String kConfigKey_ActiveLocale = "active-locale"; String kConfigKey_Breadcrumb = "breadcrumb"; // Prefix used for NVS keys that contain Chip group encryption keys. diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp index c934a2e9bb35e4..08c5b9a49260cf 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp @@ -87,14 +87,12 @@ const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_CountryCode = .itemID = 0x001b } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_Breadcrumb = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x001c } }; -const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_ActiveLocale = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, - .itemID = 0x001d } }; /* Internal for the KVS interface. */ const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_KVS_key = { { .systemID = kCC13X2_26X2ChipFactory_Sysid, - .itemID = 0x001e } }; + .itemID = 0x001d } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_KVS_value = { { .systemID = kCC13X2_26X2ChipFactory_Sysid, - .itemID = 0x001f } }; + .itemID = 0x001e } }; /* Static local variables */ static NVINTF_nvFuncts_t sNvoctpFps = { 0 }; diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h index 034a067906fc43..6e3a0f6ca64803 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h @@ -65,7 +65,6 @@ class CC13X2_26X2Config static const Key kConfigKey_WiFiStationSecType; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_KVS_key; // special key for KVS system, key storage static const Key kConfigKey_KVS_value; // special key for KVS system, value storage diff --git a/src/platform/fake/ConfigurationManagerImpl.h b/src/platform/fake/ConfigurationManagerImpl.h index 88d0f452618541..2529c6ac0fdef1 100644 --- a/src/platform/fake/ConfigurationManagerImpl.h +++ b/src/platform/fake/ConfigurationManagerImpl.h @@ -79,9 +79,7 @@ class ConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR GetRegulatoryLocation(uint8_t & location) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreRegulatoryLocation(uint8_t location) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetActiveLocale(char * buf, size_t bufSize, size_t & codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR StoreActiveLocale(const char * code, size_t codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetRebootCount(uint32_t & rebootCount) override { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/platform/mbed/MbedConfig.cpp b/src/platform/mbed/MbedConfig.cpp index 608d732ce61425..ac5e8f43168b62 100644 --- a/src/platform/mbed/MbedConfig.cpp +++ b/src/platform/mbed/MbedConfig.cpp @@ -80,7 +80,6 @@ const MbedConfig::Key MbedConfig::kConfigKey_FailSafeArmed = { CONFIG_KEY(" const MbedConfig::Key MbedConfig::kConfigKey_WiFiStationSecType = { CONFIG_KEY("sta-sec-type") }; const MbedConfig::Key MbedConfig::kConfigKey_RegulatoryLocation = { CONFIG_KEY("regulatory-location") }; const MbedConfig::Key MbedConfig::kConfigKey_CountryCode = { CONFIG_KEY("country-code") }; -const MbedConfig::Key MbedConfig::kConfigKey_ActiveLocale = { CONFIG_KEY("active-locale") }; const MbedConfig::Key MbedConfig::kConfigKey_Breadcrumb = { CONFIG_KEY("breadcrumb") }; CHIP_ERROR MbedConfig::ReadConfigValue(Key key, bool & val) diff --git a/src/platform/mbed/MbedConfig.h b/src/platform/mbed/MbedConfig.h index 21d33df304e140..aeb57463930cbf 100644 --- a/src/platform/mbed/MbedConfig.h +++ b/src/platform/mbed/MbedConfig.h @@ -71,7 +71,6 @@ class MbedConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_ActiveLocale; static const Key kConfigKey_Breadcrumb; // Config value accessors. diff --git a/src/platform/nxp/k32w/k32w0/K32W0Config.h b/src/platform/nxp/k32w/k32w0/K32W0Config.h index b5cf3c6e23c0c4..aad0489c1f512d 100644 --- a/src/platform/nxp/k32w/k32w0/K32W0Config.h +++ b/src/platform/nxp/k32w/k32w0/K32W0Config.h @@ -88,7 +88,6 @@ class K32WConfig static constexpr Key kConfigKey_RegulatoryLocation = K32WConfigKey(kPDMId_ChipConfig, 0x07); static constexpr Key kConfigKey_CountryCode = K32WConfigKey(kPDMId_ChipConfig, 0x08); static constexpr Key kConfigKey_Breadcrumb = K32WConfigKey(kPDMId_ChipConfig, 0x09); - static constexpr Key kConfigKey_ActiveLocale = K32WConfigKey(kPDMId_ChipConfig, 0x0A); // CHIP Counter Keys static constexpr Key kCounterKey_RebootCount = K32WConfigKey(kPDMId_ChipCounter, 0x00); diff --git a/src/platform/qpg/qpgConfig.h b/src/platform/qpg/qpgConfig.h index 7a8079c80914a4..e6584d25b671f4 100644 --- a/src/platform/qpg/qpgConfig.h +++ b/src/platform/qpg/qpgConfig.h @@ -85,7 +85,6 @@ class QPGConfig static constexpr Key kConfigKey_RegulatoryLocation = QorvoConfigKey(kFileId_ChipConfig, 0x09); static constexpr Key kConfigKey_CountryCode = QorvoConfigKey(kFileId_ChipConfig, 0x0A); static constexpr Key kConfigKey_Breadcrumb = QorvoConfigKey(kFileId_ChipConfig, 0x0B); - static constexpr Key kConfigKey_ActiveLocale = QorvoConfigKey(kFileId_ChipConfig, 0x0C); static constexpr Key kConfigKey_GroupKeyBase = QorvoConfigKey(kFileId_ChipConfig, 0x0F); static constexpr Key kConfigKey_GroupKeyMax = QorvoConfigKey(kFileId_ChipConfig, 0x1E); // Allows 16 Group Keys to be created. diff --git a/src/platform/tests/TestConfigurationMgr.cpp b/src/platform/tests/TestConfigurationMgr.cpp index 04d8998271627b..9e05f33b16d589 100644 --- a/src/platform/tests/TestConfigurationMgr.cpp +++ b/src/platform/tests/TestConfigurationMgr.cpp @@ -227,24 +227,6 @@ static void TestConfigurationMgr_GetPrimaryMACAddress(nlTestSuite * inSuite, voi } } -static void TestConfigurationMgr_ActiveLocale(nlTestSuite * inSuite, void * inContext) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - char buf[8]; - size_t activeLocaleLen = 0; - const char * activeLocale = "en-US"; - - err = ConfigurationMgr().StoreActiveLocale(activeLocale, strlen(activeLocale)); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - err = ConfigurationMgr().GetActiveLocale(buf, 8, activeLocaleLen); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - NL_TEST_ASSERT(inSuite, activeLocaleLen == strlen(activeLocale)); - NL_TEST_ASSERT(inSuite, strcmp(buf, activeLocale) == 0); -} - /** * Test Suite. It lists all the test functions. */ @@ -262,7 +244,6 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test ConfigurationMgr::CountryCode", TestConfigurationMgr_CountryCode), NL_TEST_DEF("Test ConfigurationMgr::Breadcrumb", TestConfigurationMgr_Breadcrumb), NL_TEST_DEF("Test ConfigurationMgr::GetPrimaryMACAddress", TestConfigurationMgr_GetPrimaryMACAddress), - NL_TEST_DEF("Test ConfigurationMgr::ActiveLocale", TestConfigurationMgr_ActiveLocale), NL_TEST_SENTINEL() };