InstallPackage now takes a package as parameter

Therefore InstallPackage() doesn't need to worry about the details of a
given Package.

Bug: 127071893
Test: run update from /bin/recovery --update_package=@path, sideload a package
Change-Id: I0caa36785b43924f884ee398e7ea640d7472a92e
This commit is contained in:
Tianjie Xu
2019-06-11 15:43:43 -07:00
parent 533a12c71e
commit 980f92ec00
7 changed files with 83 additions and 53 deletions
+5 -2
View File
@@ -182,8 +182,11 @@ InstallResult ApplyFromSdcard(Device* device, RecoveryUI* ui) {
break;
}
}
result = InstallPackage(FUSE_SIDELOAD_HOST_PATHNAME, false, false, 0 /* retry_count */, ui);
auto package =
Package::CreateFilePackage(FUSE_SIDELOAD_HOST_PATHNAME,
std::bind(&RecoveryUI::SetProgress, ui, std::placeholders::_1));
result =
InstallPackage(package.get(), FUSE_SIDELOAD_HOST_PATHNAME, false, 0 /* retry_count */, ui);
break;
}