FORUMS
Remove All Ads from XDA

[APP] LMK Whitelist v2.0 for Semaphore, Mackay, Cyancore & Fishears

1,023 posts
Thanks Meter: 721
 
By superkoal, Senior Member on 17th April 2013, 09:30 PM
Post Reply Email Thread
I had a few spare hours and made an app to add processes to the whitelist of the low memory killer.

This feature is currently available in
Semaphore Kernel for 4.2 JB
Mackay Kernel (untested)
Cyancore (untested)
Fishears Kernel (untested)

You can add up to 6 apps (kernel-limit) that will not get killed if your phone needs free ram. The purpose of this is to prevent e.g. your launcher from being killed when your phone needs more ram - resulting in redraws and unresponsiveness.But be warned: if you add too many memory intensive apps to this list your phone will get laggy and in worst case you will get force closes.


How it works:
To make an app "invulnerable" one needs to write it's PID (process ID) in a Kernel-config file
To get the PID of an app it has to run
This is why the whitelist-app starts a service (on boot and if you change the config) that runs and checks periodically for PIDs until it has found all your selected apps

Be aware that the service will run forever if you add an app that never gets started to the list!
If you only add your launcher and/or other apps that run permanently it will finish immediately.

Of course this requires root permissions to work!!
It is not the prettiest android app there is, so feel free to contribute with a better layout


Since Version 1.2 there are 3 open intents, which let you clear/create the whitelist from within other apps. The intent actions are:
com.jb.semaphorelmkwhitelist.CLEAR_WHITELIST
com.jb.semaphorelmkwhitelist.CREATE_WHITELIST
com.jb.semaphorelmkwhitelist.TOGGLE_WHITELIST

BIG THANKS TO STRATOSK, the developer of Semaphore Kernel and the Semaphore Manager app.
Please consider donating to him to support the further development of the kernel.

If you want to support my work please have a look at my apps in play store (see my signature)

I will send the source code to anyone asking me via PM.


Changelog:
Raise Version to 2.0
-) Ability to detect services running in their own process (works for greenify, possibly also tasker - didn't check though)
-) Create Launcher shortcuts for apps combined with whitelist actions, takes label and icon from the selected app
- clear whitelist: recommended for games, whitelist needs to be manually enabled again afterwards
- temporary add to whitelist: recommended for music player apps, the started app gets added to the whitelist until it is refreshed

1.4
Fix wrong game mode state on reboot
Option to force greenify apps in game mode (enable in settings)

1.3
Changed launcher shortcut to toggle game mode (whitelist on/off)
Added new open intent TOGGLE_WHITELIST

1.2
Added Launcher shortcut to clear whitelist
Added open Intents to clear/create whitelist

1.1
Renamed to LMK Whitelist
Added option to disable toast messages
Added about dialog

1.0
Initial release
Attached Files
File Type: apk LMKWhitelist 1.1.apk - [Click for QR Code] (199.2 KB, 491 views)
File Type: apk LMKWhitelist 1.2.apk - [Click for QR Code] (200.4 KB, 180 views)
File Type: apk LMKWhitelist 1.3.apk - [Click for QR Code] (200.5 KB, 229 views)
File Type: apk LMKWhitelist 1.4.apk - [Click for QR Code] (201.0 KB, 213 views)
File Type: apk LMKWhitelist 2.0.apk - [Click for QR Code] (205.2 KB, 1495 views)
The Following 90 Users Say Thank You to superkoal For This Useful Post: [ View ] Gift superkoal Ad-Free
 
 
18th April 2013, 04:40 AM |#2  
grinder777's Avatar
Senior Member
Thanks Meter: 660
 
More
Great job! Thank you so much! Just installed and trying...

SGS - Sema 2.9.20s - Xylon 0.2.3.3 - Cobalt Sam-X - Big Thanx2all

---------- Post added at 04:40 AM ---------- Previous post was at 04:33 AM ----------

Nice one! I really like the infobox of this app. Well done!

SGS - Sema 2.9.20s - Xylon 0.2.3.3 - Cobalt Sam-X - Big Thanx2all
The Following User Says Thank You to grinder777 For This Useful Post: [ View ] Gift grinder777 Ad-Free
18th April 2013, 05:10 AM |#3  
Junior Member
Flag Valparaíso
Thanks Meter: 3
 
More
Great work! It seems to work fine. Thanks!
The Following User Says Thank You to daemon21 For This Useful Post: [ View ] Gift daemon21 Ad-Free
18th April 2013, 05:18 AM |#4  
ts1506's Avatar
Inactive Recognized Developer
Flag Kolkata
Thanks Meter: 4,515
 
More
There a 3 kernels which can use this app currently, semaphore, cyancore and mackay.

Also about the source, why not upload it to github.

Sent from my GT-P7500 using xda app-developers app
The Following User Says Thank You to ts1506 For This Useful Post: [ View ] Gift ts1506 Ad-Free
18th April 2013, 06:52 AM |#5  
Senior Member
Thanks Meter: 284
 
