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

Commit e4dc5d4e authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Fix two bugs in external storage accounting."

am: d1361ceb

Change-Id: I6f661104fbe8527bfbb1f9599beb395e5bc9d218
parents f6b468db d1361ceb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1184,6 +1184,7 @@ static void collectManualExternalStatsForUser(const std::string& path, struct st
        return;
    }
    while ((p = fts_read(fts)) != NULL) {
        p->fts_number = p->fts_parent->fts_number;
        switch (p->fts_info) {
        case FTS_D:
            if (p->fts_level == 4
@@ -1192,7 +1193,6 @@ static void collectManualExternalStatsForUser(const std::string& path, struct st
                    && !strcmp(p->fts_parent->fts_parent->fts_parent->fts_name, "Android")) {
                p->fts_number = 1;
            }
            p->fts_number = p->fts_parent->fts_number;
            // Fall through to count the directory
        case FTS_DEFAULT:
        case FTS_F:
@@ -1296,9 +1296,9 @@ binder::Status InstalldNativeService::getAppSize(const std::unique_ptr<std::stri
            ATRACE_END();

            ATRACE_BEGIN("external");
            auto extPath = create_data_media_package_path(uuid_, userId, pkgname, "data");
            auto extPath = create_data_media_package_path(uuid_, userId, "data", pkgname);
            collectManualStats(extPath, &extStats);
            auto mediaPath = create_data_media_package_path(uuid_, userId, pkgname, "media");
            auto mediaPath = create_data_media_package_path(uuid_, userId, "media", pkgname);
            calculate_tree_size(mediaPath, &extStats.dataSize);
            ATRACE_END();
        }