Lines Matching refs:pkgname
103 const char* pkgname, const char* seinfo) {
108 if (selinux_android_setfilecon(path.c_str(), pkgname, seinfo, uid) < 0) {
116 uid_t uid, const char* pkgname, const char* seinfo) {
117 return prepare_app_dir(StringPrintf("%s/%s", parent.c_str(), name), target_mode, uid, pkgname,
121 int create_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags,
126 auto path = create_data_user_ce_package_path(uuid, userid, pkgname);
127 if (prepare_app_dir(path, target_mode, uid, pkgname, seinfo) ||
128 prepare_app_dir(path, "cache", 0771, uid, pkgname, seinfo) ||
129 prepare_app_dir(path, "code_cache", 0771, uid, pkgname, seinfo)) {
141 auto path = create_data_user_de_package_path(uuid, userid, pkgname);
142 if (prepare_app_dir(path, target_mode, uid, pkgname, seinfo)) {
148 const std::string profile_path = create_data_user_profile_package_path(userid, pkgname);
160 const std::string ref_profile_path = create_data_ref_profile_package_path(pkgname);
174 int migrate_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags) {
180 auto ce_path = create_data_user_ce_package_path(uuid, userid, pkgname);
181 auto de_path = create_data_user_de_package_path(uuid, userid, pkgname);
256 static bool clear_reference_profile(const char* pkgname) {
257 std::string reference_profile_dir = create_data_ref_profile_package_path(pkgname);
262 static bool clear_current_profile(const char* pkgname, userid_t user) {
263 std::string profile_dir = create_data_user_profile_package_path(user, pkgname);
268 static bool clear_current_profiles(const char* pkgname) {
272 success &= clear_current_profile(pkgname, user);
277 int clear_app_profiles(const char* pkgname) {
279 success &= clear_reference_profile(pkgname);
280 success &= clear_current_profiles(pkgname);
284 int clear_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags,
288 auto path = create_data_user_ce_package_path(uuid, userid, pkgname, ce_data_inode);
309 auto path = create_data_user_de_package_path(uuid, userid, pkgname) + suffix;
315 if (!clear_current_profile(pkgname, userid)) {
323 static int destroy_app_reference_profile(const char *pkgname) {
325 create_data_ref_profile_package_path(pkgname),
329 static int destroy_app_current_profiles(const char *pkgname, userid_t userid) {
331 create_data_user_profile_package_path(userid, pkgname),
335 int destroy_app_profiles(const char *pkgname) {
339 result |= destroy_app_current_profiles(pkgname, user);
341 result |= destroy_app_reference_profile(pkgname);
345 int destroy_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags,
350 create_data_user_ce_package_path(uuid, userid, pkgname, ce_data_inode));
354 create_data_user_de_package_path(uuid, userid, pkgname));
355 destroy_app_current_profiles(pkgname, userid);
359 destroy_app_reference_profile(pkgname);
624 int get_app_size(const char *uuid, const char *pkgname, int userid, int flags, ino_t ce_data_inode,
638 auto path = create_data_user_ce_package_path(uuid, userid, pkgname, ce_data_inode);
642 auto path = create_data_user_de_package_path(uuid, userid, pkgname);
651 int get_app_data_inode(const char *uuid, const char *pkgname, int userid, int flags, ino_t *inode) {
653 auto path = create_data_user_ce_package_path(uuid, userid, pkgname);
692 const char* output_file_name, const char *pkgname ATTRIBUTE_UNUSED, const char *instruction_set)
1081 static fd_t open_primary_profile_file(userid_t user, const char* pkgname) {
1082 std::string profile_dir = create_data_user_profile_package_path(user, pkgname);
1086 static fd_t open_reference_profile(uid_t uid, const char* pkgname, bool read_write) {
1087 std::string reference_profile_dir = create_data_ref_profile_package_path(pkgname);
1103 static void open_profile_files(uid_t uid, const char* pkgname,
1106 *reference_profile_fd = open_reference_profile(uid, pkgname, /*read_write*/ true);
1114 fd_t profile_fd = open_primary_profile_file(user, pkgname);
1183 static bool analyse_profiles(uid_t uid, const char* pkgname) {
1186 open_profile_files(uid, pkgname, &profiles_fd, &reference_profile_fd);
1197 ALOGV("PROFMAN (MERGE): --- BEGIN '%s' ---\n", pkgname);
1212 LOG(WARNING) << "profman failed for package " << pkgname << ": " << return_code;
1227 LOG(WARNING) << "Bad profiles for package " << pkgname;
1235 LOG(WARNING) << "IO error while reading profiles for package " << pkgname;
1242 LOG(WARNING) << "Unknown error code while processing profiles for package " << pkgname
1255 clear_current_profiles(pkgname);
1258 clear_reference_profile(pkgname);
1309 // Dumps the contents of a profile file, using pkgname's dex files for pretty
1311 bool dump_profile(uid_t uid, const char* pkgname, const char* code_path_string) {
1314 std::string out_file_name = StringPrintf("/data/misc/profman/%s.txt", pkgname);
1316 ALOGV("PROFMAN (DUMP): --- BEGIN '%s' ---\n", pkgname);
1318 open_profile_files(uid, pkgname, &profile_fds, &reference_profile_fd);
1324 ALOGE("profman dump: no profiles to dump for '%s'", pkgname);
1363 LOG(WARNING) << "profman failed for package " << pkgname << ": "
1457 bool merge_profiles(uid_t uid, const char *pkgname) {
1458 return analyse_profiles(uid, pkgname);
1472 params[2], // pkgname
1561 int dexopt(const char* apk_path, uid_t uid, const char* pkgname, const char* instruction_set,
1574 CHECK(pkgname != nullptr);
1575 CHECK(pkgname[0] != 0);
1580 if (!is_public && pkgname[0] != '*') {
1582 const std::string pkgname_str(pkgname);
1583 reference_profile_fd.reset(open_reference_profile(uid, pkgname, /*read_write*/ false),
1724 pkgname,
1810 int linklib(const char* uuid, const char* pkgname, const char* asecLibDir, int userId)
1815 std::string _pkgdir(create_data_user_ce_package_path(uuid, userId, pkgname));
1988 int restorecon_app_data(const char* uuid, const char* pkgName, userid_t userid, int flags,
1995 if (!pkgName || !seinfo) {
2002 auto path = create_data_user_ce_package_path(uuid, userid, pkgName);
2009 auto path = create_data_user_de_package_path(uuid, userid, pkgName);