resolved conflicts for merge of 701f9c2f to stage-aosp-master

Change-Id: I42e0411c0acef4b15137491ecaaed95d9b1cd0c1
This commit is contained in:
Dan Albert
2015-03-05 15:41:39 -08:00
3 changed files with 19 additions and 26 deletions

View File

@@ -481,8 +481,9 @@ static void get_outline(image_info* image)
// assuming the image is a round rect, compute the radius by marching
// diagonally from the top left corner towards the center
image->outlineAlpha = max(max_alpha_over_row(image->rows[innerMidY], innerStartX, innerEndX),
max_alpha_over_col(image->rows, innerMidX, innerStartY, innerStartY));
image->outlineAlpha = std::max(
max_alpha_over_row(image->rows[innerMidY], innerStartX, innerEndX),
max_alpha_over_col(image->rows, innerMidX, innerStartY, innerStartY));
int diagonalInset = 0;
find_max_opacity(image->rows, innerStartX, innerStartY, innerMidX, innerMidY, 1, 1,

View File

@@ -1807,7 +1807,7 @@ status_t ResourceTable::addIncludedResources(Bundle* bundle, const sp<AaptAssets
}
const ResTable& featureTable = featureAssetManager.getResources(false);
mTypeIdOffset = max(mTypeIdOffset,
mTypeIdOffset = std::max(mTypeIdOffset,
findLargestTypeIdForPackage(featureTable, mAssetsPackage));
}
@@ -2703,20 +2703,16 @@ ResourceTable::validateLocalizations(void)
const String8 defaultLocale;
// For all strings...
for (map<String16, map<String8, SourcePos> >::iterator nameIter = mLocalizations.begin();
nameIter != mLocalizations.end();
nameIter++) {
const map<String8, SourcePos>& configSrcMap = nameIter->second;
for (const auto& nameIter : mLocalizations) {
const std::map<String8, SourcePos>& configSrcMap = nameIter.second;
// Look for strings with no default localization
if (configSrcMap.count(defaultLocale) == 0) {
SourcePos().warning("string '%s' has no default translation.",
String8(nameIter->first).string());
String8(nameIter.first).string());
if (mBundle->getVerbose()) {
for (map<String8, SourcePos>::const_iterator locales = configSrcMap.begin();
locales != configSrcMap.end();
locales++) {
locales->second.printf("locale %s found", locales->first.string());
for (const auto& locale : configSrcMap) {
locale.second.printf("locale %s found", locale.first.string());
}
}
// !!! TODO: throw an error here in some circumstances
@@ -2727,8 +2723,8 @@ ResourceTable::validateLocalizations(void)
const char* allConfigs = mBundle->getConfigurations().string();
const char* start = allConfigs;
const char* comma;
set<String8> missingConfigs;
std::set<String8> missingConfigs;
AaptLocaleValue locale;
do {
String8 config;
@@ -2762,13 +2758,11 @@ ResourceTable::validateLocalizations(void)
if (!missingConfigs.empty()) {
String8 configStr;
for (set<String8>::iterator iter = missingConfigs.begin();
iter != missingConfigs.end();
iter++) {
configStr.appendFormat(" %s", iter->string());
for (const auto& iter : missingConfigs) {
configStr.appendFormat(" %s", iter.string());
}
SourcePos().warning("string '%s' is missing %u required localizations:%s",
String8(nameIter->first).string(),
String8(nameIter.first).string(),
(unsigned int)missingConfigs.size(),
configStr.string());
}

View File

@@ -17,8 +17,6 @@
#include "StringPool.h"
#include "Symbol.h"
using namespace std;
class XMLNode;
class ResourceTable;
@@ -29,7 +27,7 @@ enum {
XML_COMPILE_STRIP_WHITESPACE = 1<<3,
XML_COMPILE_STRIP_RAW_VALUES = 1<<4,
XML_COMPILE_UTF8 = 1<<5,
XML_COMPILE_STANDARD_RESOURCE =
XML_COMPILE_STRIP_COMMENTS | XML_COMPILE_ASSIGN_ATTRIBUTE_IDS
| XML_COMPILE_STRIP_WHITESPACE | XML_COMPILE_STRIP_RAW_VALUES
@@ -116,7 +114,7 @@ public:
* and would mess up iteration order for the existing
* resources.
*/
queue<CompileResourceWorkItem>& getWorkQueue() {
std::queue<CompileResourceWorkItem>& getWorkQueue() {
return mWorkQueue;
}
@@ -587,10 +585,10 @@ private:
size_t mNumLocal;
SourcePos mCurrentXmlPos;
Bundle* mBundle;
// key = string resource name, value = set of locales in which that name is defined
map<String16, map<String8, SourcePos> > mLocalizations;
queue<CompileResourceWorkItem> mWorkQueue;
std::map<String16, std::map<String8, SourcePos>> mLocalizations;
std::queue<CompileResourceWorkItem> mWorkQueue;
};
#endif