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

Commit f8f80ae8 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6121193 from 966888df to rvc-release

Change-Id: I251f6c0d600e9ba31d7a90bfe5d6412d110827ce
parents d0945648 966888df
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -14,10 +14,12 @@ clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
               libs/renderengine/
               libs/ui/
               libs/vr/
               opengl/libs/
               services/bufferhub/
               services/inputflinger/
               services/surfaceflinger/
               services/vr/
               vulkan/

[Hook Scripts]
owners_hook = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} "OWNERS$"
+2 −4
Original line number Diff line number Diff line
@@ -639,10 +639,8 @@ binder::Status InstalldNativeService::clearAppData(const std::unique_ptr<std::st
                if (delete_dir_contents(path, true) != 0) {
                    res = error("Failed to delete contents of " + path);
                }
                path = StringPrintf("%s/Android/obb/%s", extPath.c_str(), pkgname);
                if (delete_dir_contents(path, true) != 0) {
                    res = error("Failed to delete contents of " + path);
                }
                // Note that we explicitly don't delete OBBs - those are only removed on
                // app uninstall.
            }
        }
    }
+20 −0
Original line number Diff line number Diff line
@@ -101,6 +101,26 @@ int64_t GetOccupiedSpaceForUid(const std::string& uuid, uid_t uid) {
    }
}

int64_t GetOccupiedSpaceForProjectId(const std::string& uuid, int projectId) {
    const std::string device = FindQuotaDeviceForUuid(uuid);
    if (device == "") {
        return -1;
    }
    struct dqblk dq;
    if (quotactl(QCMD(Q_GETQUOTA, PRJQUOTA), device.c_str(), projectId,
            reinterpret_cast<char*>(&dq)) != 0) {
        if (errno != ESRCH) {
            PLOG(ERROR) << "Failed to quotactl " << device << " for Project ID " << projectId;
        }
        return -1;
    } else {
#if MEASURE_DEBUG
        LOG(DEBUG) << "quotactl() for Project ID " << projectId << " " << dq.dqb_curspace;
#endif
        return dq.dqb_curspace;
    }
}

int64_t GetOccupiedSpaceForGid(const std::string& uuid, gid_t gid) {
    const std::string device = FindQuotaDeviceForUuid(uuid);
    if (device == "") {
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ int64_t GetOccupiedSpaceForUid(const std::string& uuid, uid_t uid);
/* Get the current occupied space in bytes for a gid or -1 if fails */
int64_t GetOccupiedSpaceForGid(const std::string& uuid, gid_t gid);

/* Get the current occupied space in bytes for a project id or -1 if fails */
int64_t GetOccupiedSpaceForProjectId(const std::string& uuid, int projectId);
}  // namespace installd
}  // namespace android

+17 −5
Original line number Diff line number Diff line
@@ -145,6 +145,12 @@ void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path,
void GraphicsEnv::hintActivityLaunch() {
    ATRACE_CALL();

    {
        std::lock_guard<std::mutex> lock(mStatsLock);
        if (mActivityLaunched) return;
        mActivityLaunched = true;
    }

    std::thread trySendGpuStatsThread([this]() {
        // If there's already graphics driver preloaded in the process, just send
        // the stats info to GpuStats directly through async binder.
@@ -228,12 +234,11 @@ void GraphicsEnv::setDriverLoaded(GpuStatsInfo::Api api, bool isDriverLoaded,
    ATRACE_CALL();

    std::lock_guard<std::mutex> lock(mStatsLock);
    const bool doNotSend = mGpuStats.appPackageName.empty();
    if (api == GpuStatsInfo::Api::API_GL) {
        if (doNotSend) mGpuStats.glDriverToSend = true;
        mGpuStats.glDriverToSend = true;
        mGpuStats.glDriverLoadingTime = driverLoadingTime;
    } else {
        if (doNotSend) mGpuStats.vkDriverToSend = true;
        mGpuStats.vkDriverToSend = true;
        mGpuStats.vkDriverLoadingTime = driverLoadingTime;
    }

@@ -250,10 +255,18 @@ static sp<IGpuService> getGpuService() {
    return interface_cast<IGpuService>(binder);
}

bool GraphicsEnv::readyToSendGpuStatsLocked() {
    // Only send stats for processes having at least one activity launched and that process doesn't
    // skip the GraphicsEnvironment setup.
    return mActivityLaunched && !mGpuStats.appPackageName.empty();
}

void GraphicsEnv::setTargetStats(const GpuStatsInfo::Stats stats, const uint64_t value) {
    ATRACE_CALL();

    std::lock_guard<std::mutex> lock(mStatsLock);
    if (!readyToSendGpuStatsLocked()) return;

    const sp<IGpuService> gpuService = getGpuService();
    if (gpuService) {
        gpuService->setTargetStats(mGpuStats.appPackageName, mGpuStats.driverVersionCode, stats,
@@ -265,8 +278,7 @@ void GraphicsEnv::sendGpuStatsLocked(GpuStatsInfo::Api api, bool isDriverLoaded,
                                     int64_t driverLoadingTime) {
    ATRACE_CALL();

    // Do not sendGpuStats for those skipping the GraphicsEnvironment setup
    if (mGpuStats.appPackageName.empty()) return;
    if (!readyToSendGpuStatsLocked()) return;

    ALOGV("sendGpuStats:\n"
          "\tdriverPackageName[%s]\n"
Loading