[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/lib/libupi_ab/inc/upi_update.h b/ap/lib/libupi_ab/inc/upi_update.h
new file mode 100755
index 0000000..486707e
--- /dev/null
+++ b/ap/lib/libupi_ab/inc/upi_update.h
@@ -0,0 +1,56 @@
+#ifndef UPI_UPDATE_H
+#define UPI_UPDATE_H
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/reboot.h>
+
+
+#include "upi_public.h"
+#include "upi_img_interface.h"
+//#include "upi_mtd.h"
+#include "zxic_fota_ab_upgrade.h"
+
+
+#define FOTA_PACKAGE_FILE "/cache/zte_fota_ab/upgrade.package"
+
+typedef enum {
+ UPGRADE_STATUS_UNKNOWN = -1,
+ UPGRADE_STATUS_VERIFING = 0,
+ UPGRADE_STATUS_VERIFY_SUCCESS,
+ UPGRADE_STATUS_VERIFY_FAIL,
+ UPGRADE_STATUS_UPDATING,
+ UPGRADE_STATUS_UPDATE_SUCCESS,
+ UPGRADE_STATUS_UPDATE_FAIL,
+ UPGRADE_STATUS_NO_NEED_UPDATE,
+ UPGRADE_STATUS_NEED_UPDATE
+} upgrade_status_s_type;
+
+typedef struct {
+ int upgrage_package_file_desc; // upgrade package file description
+ unsigned int upgrade_data_offset; // upgrade package offset in file
+ unsigned int upgrade_file_size; // upgrade package file size
+}partition_upgrade_package_info_t;
+
+
+typedef struct {
+ char partition_name[PARTITION_NAME_LEN];
+ int partition_type;
+ long long len;
+ int offset;
+ int zipped;
+ char hash[HASH_MAX_LEN];
+ int index;
+ int partition_total_count;
+ partition_upgrade_package_info_t pkg_info;
+ partition_mtd_info_t mtd_info;
+} device_data_t;
+
+int upi_update(z_upgrade_flush_status_t* flush_status);
+
+
+#endif /*UPI_UPDATE_H*/