resolve merge conflicts of 17bd236
to stage-aosp-master
am: b3d46b44a3
Change-Id: I5123493e165c4d2ab74cf045e5fb8181886dce62
This commit is contained in:
@ -32,7 +32,7 @@ class AaptFile;
|
|||||||
|
|
||||||
class ApkBuilder : public android::RefBase {
|
class ApkBuilder : public android::RefBase {
|
||||||
public:
|
public:
|
||||||
ApkBuilder(const sp<WeakResourceFilter>& configFilter);
|
explicit ApkBuilder(const sp<WeakResourceFilter>& configFilter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells the builder to generate a separate APK for resources that
|
* Tells the builder to generate a separate APK for resources that
|
||||||
|
@ -51,7 +51,7 @@ private:
|
|||||||
class SystemCacheUpdater : public CacheUpdater {
|
class SystemCacheUpdater : public CacheUpdater {
|
||||||
public:
|
public:
|
||||||
// Constructor to set bundle to pass to preProcessImage
|
// Constructor to set bundle to pass to preProcessImage
|
||||||
SystemCacheUpdater (Bundle* b)
|
explicit SystemCacheUpdater (Bundle* b)
|
||||||
: bundle(b) { };
|
: bundle(b) { };
|
||||||
|
|
||||||
// Make sure all the directories along this path exist
|
// Make sure all the directories along this path exist
|
||||||
|
@ -248,7 +248,7 @@ bail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void printResolvedResourceAttribute(const ResTable& resTable, const ResXMLTree& tree,
|
static void printResolvedResourceAttribute(const ResTable& resTable, const ResXMLTree& tree,
|
||||||
uint32_t attrRes, String8 attrLabel, String8* outError)
|
uint32_t attrRes, const String8& attrLabel, String8* outError)
|
||||||
{
|
{
|
||||||
Res_value value;
|
Res_value value;
|
||||||
AaptXml::getResolvedResourceAttribute(resTable, tree, attrRes, &value, outError);
|
AaptXml::getResolvedResourceAttribute(resTable, tree, attrRes, &value, outError);
|
||||||
@ -399,7 +399,7 @@ static void printUsesImpliedPermission(const String8& name, const String8& reaso
|
|||||||
ResTable::normalizeForOutput(reason.string()).string());
|
ResTable::normalizeForOutput(reason.string()).string());
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<String8> getNfcAidCategories(AssetManager& assets, String8 xmlPath, bool offHost,
|
Vector<String8> getNfcAidCategories(AssetManager& assets, const String8& xmlPath, bool offHost,
|
||||||
String8 *outError = NULL)
|
String8 *outError = NULL)
|
||||||
{
|
{
|
||||||
Asset* aidAsset = assets.openNonAsset(xmlPath, Asset::ACCESS_BUFFER);
|
Asset* aidAsset = assets.openNonAsset(xmlPath, Asset::ACCESS_BUFFER);
|
||||||
|
@ -29,7 +29,7 @@ struct ConfigDescription : public android::ResTable_config {
|
|||||||
size = sizeof(android::ResTable_config);
|
size = sizeof(android::ResTable_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigDescription(const android::ResTable_config&o) {
|
ConfigDescription(const android::ResTable_config&o) { // NOLINT(implicit)
|
||||||
*static_cast<android::ResTable_config*>(this) = o;
|
*static_cast<android::ResTable_config*>(this) = o;
|
||||||
size = sizeof(android::ResTable_config);
|
size = sizeof(android::ResTable_config);
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ void CrunchCache::loadFiles()
|
|||||||
delete dw;
|
delete dw;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CrunchCache::needsUpdating(String8 relativePath) const
|
bool CrunchCache::needsUpdating(const String8& relativePath) const
|
||||||
{
|
{
|
||||||
// Retrieve modification dates for this file entry under the source and
|
// Retrieve modification dates for this file entry under the source and
|
||||||
// cache directory trees. The vectors will return a modification date of 0
|
// cache directory trees. The vectors will return a modification date of 0
|
||||||
|
@ -81,7 +81,7 @@ private:
|
|||||||
* // Recrunch sourceFile out to destFile.
|
* // Recrunch sourceFile out to destFile.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool needsUpdating(String8 relativePath) const;
|
bool needsUpdating(const String8& relativePath) const;
|
||||||
|
|
||||||
// DATA MEMBERS ====================================================
|
// DATA MEMBERS ====================================================
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ bool SystemFileFinder::findFiles(String8 basePath, Vector<String8>& extensions,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemFileFinder::checkAndAddFile(String8 path, const struct stat* stats,
|
void SystemFileFinder::checkAndAddFile(const String8& path, const struct stat* stats,
|
||||||
Vector<String8>& extensions,
|
Vector<String8>& extensions,
|
||||||
KeyedVector<String8,time_t>& fileStore)
|
KeyedVector<String8,time_t>& fileStore)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ private:
|
|||||||
* time as the value.
|
* time as the value.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void checkAndAddFile(String8 path, const struct stat* stats,
|
static void checkAndAddFile(const String8& path, const struct stat* stats,
|
||||||
Vector<String8>& extensions,
|
Vector<String8>& extensions,
|
||||||
KeyedVector<String8,time_t>& fileStore);
|
KeyedVector<String8,time_t>& fileStore);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
class IndentPrinter {
|
class IndentPrinter {
|
||||||
public:
|
public:
|
||||||
IndentPrinter(FILE* stream, int indentSize=2)
|
explicit IndentPrinter(FILE* stream, int indentSize=2)
|
||||||
: mStream(stream)
|
: mStream(stream)
|
||||||
, mIndentSize(indentSize)
|
, mIndentSize(indentSize)
|
||||||
, mIndent(0)
|
, mIndent(0)
|
||||||
|
@ -394,7 +394,7 @@ static void collect_files(const sp<AaptDir>& dir,
|
|||||||
const DefaultKeyedVector<String8, sp<AaptGroup> >& groups = dir->getFiles();
|
const DefaultKeyedVector<String8, sp<AaptGroup> >& groups = dir->getFiles();
|
||||||
int N = groups.size();
|
int N = groups.size();
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
String8 leafName = groups.keyAt(i);
|
const String8& leafName = groups.keyAt(i);
|
||||||
const sp<AaptGroup>& group = groups.valueAt(i);
|
const sp<AaptGroup>& group = groups.valueAt(i);
|
||||||
|
|
||||||
const DefaultKeyedVector<AaptGroupEntry, sp<AaptFile> >& files
|
const DefaultKeyedVector<AaptGroupEntry, sp<AaptFile> >& files
|
||||||
@ -417,7 +417,7 @@ static void collect_files(const sp<AaptDir>& dir,
|
|||||||
set->add(leafName, group);
|
set->add(leafName, group);
|
||||||
resources->add(resType, set);
|
resources->add(resType, set);
|
||||||
} else {
|
} else {
|
||||||
sp<ResourceTypeSet> set = resources->valueAt(index);
|
const sp<ResourceTypeSet>& set = resources->valueAt(index);
|
||||||
index = set->indexOfKey(leafName);
|
index = set->indexOfKey(leafName);
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
if (kIsDebug) {
|
if (kIsDebug) {
|
||||||
@ -452,7 +452,7 @@ static void collect_files(const sp<AaptAssets>& ass,
|
|||||||
int N = dirs.size();
|
int N = dirs.size();
|
||||||
|
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
sp<AaptDir> d = dirs.itemAt(i);
|
const sp<AaptDir>& d = dirs.itemAt(i);
|
||||||
if (kIsDebug) {
|
if (kIsDebug) {
|
||||||
printf("Collecting dir #%d %p: %s, leaf %s\n", i, d.get(), d->getPath().string(),
|
printf("Collecting dir #%d %p: %s, leaf %s\n", i, d.get(), d->getPath().string(),
|
||||||
d->getLeaf().string());
|
d->getLeaf().string());
|
||||||
@ -610,7 +610,7 @@ static bool applyFileOverlay(Bundle *bundle,
|
|||||||
// get the overlay resources of the requested type
|
// get the overlay resources of the requested type
|
||||||
ssize_t index = overlayRes->indexOfKey(resTypeString);
|
ssize_t index = overlayRes->indexOfKey(resTypeString);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
sp<ResourceTypeSet> overlaySet = overlayRes->valueAt(index);
|
const sp<ResourceTypeSet>& overlaySet = overlayRes->valueAt(index);
|
||||||
|
|
||||||
// for each of the resources, check for a match in the previously built
|
// for each of the resources, check for a match in the previously built
|
||||||
// non-overlay "baseset".
|
// non-overlay "baseset".
|
||||||
@ -760,7 +760,7 @@ bool addTagAttribute(const sp<XMLNode>& node, const char* ns8,
|
|||||||
return addTagAttribute(node, ns8, attr8, value, errorOnFailedInsert, false);
|
return addTagAttribute(node, ns8, attr8, value, errorOnFailedInsert, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fullyQualifyClassName(const String8& package, sp<XMLNode> node,
|
static void fullyQualifyClassName(const String8& package, const sp<XMLNode>& node,
|
||||||
const String16& attrName) {
|
const String16& attrName) {
|
||||||
XMLNode::attribute_entry* attr = node->editAttribute(
|
XMLNode::attribute_entry* attr = node->editAttribute(
|
||||||
String16("http://schemas.android.com/apk/res/android"), attrName);
|
String16("http://schemas.android.com/apk/res/android"), attrName);
|
||||||
@ -1345,7 +1345,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil
|
|||||||
ResourceDirIterator it(resources->valueAt(index), String8("values"));
|
ResourceDirIterator it(resources->valueAt(index), String8("values"));
|
||||||
ssize_t res;
|
ssize_t res;
|
||||||
while ((res=it.next()) == NO_ERROR) {
|
while ((res=it.next()) == NO_ERROR) {
|
||||||
sp<AaptFile> file = it.getFile();
|
const sp<AaptFile>& file = it.getFile();
|
||||||
res = compileResourceFile(bundle, assets, file, it.getParams(),
|
res = compileResourceFile(bundle, assets, file, it.getParams(),
|
||||||
(current!=assets), &table);
|
(current!=assets), &table);
|
||||||
if (res != NO_ERROR) {
|
if (res != NO_ERROR) {
|
||||||
@ -2679,7 +2679,7 @@ status_t writeResourceSymbols(Bundle* bundle, const sp<AaptAssets>& assets,
|
|||||||
String8 dest(bundle->getRClassDir());
|
String8 dest(bundle->getRClassDir());
|
||||||
|
|
||||||
if (bundle->getMakePackageDirs()) {
|
if (bundle->getMakePackageDirs()) {
|
||||||
String8 pkg(package);
|
const String8& pkg(package);
|
||||||
const char* last = pkg.string();
|
const char* last = pkg.string();
|
||||||
const char* s = last-1;
|
const char* s = last-1;
|
||||||
do {
|
do {
|
||||||
|
@ -78,7 +78,7 @@ private:
|
|||||||
class StrongResourceFilter : public ResourceFilter {
|
class StrongResourceFilter : public ResourceFilter {
|
||||||
public:
|
public:
|
||||||
StrongResourceFilter() {}
|
StrongResourceFilter() {}
|
||||||
StrongResourceFilter(const std::set<ConfigDescription>& configs)
|
explicit StrongResourceFilter(const std::set<ConfigDescription>& configs)
|
||||||
: mConfigs(configs) {}
|
: mConfigs(configs) {}
|
||||||
|
|
||||||
android::status_t parse(const android::String8& str);
|
android::status_t parse(const android::String8& str);
|
||||||
@ -106,7 +106,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
class InverseResourceFilter : public ResourceFilter {
|
class InverseResourceFilter : public ResourceFilter {
|
||||||
public:
|
public:
|
||||||
InverseResourceFilter(const android::sp<ResourceFilter>& filter)
|
explicit InverseResourceFilter(const android::sp<ResourceFilter>& filter)
|
||||||
: mFilter(filter) {}
|
: mFilter(filter) {}
|
||||||
|
|
||||||
bool match(const android::ResTable_config& config) const {
|
bool match(const android::ResTable_config& config) const {
|
||||||
|
@ -4073,7 +4073,7 @@ status_t ResourceTable::Type::applyPublicEntryOrder()
|
|||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
for (i=0; i<N; i++) {
|
for (i=0; i<N; i++) {
|
||||||
sp<ConfigList> e = origOrder.itemAt(i);
|
const sp<ConfigList>& e = origOrder.itemAt(i);
|
||||||
// There will always be enough room for the remaining entries.
|
// There will always be enough room for the remaining entries.
|
||||||
while (mOrderedConfigs.itemAt(j) != NULL) {
|
while (mOrderedConfigs.itemAt(j) != NULL) {
|
||||||
j++;
|
j++;
|
||||||
@ -4195,7 +4195,7 @@ status_t ResourceTable::Package::applyPublicTypeOrder()
|
|||||||
|
|
||||||
size_t j=0;
|
size_t j=0;
|
||||||
for (i=0; i<N; i++) {
|
for (i=0; i<N; i++) {
|
||||||
sp<Type> t = origOrder.itemAt(i);
|
const sp<Type>& t = origOrder.itemAt(i);
|
||||||
// There will always be enough room for the remaining types.
|
// There will always be enough room for the remaining types.
|
||||||
while (mOrderedTypes.itemAt(j) != NULL) {
|
while (mOrderedTypes.itemAt(j) != NULL) {
|
||||||
j++;
|
j++;
|
||||||
@ -4627,7 +4627,7 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) {
|
|||||||
c->getEntries();
|
c->getEntries();
|
||||||
const size_t entryCount = entries.size();
|
const size_t entryCount = entries.size();
|
||||||
for (size_t ei = 0; ei < entryCount; ei++) {
|
for (size_t ei = 0; ei < entryCount; ei++) {
|
||||||
sp<Entry> e = entries.valueAt(ei);
|
const sp<Entry>& e = entries.valueAt(ei);
|
||||||
if (e == NULL || e->getType() != Entry::TYPE_BAG) {
|
if (e == NULL || e->getType() != Entry::TYPE_BAG) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class StringPool
|
|||||||
public:
|
public:
|
||||||
struct entry {
|
struct entry {
|
||||||
entry() : offset(0) { }
|
entry() : offset(0) { }
|
||||||
entry(const String16& _value) : value(_value), offset(0), hasStyles(false) { }
|
explicit entry(const String16& _value) : value(_value), offset(0), hasStyles(false) { }
|
||||||
entry(const entry& o) : value(o.value), offset(o.offset),
|
entry(const entry& o) : value(o.value), offset(o.offset),
|
||||||
hasStyles(o.hasStyles), indices(o.indices),
|
hasStyles(o.hasStyles), indices(o.indices),
|
||||||
configTypeName(o.configTypeName), configs(o.configs) { }
|
configTypeName(o.configTypeName), configs(o.configs) { }
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Creates a work queue with the specified maximum number of work threads. */
|
/* Creates a work queue with the specified maximum number of work threads. */
|
||||||
WorkQueue(size_t maxThreads, bool canCallJava = true);
|
explicit WorkQueue(size_t maxThreads, bool canCallJava = true);
|
||||||
|
|
||||||
/* Destroys the work queue.
|
/* Destroys the work queue.
|
||||||
* Cancels pending work and waits for all remaining threads to complete.
|
* Cancels pending work and waits for all remaining threads to complete.
|
||||||
|
@ -67,7 +67,7 @@ static const String16 RESOURCES_PREFIX_AUTO_PACKAGE(RESOURCES_AUTO_PACKAGE_NAMES
|
|||||||
static const String16 RESOURCES_PRV_PREFIX(RESOURCES_ROOT_PRV_NAMESPACE);
|
static const String16 RESOURCES_PRV_PREFIX(RESOURCES_ROOT_PRV_NAMESPACE);
|
||||||
static const String16 RESOURCES_TOOLS_NAMESPACE("http://schemas.android.com/tools");
|
static const String16 RESOURCES_TOOLS_NAMESPACE("http://schemas.android.com/tools");
|
||||||
|
|
||||||
String16 getNamespaceResourcePackage(String16 appPackage, String16 namespaceUri, bool* outIsPublic)
|
String16 getNamespaceResourcePackage(const String16& appPackage, const String16& namespaceUri, bool* outIsPublic)
|
||||||
{
|
{
|
||||||
//printf("%s starts with %s?\n", String8(namespaceUri).string(),
|
//printf("%s starts with %s?\n", String8(namespaceUri).string(),
|
||||||
// String8(RESOURCES_PREFIX).string());
|
// String8(RESOURCES_PREFIX).string());
|
||||||
@ -98,7 +98,7 @@ String16 getNamespaceResourcePackage(String16 appPackage, String16 namespaceUri,
|
|||||||
|
|
||||||
status_t hasSubstitutionErrors(const char* fileName,
|
status_t hasSubstitutionErrors(const char* fileName,
|
||||||
ResXMLTree* inXml,
|
ResXMLTree* inXml,
|
||||||
String16 str16)
|
const String16& str16)
|
||||||
{
|
{
|
||||||
const char16_t* str = str16.string();
|
const char16_t* str = str16.string();
|
||||||
const char16_t* p = str;
|
const char16_t* p = str;
|
||||||
|
@ -178,7 +178,7 @@ private:
|
|||||||
XMLNode(const String8& filename, const String16& s1, const String16& s2, bool isNamespace);
|
XMLNode(const String8& filename, const String16& s1, const String16& s2, bool isNamespace);
|
||||||
|
|
||||||
// Creating a CDATA node.
|
// Creating a CDATA node.
|
||||||
XMLNode(const String8& filename);
|
explicit XMLNode(const String8& filename);
|
||||||
|
|
||||||
status_t collect_strings(StringPool* dest, Vector<uint32_t>* outResIds,
|
status_t collect_strings(StringPool* dest, Vector<uint32_t>* outResIds,
|
||||||
bool stripComments, bool stripRawValues) const;
|
bool stripComments, bool stripRawValues) const;
|
||||||
|
@ -43,7 +43,7 @@ class PseudoMethodAccent : public PseudoMethodImpl {
|
|||||||
|
|
||||||
class Pseudolocalizer {
|
class Pseudolocalizer {
|
||||||
public:
|
public:
|
||||||
Pseudolocalizer(PseudolocalizationMethod m);
|
explicit Pseudolocalizer(PseudolocalizationMethod m);
|
||||||
~Pseudolocalizer() { if (mImpl) delete mImpl; }
|
~Pseudolocalizer() { if (mImpl) delete mImpl; }
|
||||||
void setMethod(PseudolocalizationMethod m);
|
void setMethod(PseudolocalizationMethod m);
|
||||||
String16 start() { return mImpl->start(); }
|
String16 start() { return mImpl->start(); }
|
||||||
|
@ -51,7 +51,7 @@ struct ConfigDescription : public android::ResTable_config {
|
|||||||
static void applyVersionForCompatibility(ConfigDescription* config);
|
static void applyVersionForCompatibility(ConfigDescription* config);
|
||||||
|
|
||||||
ConfigDescription();
|
ConfigDescription();
|
||||||
ConfigDescription(const android::ResTable_config& o);
|
ConfigDescription(const android::ResTable_config& o); // NOLINT(implicit)
|
||||||
ConfigDescription(const ConfigDescription& o);
|
ConfigDescription(const ConfigDescription& o);
|
||||||
ConfigDescription(ConfigDescription&& o);
|
ConfigDescription(ConfigDescription&& o);
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ struct ResourceNameRef {
|
|||||||
ResourceNameRef() = default;
|
ResourceNameRef() = default;
|
||||||
ResourceNameRef(const ResourceNameRef&) = default;
|
ResourceNameRef(const ResourceNameRef&) = default;
|
||||||
ResourceNameRef(ResourceNameRef&&) = default;
|
ResourceNameRef(ResourceNameRef&&) = default;
|
||||||
ResourceNameRef(const ResourceName& rhs);
|
ResourceNameRef(const ResourceName& rhs); // NOLINT(implicit)
|
||||||
ResourceNameRef(const StringPiece16& p, ResourceType t, const StringPiece16& e);
|
ResourceNameRef(const StringPiece16& p, ResourceType t, const StringPiece16& e);
|
||||||
ResourceNameRef& operator=(const ResourceNameRef& rhs) = default;
|
ResourceNameRef& operator=(const ResourceNameRef& rhs) = default;
|
||||||
ResourceNameRef& operator=(ResourceNameRef&& rhs) = default;
|
ResourceNameRef& operator=(ResourceNameRef&& rhs) = default;
|
||||||
@ -124,7 +124,7 @@ struct ResourceId {
|
|||||||
|
|
||||||
ResourceId();
|
ResourceId();
|
||||||
ResourceId(const ResourceId& rhs);
|
ResourceId(const ResourceId& rhs);
|
||||||
ResourceId(uint32_t resId);
|
ResourceId(uint32_t resId); // NOLINT(implicit)
|
||||||
ResourceId(uint8_t p, uint8_t t, uint16_t e);
|
ResourceId(uint8_t p, uint8_t t, uint16_t e);
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
@ -263,7 +263,7 @@ bool ResourceTable::addResource(const ResourceNameRef& name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceTable::addResource(const ResourceNameRef& name,
|
bool ResourceTable::addResource(const ResourceNameRef& name,
|
||||||
const ResourceId resId,
|
const ResourceId& resId,
|
||||||
const ConfigDescription& config,
|
const ConfigDescription& config,
|
||||||
const StringPiece& product,
|
const StringPiece& product,
|
||||||
std::unique_ptr<Value> value,
|
std::unique_ptr<Value> value,
|
||||||
@ -314,7 +314,7 @@ bool ResourceTable::addResourceAllowMangled(const ResourceNameRef& name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceTable::addResourceAllowMangled(const ResourceNameRef& name,
|
bool ResourceTable::addResourceAllowMangled(const ResourceNameRef& name,
|
||||||
const ResourceId id,
|
const ResourceId& id,
|
||||||
const ConfigDescription& config,
|
const ConfigDescription& config,
|
||||||
const StringPiece& product,
|
const StringPiece& product,
|
||||||
std::unique_ptr<Value> value,
|
std::unique_ptr<Value> value,
|
||||||
@ -324,7 +324,7 @@ bool ResourceTable::addResourceAllowMangled(const ResourceNameRef& name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceTable::addResourceImpl(const ResourceNameRef& name,
|
bool ResourceTable::addResourceImpl(const ResourceNameRef& name,
|
||||||
const ResourceId resId,
|
const ResourceId& resId,
|
||||||
const ConfigDescription& config,
|
const ConfigDescription& config,
|
||||||
const StringPiece& product,
|
const StringPiece& product,
|
||||||
std::unique_ptr<Value> value,
|
std::unique_ptr<Value> value,
|
||||||
@ -415,18 +415,18 @@ bool ResourceTable::addResourceImpl(const ResourceNameRef& name,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceTable::setSymbolState(const ResourceNameRef& name, const ResourceId resId,
|
bool ResourceTable::setSymbolState(const ResourceNameRef& name, const ResourceId& resId,
|
||||||
const Symbol& symbol, IDiagnostics* diag) {
|
const Symbol& symbol, IDiagnostics* diag) {
|
||||||
return setSymbolStateImpl(name, resId, symbol, kValidNameChars, diag);
|
return setSymbolStateImpl(name, resId, symbol, kValidNameChars, diag);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceTable::setSymbolStateAllowMangled(const ResourceNameRef& name,
|
bool ResourceTable::setSymbolStateAllowMangled(const ResourceNameRef& name,
|
||||||
const ResourceId resId,
|
const ResourceId& resId,
|
||||||
const Symbol& symbol, IDiagnostics* diag) {
|
const Symbol& symbol, IDiagnostics* diag) {
|
||||||
return setSymbolStateImpl(name, resId, symbol, kValidNameMangledChars, diag);
|
return setSymbolStateImpl(name, resId, symbol, kValidNameMangledChars, diag);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceTable::setSymbolStateImpl(const ResourceNameRef& name, const ResourceId resId,
|
bool ResourceTable::setSymbolStateImpl(const ResourceNameRef& name, const ResourceId& resId,
|
||||||
const Symbol& symbol, const char16_t* validChars,
|
const Symbol& symbol, const char16_t* validChars,
|
||||||
IDiagnostics* diag) {
|
IDiagnostics* diag) {
|
||||||
assert(diag && "diagnostics can't be nullptr");
|
assert(diag && "diagnostics can't be nullptr");
|
||||||
|
@ -102,7 +102,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::vector<std::unique_ptr<ResourceConfigValue>> values;
|
std::vector<std::unique_ptr<ResourceConfigValue>> values;
|
||||||
|
|
||||||
ResourceEntry(const StringPiece16& name) : name(name.toString()) { }
|
explicit ResourceEntry(const StringPiece16& name) : name(name.toString()) { }
|
||||||
|
|
||||||
ResourceConfigValue* findValue(const ConfigDescription& config);
|
ResourceConfigValue* findValue(const ConfigDescription& config);
|
||||||
ResourceConfigValue* findValue(const ConfigDescription& config, const StringPiece& product);
|
ResourceConfigValue* findValue(const ConfigDescription& config, const StringPiece& product);
|
||||||
@ -196,7 +196,7 @@ public:
|
|||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
|
||||||
bool addResource(const ResourceNameRef& name,
|
bool addResource(const ResourceNameRef& name,
|
||||||
const ResourceId resId,
|
const ResourceId& resId,
|
||||||
const ConfigDescription& config,
|
const ConfigDescription& config,
|
||||||
const StringPiece& product,
|
const StringPiece& product,
|
||||||
std::unique_ptr<Value> value,
|
std::unique_ptr<Value> value,
|
||||||
@ -227,19 +227,19 @@ public:
|
|||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
|
||||||
bool addResourceAllowMangled(const ResourceNameRef& name,
|
bool addResourceAllowMangled(const ResourceNameRef& name,
|
||||||
const ResourceId id,
|
const ResourceId& id,
|
||||||
const ConfigDescription& config,
|
const ConfigDescription& config,
|
||||||
const StringPiece& product,
|
const StringPiece& product,
|
||||||
std::unique_ptr<Value> value,
|
std::unique_ptr<Value> value,
|
||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
|
||||||
bool setSymbolState(const ResourceNameRef& name,
|
bool setSymbolState(const ResourceNameRef& name,
|
||||||
const ResourceId resId,
|
const ResourceId& resId,
|
||||||
const Symbol& symbol,
|
const Symbol& symbol,
|
||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
|
||||||
bool setSymbolStateAllowMangled(const ResourceNameRef& name,
|
bool setSymbolStateAllowMangled(const ResourceNameRef& name,
|
||||||
const ResourceId resId,
|
const ResourceId& resId,
|
||||||
const Symbol& symbol,
|
const Symbol& symbol,
|
||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ private:
|
|||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
|
||||||
bool addResourceImpl(const ResourceNameRef& name,
|
bool addResourceImpl(const ResourceNameRef& name,
|
||||||
ResourceId resId,
|
const ResourceId& resId,
|
||||||
const ConfigDescription& config,
|
const ConfigDescription& config,
|
||||||
const StringPiece& product,
|
const StringPiece& product,
|
||||||
std::unique_ptr<Value> value,
|
std::unique_ptr<Value> value,
|
||||||
@ -299,7 +299,7 @@ private:
|
|||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
|
||||||
bool setSymbolStateImpl(const ResourceNameRef& name,
|
bool setSymbolStateImpl(const ResourceNameRef& name,
|
||||||
ResourceId resId,
|
const ResourceId& resId,
|
||||||
const Symbol& symbol,
|
const Symbol& symbol,
|
||||||
const char16_t* validChars,
|
const char16_t* validChars,
|
||||||
IDiagnostics* diag);
|
IDiagnostics* diag);
|
||||||
|
@ -181,7 +181,7 @@ struct Id : public BaseItem<Id> {
|
|||||||
struct RawString : public BaseItem<RawString> {
|
struct RawString : public BaseItem<RawString> {
|
||||||
StringPool::Ref value;
|
StringPool::Ref value;
|
||||||
|
|
||||||
RawString(const StringPool::Ref& ref);
|
explicit RawString(const StringPool::Ref& ref);
|
||||||
|
|
||||||
bool flatten(android::Res_value* outValue) const override;
|
bool flatten(android::Res_value* outValue) const override;
|
||||||
RawString* clone(StringPool* newPool) const override;
|
RawString* clone(StringPool* newPool) const override;
|
||||||
@ -191,7 +191,7 @@ struct RawString : public BaseItem<RawString> {
|
|||||||
struct String : public BaseItem<String> {
|
struct String : public BaseItem<String> {
|
||||||
StringPool::Ref value;
|
StringPool::Ref value;
|
||||||
|
|
||||||
String(const StringPool::Ref& ref);
|
explicit String(const StringPool::Ref& ref);
|
||||||
|
|
||||||
// Whether the string is marked as translateable. This does not persist when flattened.
|
// Whether the string is marked as translateable. This does not persist when flattened.
|
||||||
// It is only used during compilation phase.
|
// It is only used during compilation phase.
|
||||||
@ -209,7 +209,7 @@ private:
|
|||||||
struct StyledString : public BaseItem<StyledString> {
|
struct StyledString : public BaseItem<StyledString> {
|
||||||
StringPool::StyleRef value;
|
StringPool::StyleRef value;
|
||||||
|
|
||||||
StyledString(const StringPool::StyleRef& ref);
|
explicit StyledString(const StringPool::StyleRef& ref);
|
||||||
|
|
||||||
// Whether the string is marked as translateable. This does not persist when flattened.
|
// Whether the string is marked as translateable. This does not persist when flattened.
|
||||||
// It is only used during compilation phase.
|
// It is only used during compilation phase.
|
||||||
@ -233,7 +233,7 @@ struct FileReference : public BaseItem<FileReference> {
|
|||||||
io::IFile* file = nullptr;
|
io::IFile* file = nullptr;
|
||||||
|
|
||||||
FileReference() = default;
|
FileReference() = default;
|
||||||
FileReference(const StringPool::Ref& path);
|
explicit FileReference(const StringPool::Ref& path);
|
||||||
|
|
||||||
bool flatten(android::Res_value* outValue) const override;
|
bool flatten(android::Res_value* outValue) const override;
|
||||||
FileReference* clone(StringPool* newPool) const override;
|
FileReference* clone(StringPool* newPool) const override;
|
||||||
@ -247,7 +247,7 @@ struct BinaryPrimitive : public BaseItem<BinaryPrimitive> {
|
|||||||
android::Res_value value;
|
android::Res_value value;
|
||||||
|
|
||||||
BinaryPrimitive() = default;
|
BinaryPrimitive() = default;
|
||||||
BinaryPrimitive(const android::Res_value& val);
|
explicit BinaryPrimitive(const android::Res_value& val);
|
||||||
BinaryPrimitive(uint8_t dataType, uint32_t data);
|
BinaryPrimitive(uint8_t dataType, uint32_t data);
|
||||||
|
|
||||||
bool flatten(android::Res_value* outValue) const override;
|
bool flatten(android::Res_value* outValue) const override;
|
||||||
@ -266,7 +266,7 @@ struct Attribute : public BaseValue<Attribute> {
|
|||||||
int32_t maxInt;
|
int32_t maxInt;
|
||||||
std::vector<Symbol> symbols;
|
std::vector<Symbol> symbols;
|
||||||
|
|
||||||
Attribute(bool w, uint32_t t = 0u);
|
explicit Attribute(bool w, uint32_t t = 0u);
|
||||||
|
|
||||||
Attribute* clone(StringPool* newPool) const override;
|
Attribute* clone(StringPool* newPool) const override;
|
||||||
void printMask(std::ostream* out) const;
|
void printMask(std::ostream* out) const;
|
||||||
|
@ -49,7 +49,7 @@ static bool lessEntryId(const std::pair<uint16_t, size_t>& p, uint16_t entryId)
|
|||||||
return p.first < entryId;
|
return p.first < entryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t findAttributeSdkLevel(ResourceId id) {
|
size_t findAttributeSdkLevel(const ResourceId& id) {
|
||||||
if (id.packageId() != 0x01 && id.typeId() != 0x01) {
|
if (id.packageId() != 0x01 && id.typeId() != 0x01) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ enum {
|
|||||||
SDK_MARSHMALLOW = 23,
|
SDK_MARSHMALLOW = 23,
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t findAttributeSdkLevel(ResourceId id);
|
size_t findAttributeSdkLevel(const ResourceId& id);
|
||||||
size_t findAttributeSdkLevel(const ResourceName& name);
|
size_t findAttributeSdkLevel(const ResourceName& name);
|
||||||
|
|
||||||
} // namespace aapt
|
} // namespace aapt
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class StringPool;
|
friend class StringPool;
|
||||||
|
|
||||||
Ref(Entry* entry);
|
explicit Ref(Entry* entry);
|
||||||
|
|
||||||
Entry* mEntry;
|
Entry* mEntry;
|
||||||
};
|
};
|
||||||
@ -88,7 +88,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class StringPool;
|
friend class StringPool;
|
||||||
|
|
||||||
StyleRef(StyleEntry* entry);
|
explicit StyleRef(StyleEntry* entry);
|
||||||
|
|
||||||
StyleEntry* mEntry;
|
StyleEntry* mEntry;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user