Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0258add8 authored by Calin Juravle's avatar Calin Juravle Committed by Android (Google) Code Review
Browse files

Merge "Clean up error logs for profiles which don't exists." into nyc-dev

parents 4782b268 278edac4
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -165,9 +165,11 @@ static void unlink_reference_profile(const char* pkgname) {
    std::string reference_profile_dir = create_data_ref_profile_package_path(pkgname);
    std::string reference_profile = create_primary_profile(reference_profile_dir);
    if (unlink(reference_profile.c_str()) != 0) {
        if (errno != ENOENT) {
            PLOG(WARNING) << "Could not unlink " << reference_profile;
        }
    }
}

static void unlink_current_profiles(const char* pkgname) {
    std::vector<userid_t> users = get_known_users(/*volume_uuid*/ nullptr);
@@ -175,10 +177,12 @@ static void unlink_current_profiles(const char* pkgname) {
        std::string profile_dir = create_data_user_profile_package_path(user, pkgname);
        std::string profile = create_primary_profile(profile_dir);
        if (unlink(profile.c_str()) != 0) {
            if (errno != ENOENT) {
                PLOG(WARNING) << "Could not unlink " << profile;
            }
        }
    }
}

static void unlink_all_profiles(const char* pkgname) {
    unlink_reference_profile(pkgname);