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

Commit 77201328 authored by Calin Juravle's avatar Calin Juravle Committed by android-build-merger
Browse files

Merge "Clean up error logs for profiles which don\'t exists." into nyc-dev am: 0258add8

am: 4c1c3a69

* commit '4c1c3a69':
  Clean up error logs for profiles which don't exists.
parents 1a2277b9 4c1c3a69
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);