Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8fe077c authored by Connor O'Brien's avatar Connor O'Brien Committed by Steven Moreland
Browse files

libtimeinstate: correctly handle devices with no boost freqs



initGlobals() should only fail if a cpufreq policy doesn't report any
frequencies at all; if scaling_available_frequencies reports some
freqs then it's fine if scaling_boost_frequencies is absent

Bug: 138317993
Test: libtimeinstate_test passes on a device with no boost freqs
Change-Id: I3fe0f2fbdf61888406a687ba4016f9bf7fe4796a
Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
(cherry picked from commit e0b4d825)
Merged-In: I3fe0f2fbdf61888406a687ba4016f9bf7fe4796a
parent d65f2a02
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -110,9 +110,10 @@ static bool initGlobals() {
            std::string path =
                    StringPrintf("%s/%s/scaling_%s_frequencies", basepath, policy.c_str(), name);
            auto nums = readNumbersFromFile(path);
            if (!nums) return false;
            if (!nums) continue;
            freqs.insert(freqs.end(), nums->begin(), nums->end());
        }
        if (freqs.empty()) return false;
        std::sort(freqs.begin(), freqs.end());
        gPolicyFreqs.emplace_back(freqs);