diff options
author | Elliott Hughes | 2017-12-20 14:36:31 -0600 |
---|---|---|
committer | Elliott Hughes | 2017-12-20 14:36:31 -0600 |
commit | 1d65c95fe8284c7b97823c4a719505d773fcea55 (patch) | |
tree | 576ea15da50d8081d937a15b194b675f0f221057 | |
parent | 3fe230a1e47863e43fec629a2cfe1f51915e9f32 (diff) | |
download | platform-bootable-recovery-1d65c95fe8284c7b97823c4a719505d773fcea55.tar.gz platform-bootable-recovery-1d65c95fe8284c7b97823c4a719505d773fcea55.tar.xz platform-bootable-recovery-1d65c95fe8284c7b97823c4a719505d773fcea55.zip |
StartsWith allows a std::string prefix now.
Bug: N/A
Test: builds
Change-Id: I5183ec8133f5dc9a81a438223c6d3d2ea11ef0ec
-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 837f5ebc..52ab60b1 100644 --- a/minui/resources.cpp +++ b/minui/resources.cpp | |||
@@ -397,7 +397,7 @@ bool matches_locale(const std::string& prefix, const std::string& locale) { | |||
397 | // match the locale string without the {script} section. | 397 | // match the locale string without the {script} section. |
398 | // For instance, prefix == "en" matches locale == "en-US", prefix == "sr-Latn" matches locale | 398 | // For instance, prefix == "en" matches locale == "en-US", prefix == "sr-Latn" matches locale |
399 | // == "sr-Latn-BA", and prefix == "zh-CN" matches locale == "zh-Hans-CN". | 399 | // == "sr-Latn-BA", and prefix == "zh-CN" matches locale == "zh-Hans-CN". |
400 | if (android::base::StartsWith(locale, prefix.c_str())) { | 400 | if (android::base::StartsWith(locale, prefix)) { |
401 | return true; | 401 | return true; |
402 | } | 402 | } |
403 | 403 | ||
diff --git a/tests/manual/recovery_test.cpp b/tests/manual/recovery_test.cpp index 92c6ef2d..64e3b59e 100644 --- a/tests/manual/recovery_test.cpp +++ b/tests/manual/recovery_test.cpp | |||
@@ -209,7 +209,7 @@ TEST_P(ResourceTest, ValidateLocale) { | |||
209 | ASSERT_GT(height, y + 1 + h) << "Locale: " << kLocale << " is not found in the file."; | 209 | ASSERT_GT(height, y + 1 + h) << "Locale: " << kLocale << " is not found in the file."; |
210 | char* loc = reinterpret_cast<char*>(&row[5]); | 210 | char* loc = reinterpret_cast<char*>(&row[5]); |
211 | if (matches_locale(loc, kLocale.c_str())) { | 211 | if (matches_locale(loc, kLocale.c_str())) { |
212 | EXPECT_TRUE(android::base::StartsWith(loc, kLocale.c_str())); | 212 | EXPECT_TRUE(android::base::StartsWith(loc, kLocale)); |
213 | break; | 213 | break; |
214 | } else { | 214 | } else { |
215 | for (int i = 0; i < h; ++i, ++y) { | 215 | for (int i = 0; i < h; ++i, ++y) { |