From 809d59c234a1739bdce52a1194b73e7d242c407f Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 14 Nov 2023 21:45:21 +0100 Subject: [PATCH] Fix both way of setting min/middle/max CPU speed (#2019) --- lib/android/root.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/android/root.js b/lib/android/root.js index 21889e61cb..3d68e50a8a 100644 --- a/lib/android/root.js +++ b/lib/android/root.js @@ -120,7 +120,10 @@ export class RootedDevice { 'cat /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq' ); - if (this.options.androidPinCPUSpeed === 'min') { + if ( + this.options.androidPinCPUSpeed === 'min' || + (this.options.android && this.options.android.pinCPUSpeed === 'min') + ) { log.info('Set min CPU speed'); // The min settings, see the possible slowest setting by @@ -144,7 +147,10 @@ export class RootedDevice { await this._setCPU(minPolicy4, '4', 'max'); return this._setCPU(minPolicy4, '4', 'min'); } - } else if (this.options.androidPinCPUSpeed === 'middle') { + } else if ( + this.options.androidPinCPUSpeed === 'middle' || + (this.options.android && this.options.android.pinCPUSpeed === 'middle') + ) { log.info('Set middle CPU speed'); const middlePolicy0 = 910_000;