From 158910b4aaf2a72babdb4bf4176377c3de50b017 Mon Sep 17 00:00:00 2001 From: Marie Janssen Date: Fri, 25 Mar 2016 13:37:13 -0700 Subject: btif: Don't persist remote devices to the config We don't need to persist the unpaired devices to NVRAM so skip saving them. This fixes a regression in a previous patch where the most recent instead of the least recent devices would be removed, making some devices unpairable in extremely busy environments. This is a backport of http://r.android.com/210955 and http://r.android.com/212838 together. Bug: 26071376 Change-Id: If7ee9d960f70c836bf08b78da5f3fc852ba60a85 --- osi/test/config_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'osi/test/config_test.cpp') diff --git a/osi/test/config_test.cpp b/osi/test/config_test.cpp index 70e5a2494..0419ddc1c 100644 --- a/osi/test/config_test.cpp +++ b/osi/test/config_test.cpp @@ -80,6 +80,19 @@ TEST_F(ConfigTest, config_free_null) { config_free(NULL); } +TEST_F(ConfigTest, config_new_clone) { + config_t *config = config_new(CONFIG_FILE); + config_t *clone = config_new_clone(config); + + config_set_string(clone, CONFIG_DEFAULT_SECTION, "first_key", "not_value"); + + EXPECT_STRNE(config_get_string(config, CONFIG_DEFAULT_SECTION, "first_key", "one"), + config_get_string(clone, CONFIG_DEFAULT_SECTION, "first_key", "one")); + + config_free(config); + config_free(clone); +} + TEST_F(ConfigTest, config_has_section) { config_t *config = config_new(CONFIG_FILE); EXPECT_TRUE(config_has_section(config, "DID")); -- cgit v1.2.3