Android L is for Lockdown

Root is, without a doubt, the (un)holy grail of the Android world. Those wonderful permissions that allow you as … more

XDA Xposed Tuesday: XHangouts Will Improve Your Hangouts

Ever since Google started supporting text messaging in Hangouts many people have … more

Shattered Screen? Turn Your Broken Device into a Complete Media Center!

A cracked screen usually means you’ll have to spend a hefty … more

Gmail 5.0: Material Design and Multiple Account Support

Google started to materialize many of its applications right after announcing the … more
Post Reply

[24.02.2010] AutoClosePatch 1.1

OP Chainfire

24th February 2010, 12:38 AM   |  #1  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 51,311
 
9,207 posts
Join Date:Joined: Oct 2007
Donate to Me
More
As posted on my blog: http://www.chainfire.eu/articles/68/..._1_0_released/

Updated to 1.1 on 24 February 2010

AutoClosePatch
Some devices, especially the new 2009 Omnia series from Samsung do not have a lot of memory available. Some of these are also configured to use rather aggressive memory management. The result is that you can hardly start any amount of applications (3 or 4, usually) before the system starts to shut down already running applications, while half or more of the available physical memory is not being used at all.

What AutoClosePatch attempts to do is hook into these memory management functions and beat them into submission, preventing them from doing anything we have not explicitly told them to do.

Of course, we do have to have automatic application closing functionality so our devices do not get stuck in a low memory position, so occasionally we let the system do what it wants within specified parameters.

Note that this patch was specifically written and only tested on the Omnia II (I8000), but it should work on many WM 6.5 devices. This patch does not need any of the other changes mentioned in various MoDaCo threads and is compatible with TaskMon!

Also note that the system is not always very smart, and in my experience tends to close the last application I openened instead of the first.

Beta
Consider this a beta version (even though it is a 1.0 release). Several factors come into play and operation cannot be guaranteed. Works great for me, though!

I take no responsibility for issues that may occur, at all. If your dog explodes due to using AutoClosePatch, tough luck.

Settings
By default, my Omnia II starts closing apps when available memory drops below about 30mb, and doesn't stop closing apps until available memory has risen above about 45mb. As I start out with about 50mb of available memory this isn't very handy.

AutoClosePatch's default settings are to not start closing apps until available memory drops below 15mb, and to stop closing apps when available memory has risen to above 20mb.

The "Ultra" variant lowers this to 10/15, but has more chance of showing you an 'out-of-memory' dialog.

Installation
Install the AutoClosePatch CAB. If you want to play with the "Ultra" variant, install the normal version first!

Soft-reset after installation

Uninstallation
Simply uninstall the CAB files if you are not using the "Ultra" variant. Uninstalling will clear most settings but not some system settings. These changes aren't harmful, but you'll need to hard-reset to clear them up.

Soft-reset after uninstallation

Technical
Skip this part if you're not a techy

The whole thing is done through run-time patching, this means no files are modified on the device itself, only in-memory.

Some system calls are overridden / intercepted in shell32.exe, and depending on actual memory state WM_CLOSE may be re-cast as WM_HIBERNATE.

For the new 2009 Omnia series from Samsung TaskMon.dll is also patched, disabling it's application closing functionality. All other TaskMon functions should remain fully operational. In essence, only the standard WM application closing functionality should remain functional.

The low memory boundary (when apps start being closed) can be configured through the following registry key:

HKEY_CURRENT_USER\Software\Chainfire\AutoClosePatc h\CloseStartMB

The high memory boundary (when apps stop being closed) can be configured through the following reigstry key:

HKEY_CURRENT_USER\Software\Chainfire\AutoClosePatc h\CloseStopMB

You must soft-reset after changing these keys for them to take effect.

Also note that if you are going below the default 15/20 value you must install the "Ultra" settings first.

Furthermore, if you are playing with very low settings (and are thus using the "Ultra" settings) make sure to NOT set the CloseStopMB value above 20!

Downloads
REDISTRIBUTION AND COOKING INTO ROMS IS EXPLICITLY FORBIDDEN (for the time being)

AutoClosePatch v1.1

AutoClosePatch v1.1 Ultra (Settings only)

Donate
Donations can be made through PayPal

Changelog
1.1 Adjusted closing behavior so it closes less programs
1.1 Slightly adjusted default settings

1.0 Initial release
Last edited by Chainfire; 2nd March 2010 at 11:01 AM. Reason: I put in the thread title it was released 24 october 2010... doh
24th February 2010, 02:01 AM   |  #2  
Junior Member
Thanks Meter: 1
 
4 posts
Join Date:Joined: Mar 2009
looks pretty cool
my omnia should arrive sometime next week, will definitely use this.
thanks !
24th February 2010, 02:25 AM   |  #3  
khomen's Avatar
Member
Thanks Meter: 1
 
59 posts
Join Date:Joined: Jan 2010
does not really work for me, whenever i get to 10mb of free ram, all applications get closed ...
24th February 2010, 12:31 PM   |  #4  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 51,311
 
9,207 posts
Join Date:Joined: Oct 2007
Donate to Me
More
khomen that should be fixed in 1.1
24th February 2010, 02:53 PM   |  #5  
Senior Member
Flag Manila
Thanks Meter: 3
 
133 posts
Join Date:Joined: Jul 2007
More
Works with Omnia B7610 but with a bug

When memory reaches 24mb down (in my case 24-18mb) you cannot open anymore applications/programs,and those that were opened (16 apps opened with 24mb left) even the task manager cannot be opened, so soft reset is needed to close all... Though system apps (those in the settings) still open and run.
24th February 2010, 05:15 PM   |  #6  
Member
Thanks Meter: 11
 
66 posts
Join Date:Joined: Apr 2008
Thank you my good man 08C54399RW746270M Here you have little something for beer
Last edited by jakaka; 24th February 2010 at 05:17 PM.
1st March 2010, 03:45 PM   |  #7  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 51,311
 
9,207 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Quote:
Originally Posted by fire_z

Works with Omnia B7610 but with a bug

When memory reaches 24mb down (in my case 24-18mb) you cannot open anymore applications/programs,and those that were opened (16 apps opened with 24mb left) even the task manager cannot be opened, so soft reset is needed to close all... Though system apps (those in the settings) still open and run.

Did this happen with 1.0 or 1.1 ?

Please try agian with 1.1 and make sure to soft-reset after installation !
4th March 2010, 08:06 AM   |  #8  
sudkcoce's Avatar
Senior Member
Thanks Meter: 197
 
763 posts
Join Date:Joined: Sep 2009
Thank you!
Works great on my omnia i900!
Just what I needed!

Best regards!
4th March 2010, 02:31 PM   |  #9  
junalmeida's Avatar
Recognized Developer
Flag Rio de Janeiro
Thanks Meter: 19
 
192 posts
Join Date:Joined: Nov 2007
More
Hi Chainfire,

Donation sent to keep your research on.
Thanks very much.
25th April 2010, 04:11 AM   |  #10  
Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Mar 2010
Thank you so much.

I found this thread from WinMo and is now going to give it a try.

Thanks again for your work!

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes