mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-24 21:42:44 +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);
|
||||
}
|
||||
|
||||
// FIXME: This assumes the refresh rate will always be successfully applied
|
||||
return displayRefreshRate;
|
||||
if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION) ||
|
||||
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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user