This seems like the lowest friction way of fixing
https://github.com/ppy/osu/issues/30885.
We could also only null this on application, but this feels worse
because
- It would require local handling (potentially complex) in
`BeatmapOffsetControl` if we want to continue displaying the graph and
button after clicking it.
- It would make the session static very specific in usage and
potentially make future usage not possible due to being nulled in only
a very specific scenario.
One might argue that it would be nice to have this non-null until the
next play, but if such a usage comes up I'd propose we rename this
session static and add a new one with that purpose.
- Uses Xamarin.Essentials in osu.Game.PlayerLoader to check battery level
- Encapsulated battery checking in the public BatteryManager class so battery level and plugged in status can be accessed and edited in TestPlayerLoader
- When checking battery level, catch NotImplementedException thrown by Xamarin.Essentials.Battery on non-mobile platforms
- Added visual unit tests for battery notification
To mock battery status and level, we had to define a batteryManager object in TestPlayerLoader and add a new function ResetPlayerWithBattery()
Co-Authored-By: Marlina José <marlina@umich.edu>