From 5f66fb8162935f342752ed069d8e967819b7f28b Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 23 Sep 2022 17:49:23 -0400 Subject: Change how memory policy is configured Should be a mostly no-op but adds a handful of new options * Adds a 'MemoryPolicy' to mostly consolidate memory settings * Moves trim handling into HWUI proper * Adds settings for UI hidden & context destruction that's not dependent on TRIM signals * Treats persistent process the same as system_server * Tweaks HardwareBitmapUploader timeout to reduce churn Bug: 245565051 Test: builds & boots Change-Id: I1f1b3db884ef7fa45ff2556436464a99440b998e --- libs/hwui/HardwareBitmapUploader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/hwui/HardwareBitmapUploader.cpp') diff --git a/libs/hwui/HardwareBitmapUploader.cpp b/libs/hwui/HardwareBitmapUploader.cpp index 7291cab364e2..b7e99994355c 100644 --- a/libs/hwui/HardwareBitmapUploader.cpp +++ b/libs/hwui/HardwareBitmapUploader.cpp @@ -42,6 +42,8 @@ namespace android::uirenderer { +static constexpr auto kThreadTimeout = 60000_ms; + class AHBUploader; // This helper uploader classes allows us to upload using either EGL or Vulkan using the same // interface. @@ -80,7 +82,7 @@ public: } void postIdleTimeoutCheck() { - mUploadThread->queue().postDelayed(5000_ms, [this](){ this->idleTimeoutCheck(); }); + mUploadThread->queue().postDelayed(kThreadTimeout, [this]() { this->idleTimeoutCheck(); }); } protected: @@ -97,7 +99,7 @@ private: bool shouldTimeOutLocked() { nsecs_t durationSince = systemTime() - mLastUpload; - return durationSince > 2000_ms; + return durationSince > kThreadTimeout; } void idleTimeoutCheck() { -- cgit v1.2.3-59-g8ed1b