I have a receiver registered in my app's manifest file with action BOOT_COMPLETED. There is a third-party library in my app and when it receives BOOT_COMPLETED action, it starts a service. Since there is background execution limits in Android Oreo, it crashes.
Now, I want to disable this receiver for only Android O devices. Is there a way to do this? Maybe just like @TargetApi but in Android Manifest?
I forgot to write that I cannot change library class, it's an external jar file.