#pragma once #include #include #include #include #include #include #include #include using SparsePtr = std::unique_ptr; /* util stuff */ double now(); void set_verbose(); // These printf-like functions are implemented in terms of vsnprintf, so they // use the same attribute for compile-time format string checking. void die(const char* fmt, ...) __attribute__((__noreturn__)) __attribute__((__format__(__printf__, 1, 2))); void verbose(const char* fmt, ...) __attribute__((__format__(__printf__, 1, 2))); void die(const std::string& str) __attribute__((__noreturn__)); bool should_flash_in_userspace(const android::fs_mgr::LpMetadata& metadata, const std::string& partition_name); bool is_sparse_file(android::base::borrowed_fd fd); int64_t get_file_size(android::base::borrowed_fd fd); std::string fb_fix_numeric_var(std::string var); class ImageSource { public: virtual ~ImageSource(){}; virtual bool ReadFile(const std::string& name, std::vector* out) const = 0; virtual android::base::unique_fd OpenFile(const std::string& name) const = 0; };