summaryrefslogtreecommitdiffstats
path: root/cmds/idmap/idmap.h
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-02-11 18:04:44 -0800
committerColin Cross <ccross@android.com>2014-02-11 18:11:36 -0800
commit13221c9cffdb289851411bdc73a9a5236fcb9291 (patch)
tree838dc670e5df43923b5bb980b0b515cf3cb432cf /cmds/idmap/idmap.h
parentecbeae74f299f44f9ec4c79ddd885e999d4e1b64 (diff)
downloadframeworks_base-13221c9cffdb289851411bdc73a9a5236fcb9291.zip
frameworks_base-13221c9cffdb289851411bdc73a9a5236fcb9291.tar.gz
frameworks_base-13221c9cffdb289851411bdc73a9a5236fcb9291.tar.bz2
frameworks/base: move idmap from frameworks/native
idmap depends on libandroidfw, so it should go in frameworks/base. Change-Id: I3c1db3baa355f53d6b523d60f4377e63eff00c30
Diffstat (limited to 'cmds/idmap/idmap.h')
-rw-r--r--cmds/idmap/idmap.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/cmds/idmap/idmap.h b/cmds/idmap/idmap.h
new file mode 100644
index 0000000..f507dd8
--- /dev/null
+++ b/cmds/idmap/idmap.h
@@ -0,0 +1,34 @@
+#ifndef _IDMAP_H_
+#define _IDMAP_H_
+
+#define LOG_TAG "idmap"
+
+#include <utils/Log.h>
+
+#include <errno.h>
+#include <stdio.h>
+
+#ifndef TEMP_FAILURE_RETRY
+// Used to retry syscalls that can return EINTR.
+#define TEMP_FAILURE_RETRY(exp) ({ \
+ typeof (exp) _rc; \
+ do { \
+ _rc = (exp); \
+ } while (_rc == -1 && errno == EINTR); \
+ _rc; })
+#endif
+
+int idmap_create_path(const char *target_apk_path, const char *overlay_apk_path,
+ const char *idmap_path);
+
+int idmap_create_fd(const char *target_apk_path, const char *overlay_apk_path, int fd);
+
+// Regarding target_package_name: the idmap_scan implementation should
+// be able to extract this from the manifest in target_apk_path,
+// simplifying the external API.
+int idmap_scan(const char *overlay_dir, const char *target_package_name,
+ const char *target_apk_path, const char *idmap_dir);
+
+int idmap_inspect(const char *idmap_path);
+
+#endif // _IDMAP_H_