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

Commit d4edce90 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...

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

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2078473



Change-Id: I03f7e1fead3058a76d2e82d41589618b7641c825
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 8823e097 817334c0
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;