1) Android™ 6.0.1 or higher a. To make exceptions from optimisation - From your Home screen, tap the Application screen icon. - Find and tap Settings > Battery. - Tap the menu button (three vertical dots) and select Battery optimisation. A list appears showing applications that are not optimised. - To add apps to this list, swipe to the APPS tab. - To add an app, tap it to mark its checkbox. This exempts the app from being affected by App Standby and, where available, Doze mode and STAMINA mode.
2) Android™ 6.0 a. To make exceptions from optimisation - From your Home screen, tap the Application screen icon. - Find and tap Settings > Battery or Battery usage. - Tap the menu button (three vertical dots) and select Battery optimisation. A list appears showing applications that are not optimised. - To add applications to this list, tap Not optimised > All apps. - Tap an app, then tap Don't optimise > DONE. This exempts the app from being affected by App Standby and, where available, Doze mode and STAMINA mode.
3) Android™ 5.x - From your Home screen, tap the Settings screen icon (Gear). - Find and tap Power management > STAMINA mode - Tap Apps active in standby, and add application
This article from SONY for XPERIA mobiles could be interesting for above mentioned: http://support.sonymobile.com/global-en/xperiaxa/kb/80193074012a2df1c0151cca06151007353/