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

Commit a679b14e authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge changes from topic "resolve-merge-conflicts" into qt-dev-plus-aosp

* changes:
  Remove storage sandboxes related code.
  [sf] Move texture deletion to main thread via pool
parents 49719f6f f293278f
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -581,10 +581,6 @@ binder::Status InstalldNativeService::clearAppData(const std::unique_ptr<std::st
            // No code cache on shared storage
        } else {
            // Clear everything on shared storage
            path = StringPrintf("%s/Android/sandbox/%s", extPath.c_str(), pkgname);
            if (delete_dir_contents(path, true) != 0) {
                res = error("Failed to delete contents of " + path);
            }
            path = StringPrintf("%s/Android/data/%s", extPath.c_str(), pkgname);
            if (delete_dir_contents(path, true) != 0) {
                res = error("Failed to delete contents of " + path);
@@ -668,10 +664,6 @@ binder::Status InstalldNativeService::destroyAppData(const std::unique_ptr<std::
        }

        auto extPath = findDataMediaPath(uuid, userId);
        path = StringPrintf("%s/Android/sandbox/%s", extPath.c_str(), pkgname);
        if (delete_dir_contents_and_dir(path, true) != 0) {
            res = error("Failed to delete " + path);
        }
        path = StringPrintf("%s/Android/data/%s", extPath.c_str(), pkgname);
        if (delete_dir_contents_and_dir(path, true) != 0) {
            res = error("Failed to delete " + path);
@@ -1694,8 +1686,6 @@ binder::Status InstalldNativeService::getAppSize(const std::unique_ptr<std::stri
            }

            ATRACE_BEGIN("external");
            auto sandboxPath = create_data_media_package_path(uuid_, userId, "sandbox", pkgname);
            calculate_tree_size(sandboxPath, &extStats.dataSize);
            auto extPath = create_data_media_package_path(uuid_, userId, "data", pkgname);
            collectManualStats(extPath, &extStats);
            auto mediaPath = create_data_media_package_path(uuid_, userId, "media", pkgname);
+13 −3
Original line number Diff line number Diff line
@@ -590,7 +590,11 @@ uint32_t SurfaceFlinger::getNewTexture() {
}

void SurfaceFlinger::deleteTextureAsync(uint32_t texture) {
    postMessageAsync(new LambdaMessage([=] { getRenderEngine().deleteTextures(1, &texture); }));
    std::lock_guard lock(mTexturePoolMutex);
    // We don't change the pool size, so the fix-up logic in postComposition will decide whether
    // to actually delete this or not based on mTexturePoolSize
    mTexturePool.push_back(texture);
    ATRACE_INT("TexturePoolSize", mTexturePool.size());
}

// Do not call property_set on main thread which will be blocked by init
@@ -2078,12 +2082,18 @@ void SurfaceFlinger::postComposition()

    {
        std::lock_guard lock(mTexturePoolMutex);
        if (mTexturePool.size() < mTexturePoolSize) {
            const size_t refillCount = mTexturePoolSize - mTexturePool.size();
        if (refillCount > 0) {
            const size_t offset = mTexturePool.size();
            mTexturePool.resize(mTexturePoolSize);
            getRenderEngine().genTextures(refillCount, mTexturePool.data() + offset);
            ATRACE_INT("TexturePoolSize", mTexturePool.size());
        } else if (mTexturePool.size() > mTexturePoolSize) {
            const size_t deleteCount = mTexturePool.size() - mTexturePoolSize;
            const size_t offset = mTexturePoolSize;
            getRenderEngine().deleteTextures(deleteCount, mTexturePool.data() + offset);
            mTexturePool.resize(mTexturePoolSize);
            ATRACE_INT("TexturePoolSize", mTexturePool.size());
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -856,7 +856,7 @@ struct BufferLayerVariant : public BaseLayerVariant<LayerProperties> {
    }

    static void cleanupInjectedLayers(CompositionTest* test) {
        EXPECT_CALL(*test->mMessageQueue, postMessage(_, 0)).Times(2);
        EXPECT_CALL(*test->mMessageQueue, postMessage(_, 0)).Times(1);
        Base::cleanupInjectedLayers(test);
    }