diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-22 01:03:12 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-22 01:03:12 +0000 |
commit | e8a954b6a15e80f5e73dd26c8d3531b5fff77208 (patch) | |
tree | 7a071389b9df0b2c2fc349e284d3d92c52b6dc27 | |
parent | 6c475afdd94a1d7c03abbfb1a4d7084121400c21 (diff) | |
parent | 37162fb4ff78efd4e0417d0c1ebae503e73878ba (diff) | |
download | camera-e8a954b6a15e80f5e73dd26c8d3531b5fff77208.tar.gz |
Snap for 6698401 from 37162fb4ff78efd4e0417d0c1ebae503e73878ba to rvc-d1-release
Change-Id: I4faacd5595f2c22251565912b6dab06eb1117242
-rw-r--r-- | common/hal/hidl_service/hidl_camera_device_session.cc | 6 | ||||
-rw-r--r-- | common/hal/hidl_service/hidl_camera_provider.cc | 2 | ||||
-rw-r--r-- | common/hal/hidl_service/service.cc | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/common/hal/hidl_service/hidl_camera_device_session.cc b/common/hal/hidl_service/hidl_camera_device_session.cc index 0b3aede..0179805 100644 --- a/common/hal/hidl_service/hidl_camera_device_session.cc +++ b/common/hal/hidl_service/hidl_camera_device_session.cc @@ -15,10 +15,13 @@ */ #define LOG_TAG "GCH_HidlCameraDeviceSession" +#define ATRACE_TAG ATRACE_TAG_CAMERA //#define LOG_NDEBUG 0 #include <log/log.h> #include <cutils/properties.h> +#include <cutils/trace.h> +#include <malloc.h> #include "hidl_camera_device_session.h" #include "hidl_profiler.h" @@ -68,6 +71,8 @@ std::unique_ptr<HidlCameraDeviceSession> HidlCameraDeviceSession::Create( HidlCameraDeviceSession::~HidlCameraDeviceSession() { close(); + // camera's closing, so flush any unused malloc pages + mallopt(M_PURGE, 0); } void HidlCameraDeviceSession::ProcessCaptureResult( @@ -661,7 +666,6 @@ Return<void> HidlCameraDeviceSession::close() { auto profiler_item = hidl_profiler::OnCameraClose(); device_session_ = nullptr; } - return Void(); } diff --git a/common/hal/hidl_service/hidl_camera_provider.cc b/common/hal/hidl_service/hidl_camera_provider.cc index a7ce5e2..7193a26 100644 --- a/common/hal/hidl_service/hidl_camera_provider.cc +++ b/common/hal/hidl_service/hidl_camera_provider.cc @@ -157,6 +157,8 @@ status_t HidlCameraProvider::Initialize() { }; google_camera_provider_->SetCallback(&camera_provider_callback_); + // purge pending malloc pages after initialization + mallopt(M_PURGE, 0); return OK; } diff --git a/common/hal/hidl_service/service.cc b/common/hal/hidl_service/service.cc index 48217b7..2b203d7 100644 --- a/common/hal/hidl_service/service.cc +++ b/common/hal/hidl_service/service.cc @@ -23,6 +23,7 @@ #include <android/hardware/camera/provider/2.6/ICameraProvider.h> #include <binder/ProcessState.h> #include <hidl/LegacySupport.h> +#include <malloc.h> using android::hardware::defaultLazyPassthroughServiceImplementation; using android::hardware::defaultPassthroughServiceImplementation; @@ -38,6 +39,7 @@ int main() { ALOGI("Google camera provider service is starting."); // The camera HAL may communicate to other vendor components via // /dev/vndbinder + mallopt(M_DECAY_TIME, 1); android::ProcessState::initWithDriver("/dev/vndbinder"); int res; if (kLazyService) { |