Loading PREUPLOAD.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -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$" Loading cmds/installd/InstalldNativeService.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -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. } } } Loading cmds/installd/QuotaUtils.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -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 == "") { Loading cmds/installd/QuotaUtils.h +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading libs/graphicsenv/GraphicsEnv.cpp +17 −5 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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; } Loading @@ -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, Loading @@ -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 Loading
PREUPLOAD.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -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$" Loading
cmds/installd/InstalldNativeService.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -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. } } } Loading
cmds/installd/QuotaUtils.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -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 == "") { Loading
cmds/installd/QuotaUtils.h +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
libs/graphicsenv/GraphicsEnv.cpp +17 −5 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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; } Loading @@ -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, Loading @@ -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