Loading tools/aapt/AaptConfig.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "AaptAssets.h" #include "AaptUtil.h" #include "ResourceFilter.h" #include "SdkConstants.h" using android::String8; using android::Vector; Loading Loading @@ -241,7 +242,7 @@ void applyVersionForCompatibility(ConfigDescription* config) { uint16_t minSdk = 0; if (config->density == ResTable_config::DENSITY_ANY) { minSdk = SDK_L; minSdk = SDK_LOLLIPOP; } else if (config->smallestScreenWidthDp != ResTable_config::SCREENWIDTH_ANY || config->screenWidthDp != ResTable_config::SCREENWIDTH_ANY || config->screenHeightDp != ResTable_config::SCREENHEIGHT_ANY) { Loading Loading @@ -800,7 +801,7 @@ bool isDensityOnly(const ResTable_config& config) { } if (config.density == ResTable_config::DENSITY_ANY) { if (config.sdkVersion != SDK_L) { if (config.sdkVersion != SDK_LOLLIPOP) { // Someone modified the sdkVersion from the default, this is not safe to assume. return false; } Loading tools/aapt/Bundle.h +1 −12 Original line number Diff line number Diff line Loading @@ -14,18 +14,7 @@ #include <utils/String8.h> #include <utils/Vector.h> enum { SDK_CUPCAKE = 3, SDK_DONUT = 4, SDK_ECLAIR = 5, SDK_ECLAIR_0_1 = 6, SDK_MR1 = 7, SDK_FROYO = 8, SDK_HONEYCOMB_MR2 = 13, SDK_ICE_CREAM_SANDWICH = 14, SDK_ICE_CREAM_SANDWICH_MR1 = 15, SDK_L = 21, }; #include "SdkConstants.h" /* * Things we can do. Loading tools/aapt/ResourceTable.cpp +9 −8 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #include "XMLNode.h" #include "ResourceFilter.h" #include "ResourceIdCache.h" #include "SdkConstants.h" #include <androidfw/ResourceTypes.h> #include <utils/ByteOrder.h> Loading Loading @@ -4223,7 +4224,7 @@ static bool isMinSdkVersionLOrAbove(const Bundle* bundle) { } const int minSdk = atoi(bundle->getMinSdkVersion()); if (minSdk >= SDK_L) { if (minSdk >= SDK_LOLLIPOP) { return true; } } Loading Loading @@ -4314,7 +4315,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { } const ConfigDescription& config = entries.keyAt(ei); if (config.sdkVersion >= SDK_L) { if (config.sdkVersion >= SDK_LOLLIPOP) { // We don't need to do anything if the resource is // already qualified for version 21 or higher. continue; Loading @@ -4336,9 +4337,9 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { } // Duplicate the entry under the same configuration // but with sdkVersion == SDK_L. // but with sdkVersion == SDK_LOLLIPOP. ConfigDescription newConfig(config); newConfig.sdkVersion = SDK_L; newConfig.sdkVersion = SDK_LOLLIPOP; entriesToAdd.add(key_value_pair_t<ConfigDescription, sp<Entry> >( newConfig, new Entry(*e))); Loading @@ -4361,7 +4362,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { if (bundle->getVerbose()) { entriesToAdd[i].value->getPos() .printf("using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.", SDK_L, SDK_LOLLIPOP, String8(p->getName()).string(), String8(t->getName()).string(), String8(entriesToAdd[i].value->getName()).string(), Loading @@ -4388,7 +4389,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle, return NO_ERROR; } if (target->getResourceType() == "" || target->getGroupEntry().toParams().sdkVersion >= SDK_L) { if (target->getResourceType() == "" || target->getGroupEntry().toParams().sdkVersion >= SDK_LOLLIPOP) { // Skip resources that have no type (AndroidManifest.xml) or are already version qualified with v21 // or higher. return NO_ERROR; Loading Loading @@ -4424,7 +4425,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle, } ConfigDescription newConfig(target->getGroupEntry().toParams()); newConfig.sdkVersion = SDK_L; newConfig.sdkVersion = SDK_LOLLIPOP; // Look to see if we already have an overriding v21 configuration. sp<ConfigList> cl = getConfigList(String16(mAssets->getPackage()), Loading @@ -4446,7 +4447,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle, if (bundle->getVerbose()) { SourcePos(target->getSourceFile(), -1).printf( "using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.", SDK_L, SDK_LOLLIPOP, mAssets->getPackage().string(), newFile->getResourceType().string(), String8(resourceName).string(), Loading tools/aapt/SdkConstants.h 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef H_AAPT_SDK_CONSTANTS #define H_AAPT_SDK_CONSTANTS enum { SDK_CUPCAKE = 3, SDK_DONUT = 4, SDK_ECLAIR = 5, SDK_ECLAIR_0_1 = 6, SDK_ECLAIR_MR1 = 7, SDK_FROYO = 8, SDK_GINGERBREAD = 9, SDK_GINGERBREAD_MR1 = 10, SDK_HONEYCOMB = 11, SDK_HONEYCOMB_MR1 = 12, SDK_HONEYCOMB_MR2 = 13, SDK_ICE_CREAM_SANDWICH = 14, SDK_ICE_CREAM_SANDWICH_MR1 = 15, SDK_JELLY_BEAN = 16, SDK_JELLY_BEAN_MR1 = 17, SDK_JELLY_BEAN_MR2 = 18, SDK_KITKAT = 19, SDK_KITKAT_WATCH = 20, SDK_LOLLIPOP = 21, }; #endif // H_AAPT_SDK_CONSTANTS tools/split-select/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ sources := \ testSources := \ Grouper_test.cpp \ Rule_test.cpp \ RuleGenerator_test.cpp RuleGenerator_test.cpp \ TestRules.cpp cIncludes := \ external/zlib \ Loading Loading
tools/aapt/AaptConfig.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "AaptAssets.h" #include "AaptUtil.h" #include "ResourceFilter.h" #include "SdkConstants.h" using android::String8; using android::Vector; Loading Loading @@ -241,7 +242,7 @@ void applyVersionForCompatibility(ConfigDescription* config) { uint16_t minSdk = 0; if (config->density == ResTable_config::DENSITY_ANY) { minSdk = SDK_L; minSdk = SDK_LOLLIPOP; } else if (config->smallestScreenWidthDp != ResTable_config::SCREENWIDTH_ANY || config->screenWidthDp != ResTable_config::SCREENWIDTH_ANY || config->screenHeightDp != ResTable_config::SCREENHEIGHT_ANY) { Loading Loading @@ -800,7 +801,7 @@ bool isDensityOnly(const ResTable_config& config) { } if (config.density == ResTable_config::DENSITY_ANY) { if (config.sdkVersion != SDK_L) { if (config.sdkVersion != SDK_LOLLIPOP) { // Someone modified the sdkVersion from the default, this is not safe to assume. return false; } Loading
tools/aapt/Bundle.h +1 −12 Original line number Diff line number Diff line Loading @@ -14,18 +14,7 @@ #include <utils/String8.h> #include <utils/Vector.h> enum { SDK_CUPCAKE = 3, SDK_DONUT = 4, SDK_ECLAIR = 5, SDK_ECLAIR_0_1 = 6, SDK_MR1 = 7, SDK_FROYO = 8, SDK_HONEYCOMB_MR2 = 13, SDK_ICE_CREAM_SANDWICH = 14, SDK_ICE_CREAM_SANDWICH_MR1 = 15, SDK_L = 21, }; #include "SdkConstants.h" /* * Things we can do. Loading
tools/aapt/ResourceTable.cpp +9 −8 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #include "XMLNode.h" #include "ResourceFilter.h" #include "ResourceIdCache.h" #include "SdkConstants.h" #include <androidfw/ResourceTypes.h> #include <utils/ByteOrder.h> Loading Loading @@ -4223,7 +4224,7 @@ static bool isMinSdkVersionLOrAbove(const Bundle* bundle) { } const int minSdk = atoi(bundle->getMinSdkVersion()); if (minSdk >= SDK_L) { if (minSdk >= SDK_LOLLIPOP) { return true; } } Loading Loading @@ -4314,7 +4315,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { } const ConfigDescription& config = entries.keyAt(ei); if (config.sdkVersion >= SDK_L) { if (config.sdkVersion >= SDK_LOLLIPOP) { // We don't need to do anything if the resource is // already qualified for version 21 or higher. continue; Loading @@ -4336,9 +4337,9 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { } // Duplicate the entry under the same configuration // but with sdkVersion == SDK_L. // but with sdkVersion == SDK_LOLLIPOP. ConfigDescription newConfig(config); newConfig.sdkVersion = SDK_L; newConfig.sdkVersion = SDK_LOLLIPOP; entriesToAdd.add(key_value_pair_t<ConfigDescription, sp<Entry> >( newConfig, new Entry(*e))); Loading @@ -4361,7 +4362,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { if (bundle->getVerbose()) { entriesToAdd[i].value->getPos() .printf("using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.", SDK_L, SDK_LOLLIPOP, String8(p->getName()).string(), String8(t->getName()).string(), String8(entriesToAdd[i].value->getName()).string(), Loading @@ -4388,7 +4389,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle, return NO_ERROR; } if (target->getResourceType() == "" || target->getGroupEntry().toParams().sdkVersion >= SDK_L) { if (target->getResourceType() == "" || target->getGroupEntry().toParams().sdkVersion >= SDK_LOLLIPOP) { // Skip resources that have no type (AndroidManifest.xml) or are already version qualified with v21 // or higher. return NO_ERROR; Loading Loading @@ -4424,7 +4425,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle, } ConfigDescription newConfig(target->getGroupEntry().toParams()); newConfig.sdkVersion = SDK_L; newConfig.sdkVersion = SDK_LOLLIPOP; // Look to see if we already have an overriding v21 configuration. sp<ConfigList> cl = getConfigList(String16(mAssets->getPackage()), Loading @@ -4446,7 +4447,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle, if (bundle->getVerbose()) { SourcePos(target->getSourceFile(), -1).printf( "using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.", SDK_L, SDK_LOLLIPOP, mAssets->getPackage().string(), newFile->getResourceType().string(), String8(resourceName).string(), Loading
tools/aapt/SdkConstants.h 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef H_AAPT_SDK_CONSTANTS #define H_AAPT_SDK_CONSTANTS enum { SDK_CUPCAKE = 3, SDK_DONUT = 4, SDK_ECLAIR = 5, SDK_ECLAIR_0_1 = 6, SDK_ECLAIR_MR1 = 7, SDK_FROYO = 8, SDK_GINGERBREAD = 9, SDK_GINGERBREAD_MR1 = 10, SDK_HONEYCOMB = 11, SDK_HONEYCOMB_MR1 = 12, SDK_HONEYCOMB_MR2 = 13, SDK_ICE_CREAM_SANDWICH = 14, SDK_ICE_CREAM_SANDWICH_MR1 = 15, SDK_JELLY_BEAN = 16, SDK_JELLY_BEAN_MR1 = 17, SDK_JELLY_BEAN_MR2 = 18, SDK_KITKAT = 19, SDK_KITKAT_WATCH = 20, SDK_LOLLIPOP = 21, }; #endif // H_AAPT_SDK_CONSTANTS
tools/split-select/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ sources := \ testSources := \ Grouper_test.cpp \ Rule_test.cpp \ RuleGenerator_test.cpp RuleGenerator_test.cpp \ TestRules.cpp cIncludes := \ external/zlib \ Loading