Mårten Kongstad | 83ab0d7 | 2015-03-20 12:57:36 +0100 | [diff] [blame] | 1 | |
Colin Cross | 13221c9 | 2014-02-11 18:04:44 -0800 | [diff] [blame] | 2 | #ifndef _IDMAP_H_ |
| 3 | #define _IDMAP_H_ |
| 4 | |
| 5 | #define LOG_TAG "idmap" |
| 6 | |
| 7 | #include <utils/Log.h> |
Mårten Kongstad | 83ab0d7 | 2015-03-20 12:57:36 +0100 | [diff] [blame] | 8 | #include <utils/Vector.h> |
Colin Cross | 13221c9 | 2014-02-11 18:04:44 -0800 | [diff] [blame] | 9 | |
| 10 | #include <errno.h> |
| 11 | #include <stdio.h> |
| 12 | |
| 13 | #ifndef TEMP_FAILURE_RETRY |
| 14 | // Used to retry syscalls that can return EINTR. |
| 15 | #define TEMP_FAILURE_RETRY(exp) ({ \ |
| 16 | typeof (exp) _rc; \ |
| 17 | do { \ |
| 18 | _rc = (exp); \ |
| 19 | } while (_rc == -1 && errno == EINTR); \ |
| 20 | _rc; }) |
| 21 | #endif |
| 22 | |
| 23 | int idmap_create_path(const char *target_apk_path, const char *overlay_apk_path, |
| 24 | const char *idmap_path); |
| 25 | |
| 26 | int idmap_create_fd(const char *target_apk_path, const char *overlay_apk_path, int fd); |
| 27 | |
Jaekyun Seok | 71693e6 | 2017-05-18 00:10:57 +0900 | [diff] [blame] | 28 | int idmap_verify_fd(const char *target_apk_path, const char *overlay_apk_path, int fd); |
| 29 | |
Jaekyun Seok | 7de2f9c | 2017-03-02 12:45:10 +0900 | [diff] [blame] | 30 | // Regarding target_package_name: the idmap_scan implementation should |
| 31 | // be able to extract this from the manifest in target_apk_path, |
| 32 | // simplifying the external API. |
| 33 | int idmap_scan(const char *target_package_name, const char *target_apk_path, |
| 34 | const char *idmap_dir, const android::Vector<const char *> *overlay_dirs); |
| 35 | |
Colin Cross | 13221c9 | 2014-02-11 18:04:44 -0800 | [diff] [blame] | 36 | int idmap_inspect(const char *idmap_path); |
| 37 | |
| 38 | #endif // _IDMAP_H_ |