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

Commit 16897382 authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge "installd: only delete contents of user's CE and DE dirs" am: 6f73923f am: bece8487

parents d80e33de bece8487
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1869,8 +1869,9 @@ binder::Status InstalldNativeService::destroyUserData(const std::optional<std::s
    binder::Status res = ok();
    if (flags & FLAG_STORAGE_DE) {
        auto path = create_data_user_de_path(uuid_, userId);
        if (delete_dir_contents_and_dir(path, true) != 0) {
            res = error("Failed to delete " + path);
        // Contents only, as vold is responsible for the user_de dir itself.
        if (delete_dir_contents(path, true) != 0) {
            res = error("Failed to delete contents of " + path);
        }
        auto sdk_sandbox_de_path =
                create_data_misc_sdk_sandbox_path(uuid_, /*isCeData=*/false, userId);
@@ -1890,8 +1891,9 @@ binder::Status InstalldNativeService::destroyUserData(const std::optional<std::s
    }
    if (flags & FLAG_STORAGE_CE) {
        auto path = create_data_user_ce_path(uuid_, userId);
        if (delete_dir_contents_and_dir(path, true) != 0) {
            res = error("Failed to delete " + path);
        // Contents only, as vold is responsible for the user_ce dir itself.
        if (delete_dir_contents(path, true) != 0) {
            res = error("Failed to delete contents of " + path);
        }
        auto sdk_sandbox_ce_path =
                create_data_misc_sdk_sandbox_path(uuid_, /*isCeData=*/true, userId);
@@ -1899,8 +1901,9 @@ binder::Status InstalldNativeService::destroyUserData(const std::optional<std::s
            res = error("Failed to delete " + sdk_sandbox_ce_path);
        }
        path = findDataMediaPath(uuid, userId);
        if (delete_dir_contents_and_dir(path, true) != 0) {
            res = error("Failed to delete " + path);
        // Contents only, as vold is responsible for the media dir itself.
        if (delete_dir_contents(path, true) != 0) {
            res = error("Failed to delete contents of " + path);
        }
    }
    return res;