Skip to content

Commit

Permalink
Fix both way of setting min/middle/max CPU speed (#2019)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Nov 14, 2023
1 parent 62de4fc commit 809d59c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/android/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 809d59c

Please sign in to comment.