diff options
author | Elliott Hughes <enh@google.com> | 2017-12-21 07:14:28 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-12-21 07:14:28 +0100 |
commit | bd870377b47284ce2aeee1ec094f1fd33a6955d5 (patch) | |
tree | 576ea15da50d8081d937a15b194b675f0f221057 | |
parent | Merge "Let update_verifier work on non-AB update devices" (diff) | |
parent | Merge "StartsWith allows a std::string prefix now." (diff) | |
download | android_bootable_recovery-bd870377b47284ce2aeee1ec094f1fd33a6955d5.tar android_bootable_recovery-bd870377b47284ce2aeee1ec094f1fd33a6955d5.tar.gz android_bootable_recovery-bd870377b47284ce2aeee1ec094f1fd33a6955d5.tar.bz2 android_bootable_recovery-bd870377b47284ce2aeee1ec094f1fd33a6955d5.tar.lz android_bootable_recovery-bd870377b47284ce2aeee1ec094f1fd33a6955d5.tar.xz android_bootable_recovery-bd870377b47284ce2aeee1ec094f1fd33a6955d5.tar.zst android_bootable_recovery-bd870377b47284ce2aeee1ec094f1fd33a6955d5.zip |
-rw-r--r-- | minui/resources.cpp | 2 | ||||
-rw-r--r-- | tests/manual/recovery_test.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/minui/resources.cpp b/minui/resources.cpp index 837f5ebca..52ab60b1b 100644 --- a/minui/resources.cpp +++ b/minui/resources.cpp @@ -397,7 +397,7 @@ bool matches_locale(const std::string& prefix, const std::string& locale) { // match the locale string without the {script} section. // For instance, prefix == "en" matches locale == "en-US", prefix == "sr-Latn" matches locale // == "sr-Latn-BA", and prefix == "zh-CN" matches locale == "zh-Hans-CN". - if (android::base::StartsWith(locale, prefix.c_str())) { + if (android::base::StartsWith(locale, prefix)) { return true; } diff --git a/tests/manual/recovery_test.cpp b/tests/manual/recovery_test.cpp index 92c6ef2d4..64e3b59e6 100644 --- a/tests/manual/recovery_test.cpp +++ b/tests/manual/recovery_test.cpp @@ -209,7 +209,7 @@ TEST_P(ResourceTest, ValidateLocale) { ASSERT_GT(height, y + 1 + h) << "Locale: " << kLocale << " is not found in the file."; char* loc = reinterpret_cast<char*>(&row[5]); if (matches_locale(loc, kLocale.c_str())) { - EXPECT_TRUE(android::base::StartsWith(loc, kLocale.c_str())); + EXPECT_TRUE(android::base::StartsWith(loc, kLocale)); break; } else { for (int i = 0; i < h; ++i, ++y) { |