am 2dc6a265: am f475f1df: am dd4c3af1: Merge "Ensure that split names are valid" into lmp-dev
* commit '2dc6a26529c58aec4501e0da27fbd339142ca113': Ensure that split names are valid
This commit is contained in:
@@ -85,11 +85,24 @@ ApkSplit::ApkSplit(const std::set<ConfigDescription>& configs, const sp<Resource
|
||||
if (mName.size() > 0) {
|
||||
mName.append(",");
|
||||
mDirName.append("_");
|
||||
mPackageSafeName.append(".");
|
||||
}
|
||||
|
||||
String8 configStr = iter->toString();
|
||||
String8 packageConfigStr(configStr);
|
||||
size_t len = packageConfigStr.length();
|
||||
if (len > 0) {
|
||||
char* buf = packageConfigStr.lockBuffer(len);
|
||||
for (char* end = buf + len; buf < end; ++buf) {
|
||||
if (*buf == '-') {
|
||||
*buf = '_';
|
||||
}
|
||||
}
|
||||
packageConfigStr.unlockBuffer(len);
|
||||
}
|
||||
mName.append(configStr);
|
||||
mDirName.append(configStr);
|
||||
mPackageSafeName.append(packageConfigStr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,10 @@ public:
|
||||
return mDirName;
|
||||
}
|
||||
|
||||
const android::String8& getPackageSafeName() const {
|
||||
return mPackageSafeName;
|
||||
}
|
||||
|
||||
bool isBase() const {
|
||||
return mIsBase;
|
||||
}
|
||||
@@ -111,6 +115,7 @@ private:
|
||||
const bool mIsBase;
|
||||
String8 mName;
|
||||
String8 mDirName;
|
||||
String8 mPackageSafeName;
|
||||
std::set<OutputEntry> mFiles;
|
||||
};
|
||||
|
||||
|
||||
@@ -937,8 +937,8 @@ status_t generateAndroidManifestForSplit(Bundle* bundle, const sp<AaptAssets>& a
|
||||
}
|
||||
|
||||
// Add the 'split' attribute which describes the configurations included.
|
||||
String8 splitName("config_");
|
||||
splitName.append(split->getDirectorySafeName());
|
||||
String8 splitName("config.");
|
||||
splitName.append(split->getPackageSafeName());
|
||||
manifest->addAttribute(String16(), String16("split"), String16(splitName));
|
||||
|
||||
// Build an empty <application> tag (required).
|
||||
|
||||
Reference in New Issue
Block a user