[Galaxy S 4 i9500 Android Development] est_yasser:
Sorry for being late.. I was so busy.

Here is the fix for whatsapp deep sleep issue and for other apps..

I want to mention that Haylcion has already provided a kernel to fix whatsapp deep sleep issue (didn't test it yet but some users reported working), but not sure if this will solve the issue with other apps also. anyways changing the kernel is part of my solution.

DO NANDROID BACKUP!!

Optionally

flash stock lollipop firmware

IF

you haven't never flashed it before, that's to void any future issues with lollipop based custom roms.

If you have already flashed the stock LP firmware before, then it's necessary to do that again.

Now download this zip file and extract it, you'll find:

1. stock kernel.zip >> (flashable zip file)

2. READ ME!!!.txt >> (instructions)

3. system >> the folder contains the xml file to replace in /system/etc

The flashable zip is a stock kernel. you can use any stock kernel like the one Haylcion provided recently (didn't test it yet but some users reported working). flash it via recovery then wipe cache and dalvik chache.

Find the xml file in "whatsapp fix\system\etc" and replace it in your phone into "/system/etc/" and set correct permissions (-rw-r--r--)

If you have any other app falling into deep sleep follow this tutorial..

navigate to /system/etc/ and open whitelist_appops.xml | it'll be look approximately like this

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<!--
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-->
<whitelist-pkgs>
<pkg name="android.process.acore"/>
<pkg name="com.android.inputmethod.latin"/>
<pkg name="com.android.launcher"/>
<pkg name="com.qualcomm.simcontacts"/>
<pkg name="com.google.android.music:main"/>
<pkg name="com.qualcomm.listen.voicewakeup"/>
<pkg name="com.qualcomm.gesturetouchinjectionservice"/>
<pkg name="com.android.deskclock"/>
<pkg name="com.android.providers.calendar"/>
<pkg name="com.android.mms"/>
<pkg name="dev.ukanth.ufirewall.donate"/>
<pkg name="android.process.media"/>
<pkg name="com.quicinc.CrashLogger"/>
<pkg name="com.android.musicfx"/>
<pkg name="com.google.android.apps.uploader"/>
<pkg name="com.halcyon.settings.hamed.ameli"/>
<pkg name="com.qualcomm.timeservice"/>
<pkg name="com.google.android.syncadapters.contacts"/>
<pkg name="com.android.dialer"/>
<pkg name="com.android.systemui"/>
</whitelist-pkgs>

Let's take whatsapp as an e.g:

insert a line right before

</whitelist-pkgs>

and add

<pkg name=""/>

then write the package name of the app falling deep sleep between the quotes, to be like this

<pkg name="com.whatsapp"/>

Have fun guys!!!! n cye :good: