mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-25 22:13:04 +00:00
Properly deal with battery saver mode in capped FPS mode
This commit is contained in:
parent
7f2f2056c3
commit
d4bd29b320
@ -780,8 +780,18 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
streamView.setDesiredAspectRatio((double)prefConfig.width / (double)prefConfig.height);
|
streamView.setDesiredAspectRatio((double)prefConfig.width / (double)prefConfig.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: This assumes the refresh rate will always be successfully applied
|
if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION) ||
|
||||||
return displayRefreshRate;
|
getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
|
||||||
|
// TVs may take a few moments to switch refresh rates, and we can probably assume
|
||||||
|
// it will be eventually activated.
|
||||||
|
// TODO: Improve this
|
||||||
|
return displayRefreshRate;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Use the lower of the current refresh rate and the selected refresh rate.
|
||||||
|
// The preferred refresh rate may not actually be applied (ex: Battery Saver mode).
|
||||||
|
return Math.min(getWindowManager().getDefaultDisplay().getRefreshRate(), displayRefreshRate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("InlinedApi")
|
@SuppressLint("InlinedApi")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user