Merge "Better error message in case of multiple splits." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
413bb027b1
@@ -185,7 +185,10 @@ public class ApkLiteParseUtils {
|
|||||||
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parseApkLite");
|
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parseApkLite");
|
||||||
try {
|
try {
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
if (isApkFile(file)) {
|
if (!isApkFile(file)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
final ParseResult<ApkLite> result = parseApkLite(input, file, flags);
|
final ParseResult<ApkLite> result = parseApkLite(input, file, flags);
|
||||||
if (result.isError()) {
|
if (result.isError()) {
|
||||||
return input.error(result);
|
return input.error(result);
|
||||||
@@ -210,12 +213,13 @@ public class ApkLiteParseUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert that each split is defined only oncuses-static-libe
|
// Assert that each split is defined only once
|
||||||
if (apks.put(lite.getSplitName(), lite) != null) {
|
ApkLite prev = apks.put(lite.getSplitName(), lite);
|
||||||
|
if (prev != null) {
|
||||||
return input.error(PackageManager.INSTALL_PARSE_FAILED_BAD_MANIFEST,
|
return input.error(PackageManager.INSTALL_PARSE_FAILED_BAD_MANIFEST,
|
||||||
"Split name " + lite.getSplitName()
|
"Split name " + lite.getSplitName()
|
||||||
+ " defined more than once; most recent was " + file);
|
+ " defined more than once; most recent was " + file
|
||||||
}
|
+ ", previous was " + prev.getPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
baseApk = apks.remove(null);
|
baseApk = apks.remove(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user