From 2a610bb6291e5e0b0b14ed18a74eacb5c2a3fb6f Mon Sep 17 00:00:00 2001 From: Francescodario Cuzzocrea Date: Fri, 2 Jul 2021 22:58:56 +0200 Subject: [PATCH] universal8890: power: fix profile switching * also stop switching between balanced and power save when we are in non interactive state, as this can potentially override whatever the user set in battery settings Change-Id: I09246659749e7b9e5dd27c604ca54613e0a0a7e3 Signed-off-by: Francescodario Cuzzocrea --- hardware/power/Power.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hardware/power/Power.cpp b/hardware/power/Power.cpp index ed045d1..dc9ad1b 100644 --- a/hardware/power/Power.cpp +++ b/hardware/power/Power.cpp @@ -70,8 +70,6 @@ out: set("/sys/power/cpuhotplug/max_online_cpu", interactive ? "8" : "6"); - setProfile(interactive ? PowerProfile::POWER_SAVE : PowerProfile::BALANCED); - return Void(); } @@ -146,7 +144,7 @@ Return Power::getFeature(LineageFeature feature) { void Power::initialize() { findInputNodes(); - current_profile = PowerProfile::BALANCED; + setProfile(PowerProfile::BALANCED); for (const std::string& interactivePath : cpuInteractivePaths) { hispeed_freqs.emplace_back(get(interactivePath + "/hispeed_freq", "")); @@ -217,6 +215,8 @@ void Power::setProfile(PowerProfile profile) { default: break; } + + current_profile = profile; } void Power::sendBoostpulse() { -- GitLab