diff options
| author | 2015-02-10 16:11:55 +0000 | |
|---|---|---|
| committer | 2015-02-10 16:11:55 +0000 | |
| commit | 7f1a8957cca420d525719836069b7f6d5ee04718 (patch) | |
| tree | 7a1b1296267ba7429581f1bd854dcc9192dfc315 | |
| parent | 3ec5f97ac5705d5fe2c7ceb7b61a4df5f18b980f (diff) | |
Parse res-car as resources for UI_MODE_TYPE_CAR..
.. and not a 3 letter language code.
bug: 19291216
Change-Id: I01bf76d89880693dcdb4384d5c239902fa3defa8
| -rw-r--r-- | tools/aapt/AaptAssets.cpp | 3 | ||||
| -rw-r--r-- | tools/aapt/tests/AaptConfig_test.cpp | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp index 2d351294c515..871e04f7aa9d 100644 --- a/tools/aapt/AaptAssets.cpp +++ b/tools/aapt/AaptAssets.cpp @@ -345,7 +345,8 @@ int AaptLocaleValue::initFromDirName(const Vector<String8>& parts, const int sta return ++currentIndex; } else { - if ((part.length() == 2 || part.length() == 3) && isAlpha(part)) { + if ((part.length() == 2 || part.length() == 3) + && isAlpha(part) && strcmp("car", part.string())) { setLanguage(part); if (++currentIndex == size) { return size; diff --git a/tools/aapt/tests/AaptConfig_test.cpp b/tools/aapt/tests/AaptConfig_test.cpp index e795d81836bd..ef3860c72921 100644 --- a/tools/aapt/tests/AaptConfig_test.cpp +++ b/tools/aapt/tests/AaptConfig_test.cpp @@ -76,3 +76,9 @@ TEST(AaptConfigTest, ParseQualifierAddedInApi13) { EXPECT_TRUE(TestParse("sw600dp-v8", &config)); EXPECT_EQ(String8("sw600dp-v13"), config.toString()); } + +TEST(AaptConfigTest, TestParsingOfCarAttribute) { + ConfigDescription config; + EXPECT_TRUE(TestParse("car", &config)); + EXPECT_EQ(android::ResTable_config::UI_MODE_TYPE_CAR, config.uiMode); +} |