summaryrefslogtreecommitdiffstats
path: root/install/include
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-06-12 00:43:43 +0200
committerTianjie Xu <xunchang@google.com>2019-06-13 22:36:56 +0200
commit980f92ec008738b4d54208ed0fe9bd9cede4d7e1 (patch)
tree60386946c664bf958ec9ed2dc501e5eb68b6b6e7 /install/include
parentMerge "minadbd: Support `adb rescue getprop`." (diff)
downloadandroid_bootable_recovery-980f92ec008738b4d54208ed0fe9bd9cede4d7e1.tar
android_bootable_recovery-980f92ec008738b4d54208ed0fe9bd9cede4d7e1.tar.gz
android_bootable_recovery-980f92ec008738b4d54208ed0fe9bd9cede4d7e1.tar.bz2
android_bootable_recovery-980f92ec008738b4d54208ed0fe9bd9cede4d7e1.tar.lz
android_bootable_recovery-980f92ec008738b4d54208ed0fe9bd9cede4d7e1.tar.xz
android_bootable_recovery-980f92ec008738b4d54208ed0fe9bd9cede4d7e1.tar.zst
android_bootable_recovery-980f92ec008738b4d54208ed0fe9bd9cede4d7e1.zip
Diffstat (limited to 'install/include')
-rw-r--r--install/include/install/install.h11
-rw-r--r--install/include/install/package.h9
2 files changed, 15 insertions, 5 deletions
diff --git a/install/include/install/install.h b/install/include/install/install.h
index 44a5cde91..b4b3a9149 100644
--- a/install/include/install/install.h
+++ b/install/include/install/install.h
@@ -44,11 +44,12 @@ enum class OtaType {
BRICK,
};
-// Installs the given update package. This function should also wipe the cache partition after a
-// successful installation if |should_wipe_cache| is true or an updater command asks to wipe the
-// cache.
-InstallResult InstallPackage(const std::string& package, bool should_wipe_cache, bool needs_mount,
- int retry_count, RecoveryUI* ui);
+// Installs the given update package. The package_id is a string provided by the caller (e.g. the
+// package path) to identify the package and log to last_install. This function should also wipe the
+// cache partition after a successful installation if |should_wipe_cache| is true or an updater
+// command asks to wipe the cache.
+InstallResult InstallPackage(Package* package, const std::string_view package_id,
+ bool should_wipe_cache, int retry_count, RecoveryUI* ui);
// Verifies the package by ota keys. Returns true if the package is verified successfully,
// otherwise returns false.
diff --git a/install/include/install/package.h b/install/include/install/package.h
index cd44d10be..0b4233238 100644
--- a/install/include/install/package.h
+++ b/install/include/install/package.h
@@ -28,6 +28,11 @@
#include "verifier.h"
+enum class PackageType {
+ kMemory,
+ kFile,
+};
+
// This class serves as a wrapper for an OTA update package. It aims to provide the common
// interface for both packages loaded in memory and packages read from fd.
class Package : public VerifierInterface {
@@ -41,6 +46,10 @@ class Package : public VerifierInterface {
virtual ~Package() = default;
+ virtual PackageType GetType() const = 0;
+
+ virtual std::string GetPath() const = 0;
+
// Opens the package as a zip file and returns the ZipArchiveHandle.
virtual ZipArchiveHandle GetZipArchiveHandle() = 0;