Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2008, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | #ifndef COMMANDS_H_ |
| 19 | #define COMMANDS_H_ |
| 20 | |
| 21 | #include <inttypes.h> |
| 22 | #include <unistd.h> |
| 23 | |
| 24 | #include <cutils/multiuser.h> |
| 25 | |
| 26 | #include <installd_constants.h> |
| 27 | |
| 28 | namespace android { |
| 29 | namespace installd { |
| 30 | |
Jeff Sharkey | c7d1b22 | 2016-01-11 13:07:09 -0700 | [diff] [blame] | 31 | int create_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags, |
Janis Danisevskis | eecb2d2 | 2016-01-12 14:45:55 +0000 | [diff] [blame] | 32 | appid_t appid, const char* seinfo, int target_sdk_version); |
Jeff Sharkey | c7d1b22 | 2016-01-11 13:07:09 -0700 | [diff] [blame] | 33 | int restorecon_app_data(const char* uuid, const char* pkgName, userid_t userid, int flags, |
| 34 | appid_t appid, const char* seinfo); |
Jeff Sharkey | cc6281c | 2016-02-06 19:46:09 -0700 | [diff] [blame] | 35 | int migrate_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags); |
Jeff Sharkey | 2f720f7 | 2016-04-10 20:51:40 -0600 | [diff] [blame] | 36 | int clear_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags, |
| 37 | ino_t ce_data_inode); |
| 38 | int destroy_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags, |
| 39 | ino_t ce_data_inode); |
Jeff Sharkey | c7d1b22 | 2016-01-11 13:07:09 -0700 | [diff] [blame] | 40 | |
| 41 | int move_complete_app(const char* from_uuid, const char *to_uuid, const char *package_name, |
Janis Danisevskis | eecb2d2 | 2016-01-12 14:45:55 +0000 | [diff] [blame] | 42 | const char *data_app_name, appid_t appid, const char* seinfo, int target_sdk_version); |
Jeff Sharkey | c7d1b22 | 2016-01-11 13:07:09 -0700 | [diff] [blame] | 43 | |
Jeff Sharkey | 2f720f7 | 2016-04-10 20:51:40 -0600 | [diff] [blame] | 44 | int get_app_size(const char *uuid, const char *pkgname, int userid, int flags, ino_t ce_data_inode, |
| 45 | const char* code_path, int64_t *codesize, int64_t *datasize, int64_t *cachesize, |
| 46 | int64_t *asecsize); |
| 47 | int get_app_data_inode(const char *uuid, const char *pkgname, int userid, int flags, ino_t *inode); |
Jeff Sharkey | c7d1b22 | 2016-01-11 13:07:09 -0700 | [diff] [blame] | 48 | |
Jeff Sharkey | 379a12b | 2016-04-14 20:45:06 -0600 | [diff] [blame] | 49 | int create_user_data(const char *uuid, userid_t userid, int user_serial, int flags); |
| 50 | int destroy_user_data(const char *uuid, userid_t userid, int flags); |
| 51 | |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 52 | int rm_dex(const char *path, const char *instruction_set); |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 53 | int free_cache(const char *uuid, int64_t free_size); |
Andreas Gampe | 4d0f825 | 2016-03-20 11:30:28 -0700 | [diff] [blame] | 54 | |
| 55 | bool merge_profiles(uid_t uid, const char *pkgname); |
| 56 | |
David Sehr | 6727c2d | 2016-05-17 16:06:22 -0700 | [diff] [blame^] | 57 | bool dump_profile(uid_t uid, const char *pkgname, const char *dex_files); |
| 58 | |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 59 | int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set, |
Andreas Gampe | 4d0f825 | 2016-03-20 11:30:28 -0700 | [diff] [blame] | 60 | int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter, |
Jeff Hao | b63d91f | 2016-03-16 15:59:25 -0700 | [diff] [blame] | 61 | const char* volume_uuid, const char* shared_libraries); |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 62 | int mark_boot_complete(const char *instruction_set); |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 63 | int linklib(const char* uuid, const char* pkgname, const char* asecLibDir, int userId); |
| 64 | int idmap(const char *target_path, const char *overlay_path, uid_t uid); |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 65 | int create_oat_dir(const char* oat_dir, const char *instruction_set); |
| 66 | int rm_package_dir(const char* apk_path); |
Calin Juravle | edae669 | 2016-03-23 13:55:31 +0000 | [diff] [blame] | 67 | int clear_app_profiles(const char* pkgname); |
| 68 | int destroy_app_profiles(const char* pkgname); |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 69 | int link_file(const char *relative_path, const char *from_base, const char *to_base); |
| 70 | |
Andreas Gampe | e65b4fa | 2016-03-01 11:46:45 -0800 | [diff] [blame] | 71 | // Move a B version over to the A location. Only works for oat_dir != nullptr. |
| 72 | int move_ab(const char *apk_path, const char *instruction_set, const char* oat_dir); |
| 73 | |
Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 74 | } // namespace installd |
| 75 | } // namespace android |
| 76 | |
| 77 | #endif // COMMANDS_H_ |