From d96b2ac076f0d82d3c2068cf4dda134bedb11dfe Mon Sep 17 00:00:00 2001 From: Daeho Jeong Date: Fri, 17 Jun 2022 11:06:37 -0700 Subject: [PATCH] Use sysfs control for storage device GC Sometimes, waiting for the HAL makes infinite calls to HAL and ending up with power consuming issues. While tracking the root cause, we will temporally turn off HAL for storage device GC. Bug: 235470321 Test: run "sm idle-maint run" Ignore-AOSP-First: This is a temporal fix for Android TM devices. Signed-off-by: Daeho Jeong Change-Id: Ieb371b7fdebfe938206a45547bb24dfbf2c2e7be --- IdleMaint.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/IdleMaint.cpp b/IdleMaint.cpp index 426be58..9d3450a 100644 --- a/IdleMaint.cpp +++ b/IdleMaint.cpp @@ -391,28 +391,6 @@ static void runDevGcOnHal(Service service, GcCallbackImpl cb, GetDescription get } static void runDevGc(void) { - auto aidl_service_name = AStorage::descriptor + "/default"s; - if (AServiceManager_isDeclared(aidl_service_name.c_str())) { - ndk::SpAIBinder binder(AServiceManager_waitForService(aidl_service_name.c_str())); - if (binder.get() != nullptr) { - std::shared_ptr aidl_service = AStorage::fromBinder(binder); - if (aidl_service != nullptr) { - runDevGcOnHal(aidl_service, ndk::SharedRefBase::make(), - &ndk::ScopedAStatus::getDescription); - return; - } - } - LOG(WARNING) << "Device declares " << aidl_service_name - << " but it is not running, skip dev GC on AIDL HAL"; - return; - } - auto hidl_service = HStorage::getService(); - if (hidl_service != nullptr) { - runDevGcOnHal(hidl_service, sp(new HGcCallbackImpl()), - &Return::description); - return; - } - // fallback to legacy code path runDevGcFstab(); }