Merge "Handles pre-process failure without crashing system" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b8735359aa
@@ -15032,24 +15032,26 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
|
|
||||||
void tryProcessInstallRequest(InstallArgs args, int currentStatus) {
|
void tryProcessInstallRequest(InstallArgs args, int currentStatus) {
|
||||||
mCurrentState.put(args, currentStatus);
|
mCurrentState.put(args, currentStatus);
|
||||||
boolean success = true;
|
|
||||||
if (mCurrentState.size() != mChildParams.size()) {
|
if (mCurrentState.size() != mChildParams.size()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int completeStatus = PackageManager.INSTALL_SUCCEEDED;
|
||||||
for (Integer status : mCurrentState.values()) {
|
for (Integer status : mCurrentState.values()) {
|
||||||
if (status == PackageManager.INSTALL_UNKNOWN) {
|
if (status == PackageManager.INSTALL_UNKNOWN) {
|
||||||
return;
|
return;
|
||||||
} else if (status != PackageManager.INSTALL_SUCCEEDED) {
|
} else if (status != PackageManager.INSTALL_SUCCEEDED) {
|
||||||
success = false;
|
completeStatus = status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final List<InstallRequest> installRequests = new ArrayList<>(mCurrentState.size());
|
final List<InstallRequest> installRequests = new ArrayList<>(mCurrentState.size());
|
||||||
for (Map.Entry<InstallArgs, Integer> entry : mCurrentState.entrySet()) {
|
for (Map.Entry<InstallArgs, Integer> entry : mCurrentState.entrySet()) {
|
||||||
installRequests.add(new InstallRequest(entry.getKey(),
|
installRequests.add(new InstallRequest(entry.getKey(),
|
||||||
createPackageInstalledInfo(entry.getValue())));
|
createPackageInstalledInfo(completeStatus)));
|
||||||
}
|
}
|
||||||
processInstallRequestsAsync(success, installRequests);
|
processInstallRequestsAsync(
|
||||||
|
completeStatus == PackageManager.INSTALL_SUCCEEDED,
|
||||||
|
installRequests);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user