More
Nice job! I think a few screenshots would be nice in the OP!
The Following User Says Thank You to Rebel2k For This Useful Post: [ View ] Gift Rebel2k Ad-Free
18th April 2013, 07:57 AM |#6  
Member
Thanks Meter: 76
 
More
Great idea!
Thanks for the great idea and implementation, this is exactly what was needed to complete stratosk feature.

a small bug I encountered:
when trying to add the phone process through the "Lancher apps" list, if i press the "Phone" button the app adds the "com.android.contacts" process instead of the "com.android.phone" process. (BTW, pressing the "Contacts" button, also adds the "com.android.contacts" process).


Great job, Thanks!
18th April 2013, 08:24 AM |#7  
grinder777's Avatar
Senior Member
Thanks Meter: 660
 
More
Quote:
Originally Posted by ts1506

There a 3 kernels which can use this app currently, semaphore, cyancore and mackay.

Also about the source, why not upload it to github.

Sent from my GT-P7500 using xda app-developers app

I'm sure more kernel developers will implement it...
So, why not call it just LMK-Whitelist?

Also nobody could complain if you sell it at Playstore and share the profit with Stratosk...

For more comfort you could show the real name of the apps in the list and enable to choose all apps at once.

Great job, congratulations!

SGS - Sema 2.9.20s - Xylon 0.2.3.3 - Cobalt Sam-X - Big Thanx2all
The Following User Says Thank You to grinder777 For This Useful Post: [ View ] Gift grinder777 Ad-Free
18th April 2013, 08:49 AM |#8  
Senior Member
Thanks Meter: 1,308
 
More
Quote:
Originally Posted by grinder777

I'm sure more kernel developers will implement it...
So, why not call it just LMK-Whitelist?


I totally agree.
18th April 2013, 08:51 AM |#9  
elhennig's Avatar
Senior Member
Thanks Meter: 220
 
More
Quote:
Originally Posted by superkoal

How it works:
To make an app "invulnerable" one needs to write it's PID (process ID) in a Kernel-config file
To get the PID of an app it has to run
This is why the whitelist-app starts a service (on boot and if you change the config) that runs and checks periodically for PIDs until it has found all your selected apps

Be aware that the service will run forever if you add an app that never gets started to the list!
If you only add your launcher and/or other apps that run permanently it will finish immediately.

Hi,

do you think it would be possible to periodically check for the running apps and if they match the list configured in your app instead of having a service running once after the configuration or after system boot? As you stated the service is running forever if the app is not yet running. If you could make the interval to check for apps configurable, one could still use the current setup. But it could also be configured in the way that you just specify a list of apps, that are supposed to be LMK safe once they are running, and they would also be remove from the whitelist once you close them manually.

What do you think of this idea?
18th April 2013, 09:37 AM |#10  
OP Senior Member
Flag Vienna
Thanks Meter: 721
 
More
Quote:
Originally Posted by Rebel2k

Nice job! I think a few screenshots would be nice in the OP!

Thanks! I will add them in my next few spare hours

Quote:
Originally Posted by ziporpor

a small bug I encountered:
when trying to add the phone process through the "Lancher apps" list, if i press the "Phone" button the app adds the "com.android.contacts" process instead of the "com.android.phone" process. (BTW, pressing the "Contacts" button, also adds the "com.android.contacts" process).!

This is just the way android works - the apps in your launcher are sometimes combined in one package.

Quote:
Originally Posted by grinder777

I'm sure more kernel developers will implement it...
So, why not call it just LMK-Whitelist?

Also nobody could complain if you sell it at Playstore and share the profit with Stratosk...
For more comfort you could show the real name of the apps in the list and enable to choose all apps at once.!

Thanks, I will change the name.
I will think about it, but i don't think i will sell it, maybe i add a donate button.

Quote:
Originally Posted by elhennig

Hi, do you think it would be possible to periodically check for the running apps and if they match the list configured in your app instead of having a service running once after the configuration or after system boot? As you stated the service is running forever if the app is not yet running. If you could make the interval to check for apps configurable, one could still use the current setup. But it could also be configured in the way that you just specify a list of apps, that are supposed to be LMK safe once they are running, and they would also be remove from the whitelist once you close them manually. What do you think of this idea?

Not sure if I understood what you mean, just post again if I misunderstood.
You can already configure the check interval in settings (Hit the menu button!)
When I say the service runs forever it means that it will check every 60 seconds (configurable) if the selected apps are running.
Not sure why you want to remove apps from the whiteliste again, the whole purpose is to make an app always running.
Android won't kill an app in foreground...
The Following 3 Users Say Thank You to superkoal For This Useful Post: [ View ] Gift superkoal Ad-Free
18th April 2013, 09:48 AM |#11  
Member
Thanks Meter: 76
 
More
Quote:
Originally Posted by superkoal

This is just the way android works - the apps in your launcher are sometimes combined in one package.

It's not a bug, it's a feature

Thanks!
Post Reply Subscribe to Thread

Tags
free ram, kernel, low memory killer, semaphore

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes