OxygenOS is often described as one of the best skins for Android on the market. It's fast, clean and has a lot of useful features that appeals to almost anyone. However, it also faces a significant problem for the longest time – overly aggressive battery optimizations that often stop background apps, including Gmail services. Even disabling battery optimization does not work. So this is a current issue that has not been resolved yet. Luckily, there's a Magisk module that can fix the issues with Gmail. Developer David Sn's aptly named OxygenOS Gmail Battery Fix replaces an XML file in the app to override problematic battery optimization.
Open the Magisk Manager app, tap the menu icon on the left, and then go to Downloads. Tap the search icon and enter the term "gmail" to find the OxygenOS Gmail Battery Fix module.
Tap once on the download arrow, and then tap Install. Give Magisk Manager the required permissions by tapping "Allow" and the installation process begins.
The module will be installed in seconds. When finished, tap the "Restart" button below to restart the phone and enable the module.
After the restart, all you have to do is wait for a Gmail alert to arrive. This should now work flawlessly as the module completely disables the towering battery optimizations for Gmail. Even if your screen is off, you should receive e-mail alerts almost immediately. However, future system updates may potentially damage the module. Keep this in mind when you receive again missing notifications.
Of course, Gmail is not the only app that has background service issues with OxygenOS. The problem is bad enough that someone had to create a module to fix it, so that speaks volumes. With Android 10 "Q" just around the corner, OnePlus has the ability to fix this problem by fixing it at the system level.
The module works the same for me only with OnePlus 6T and 7 Pro, but it may not work for everyone. During my tests, my Gmail notifications went through everytime without any problems. Notifications were usually prompt, although some took up to two minutes. Still a lot better than it was. Hopefully, everything will work for you until OnePlus releases an official fix for OxygenOS.