I recently came to know that unless you specifically ask the user to add your app in the "apps that can auto-run in the background" section, you cant make services which can run in the background in Xiaomi devices and other similar devices.
But I have see some apps like this one which are added in the device's "apps that can auto-run in the background" section automatically as soon they get downloaded without even asking for permission. How is that possible?
The manufacturer (or mobile operator, for "branded" firmware) has a "white-list" of apps that are "preapproved". Apps like Facebook, Twitter, GMail, etc. are in this list. If you want your app to be on the list, you'll need to contact the manufacturer and make a deal with them.