diff options
author | Marie Janssen <jamuraa@google.com> | 2016-03-25 13:37:13 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2016-04-21 19:11:31 -0700 |
commit | 158910b4aaf2a72babdb4bf4176377c3de50b017 (patch) | |
tree | 8d8336037d20e9a5fc9463ba7292356716540167 /osi/test/config_test.cpp | |
parent | 9b534de2aca5d790c2a1c4d76b545f16137d95dd (diff) | |
download | android_system_bt-158910b4aaf2a72babdb4bf4176377c3de50b017.tar.gz android_system_bt-158910b4aaf2a72babdb4bf4176377c3de50b017.tar.bz2 android_system_bt-158910b4aaf2a72babdb4bf4176377c3de50b017.zip |
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
Diffstat (limited to 'osi/test/config_test.cpp')
-rw-r--r-- | osi/test/config_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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")); |