react-native-track-player
react-native-track-player copied to clipboard
fix(android): check added to trigger onMediaKeyEvent if OxygenOS < 15
Summary
Fixes an issue on Oxygen OS < 15 where onMediaButton doesn't get called due to the OEM's implementation. As a result, the lock screen controls didn't work on Oxygen 14.
## Root Cause This was also an issue in Android 13 and below. It looks like OnePlus forgot to patch it on their end in Oxygen 14, but managed to fix it in Oxygen 15. I couldn't test it directly on 15, but according to this it seems to be working fine on Oxygen 15.
## Solution I've extended the original hack for Android 13 so it applies to Oxygen14 as well. Tested on a OnePlus9 (Oxygen 14) and a Pixel 9, to make sure it didn't break anything on non-One Plus devices. Both worked just fine.