[MOD]{Test 14} Sense 4+ MultiTasking Breakthrough!Non-Sense App Limit! TRY & KILL IT!

zeppelinrox

Senior Member
Dec 21, 2010
9,374
21,587
0
IN THE FREAKIN' OP
[MOD]{Test 14} Sense 4+ MultiTasking Breakthrough!Non-Sense App Limit! TRY & KILL IT!

====================================================
If this is helpful, please Rate the thread 5 Stars and click Thanks! :)
====================================================

It's been awhile since I've made a new thread but I thought that I should make one here...
Since this is where I figured out how to get proper multitasking to work on newer Sense ROMS.
And I'd like to refine it some more :D

==========================================================

It all started weeks ago when I first released my -=Maximum Overdrive=- Multitasking Mod.
It fixes Multitasking on ALL ROMS from Froyo to Jelly Bean (except for those with Sense 4 and up lol)
How? To put it simply, I bumped the MAX_HIDDEN_APPS value from 15 to 70 :D

And now, you can now patch your Sense services.jar yourself!

Do it with the Ultimate Jar Power Tools Patcher script HERE!
It's available as a Windows exe HERE! but does not yet have the Non-Sense App Limit (soon)

A great addition to this mod is the Unlimited Recent Apps Panels mod by steal25.
I tried and failed to do it :cyclops: - but at least I was able to help him break the 16 panel barrier to make it Unlimited :D

==========================================================

The plan is to have Sense's app limit bumped from 8 visible apps to 50 apps.

Don't worry about if you can't run that many apps at once - the lowmemorykiller will kick in according to your minfrees...
Just crank them up if you need more free ram... lower them for more multitasking :)

I'd suggest using V6 SuperCharger in conjunction with the mod in order to tweak the minfrees, but more importantly, take advantage of its OOM grouping fixes
The OOM grouping fixes will help ensure that the higher, supercharged ADJs won't result in an overly-aggressive lowmemorykiller.

So if you're enjoying multitasking improvement without using V6 SuperCharger's grouping fix - it's even better with SuperCharger!
Get it HERE

==========================================================

A few ROMS already have this implemented but for those that don't, give it a spin!

Included Mods:

SuperCharged with Die-Hard Launcher
Maximum Multitasking Mods ie. -=Maximum Overdrive=- and Time Killer Killer
Non-Sense App Limit!

Installation:

1. Optional But Highly Recommended: Install my latest V6 SuperCharger script. See above as to why :)
2. Download your modded services-sense*.jar and rename it as services.jar
3. In terminal type: su, enter. Leave terminal running.
4. Copy the new services.jar into your /system/framework folder.
5. Go back to terminal and type: cd /system/framework, enter, chown 0.0 services.jar, enter, chmod 644 services.jar, enter.
6. Reboot. This will take awhile since it will optimize apps the first time.

==========================================================

About Battery Life: If you think battery is draining quicker, give it a couple of days before assuming the worst.
I'd guess that battery life should get better since the device won't have to restart apps as much as before.

==========================================================

So this is the progression for those that don't know what's up so far...

Test 1 - Found the additional Sense app limit... but FAILS to boot... lol
Test 1B - Boots! But doesn't work as good as hoped.
Test 2 - Ok now we're getting somewhere... messing with HTC_RECENT_APP_FUSION seems to be the key...
Test 3 - Fine tune a bit...
Test 4 - More refinements...
Test 5 - Totally disable MAX_VISIBLE_TASKS? Tweaked SuperCharger (more complete)
Test 6 - Tweaked "Trimming Apps" routine to take into account the larger max hidden apps value.
Test 7 - HIGHLY EXPERIMENTAL - Changed HIDDEN_APP_MIN_ADJ (priority) to be the same as SERVICE_ADJ - Why? Well... it may prevent recently ran apps like facebook or your browser from reloading since MaxOD is succesfully allowing 70 hidden apps to stay in memory.
Test 8 - Did away with last change - HIDDEN_APP_MIN_ADJ is back to stock ADJ 9
.......... - "Hidden Protector" added - less important Empty Apps can kick out more important hidden apps from memory. By default, Android will keep at least 2 hidden apps in memory before this happens. I bumped it up to 15 :)
.......... - I also prevent Server apps (apps you just left with ADJ 6 priority) from becoming a "worstType" ie. likely to be killed. This doesn't happen in pre-ICS roms so hey... it's worth a shot, eh?
Test 9 - HIGHLY EXPERIMENTAL - Going with the idea of making Service apps the same as Hidden Apps (since I can greatly control hidden apps) I raised the service app ADJ to be the same as hidden.
.......... - Re-enable HTC_RECENT_APP_FUSION since I'm now able to raise the visible app and recent app limits without touching it. This also means I don't have to mess with TaskRecord.smali or ActivityStack.smali.
Test 10 - Updating Ultimatic Tools code so here's a test run. Service Apps back to the usual ADJ as a test to see if previous test (with service adj the same as hidden apps) is better or not
Test 11 - Sense 4+! Not too much different appart from a big ass song and dance in ProcessList.smali to determine Max Hidden Apps based on ram.
By default I see that if you have 512 mb of ram, it's 10 apps, if you have 2gb of ram it's only 20 apps. Otherwise, it's the usual 15.
But it's 70 apps across the board in these jars lol
Test 12 - Sense 4+ - BIG TEST! After some deep analysis, I've made some important changes that should make memory management smoother. Lots of fixed up if/else conditions (which weren't making sense after changing ADJs) but also took out a few edits that actually hampered memory management to an extent.
Test 13 - Further refinements over Test 12. This is REALLY good... :D Also removed signature check so it better NOT bootloop :) (Thanks il Duce for the heads up)
Test 14 - Forced the low minfrees in ProcessList.smali so that the lowmemorykiller will treat ram like it's on a low memory device which means much less app killing overall.
Test 15 - Added: Hard-Coded minfrees - to ProcessList.smali. Without any minfree tweaks, the lowmemorykiller minfrees are 10, 14, 100, 110, 120, 130
............. - Added: Hard-Coded OOM Grouping Fix (adj grouping) - to ProcessList.smali. Without any adj grouping tweaks, the values are SuperChargers - 0, 3, 6, 10, 12, 15 (default is 0, 1, 2, 4, 7, 15)
............. - Added: Idle Offset Control Valve (see code below) - to ProcessList.smali and ActivityManagerService.smali
Code:
    // We put empty content processes   after any hidden processes that have
    // been idle for less than [COLOR=Red]15 seconds[/COLOR].
    static final long CONTENT_APP_IDLE_OFFSET = 15*1000;

    // We put empty content processes after any hidden processes that have
    // been idle for less than [COLOR=Red]120 seconds[/COLOR].
    static final long EMPTY_APP_IDLE_OFFSET = 120*1000;
I made:
CONTENT_APP_IDLE_OFFSET = 65 seconds (instead of 15 seconds)
EMPTY_APP_IDLE_OFFSET = 305 seconds (instead of 120 seconds)

So now, if there were apps that normally get killed which you BulletProof (with V6 SuperCharger), you can probably now lessen the BulletProof frequency (it's an option now lol).
Say make it 60 seconds instead of 30 seconds.
I know some apps normally need it as low as 14 seconds to never get killed - which is why I figure it's related to content app idle offset default of 15 seconds.

============================================================

What's hacked:

ActivityManagerService.smali
SuperCharging
Time Killer Killer - MAX_SERVICE_INACTIVITY boosted from 30 minutes to 24hrs
Non-Sense App Limit
..... - MAX_RECENT_TASKS boosted from 20 to 50
..... - MAX_VISIBLE_TASKS boosted from 8 to 50
..... - Rendered HTC_RECENT_APP_FUSION a non-factor - it prevented the application of boosted values

ProcessList.smali
SuperCharging
Maximum Overdrive - MAX_HIDDEN_APPS boosted from 15 to 70

==========================================================

How do I know if it worked?

Mod 1.
Run the latest V6 SuperCharger script and it will tell you if your launcher is SuperCharged!

Mods 2 and 3. Install System Tuner and put the widget on the desktop.
Make note of how many apps the widget shows running after running a whole bunch of apps.
It would look like ##/##

So feel free to post before and after screen shots!

==========================================================

Another Test for Maximum Overdrive - Install aLogcat, before and after the mod, run as many apps as you can, run aLogcat and search for longer.

Example Before and After....



Notice how there is very little killing activity after the mod?
But more importantly, notice that before the mod, app #16 gets killed. After the mod, app #71 gets killed.
Because max hidden apps went from 15 to 70 :D
Note that you will likely see a blank screen after the mod, that means you never hit the app limit so nothing got killed :cool:

==========================================================

Feedback will be appreciated

For assistance, testing and support, thanks to:
il Duce, jeffsanace, steal25, bog3nator, fernando sor, mrlakadaddy, SteelH

Click THANKS, it tickles :cool:
 

Attachments

Last edited:

bog3nator

Senior Member
Dec 23, 2008
1,806
375
0
37
Lubbock
It's been awhile since I've made a new thread but I thought that I should make one here...
Since this is where I figured out how to get proper multitasking to work on newer Sense ROMS.
And I'd like to refine it some more :D

The plan is to have the app limit bumped from 8 apps to 50 apps.

Don't worry about if you can't run that many apps at once - the lowmemorykiller will kick in according to your minfrees...
Just crank them up if you need more free ram... lower them for more multitasking :)

I'd suggest using V6 SuperCharger in conjunction with the mod in order to tweak the minfrees, but more importantly, take advantage of its OOM grouping fixes
The OOM grouping fixes will help ensure that the higher, supercharged ADJs won't result in an overly-aggressive lowmemorykiller.

So if you're enjoying multitasking improvement without using V6 SuperCharger's grouping fix - it's even better with SuperCharger!

==========================================================

So this is the progression for those that don't know what's up so far...

Test 1 - Found the additional Sense app limit... but FAILS to boot... lol
Test 1B - Boots! But doesn't work as good as hoped.
Test 2 - Ok now we're getting somewhere... messing with HTC_RECENT_APP_FUSION seems to be the key...
Test 3 - Fine tune a bit...
Test 4 - More refinements...

==========================================================

As of now... Test 4, the latest, is working great as far as I know :D
I'm re-attaching here for convenience.

There are more tests that I'd like to try so I'll attach the latest tests to this OP as well.

Feedback will be appreciated.

==========================================================

A few ROMS already have this implemented but for those that don't, give it a whirl!

What's inside:

SuperCharged with Die-Hard Launcher
Maximum Multitasking Mods ie. -=Maximum Overdrive=- and Time Killer Killer
Non-Sense App Limit!

To install:

1. Rename your downloaded jar as services.jar
2. Copy the new services.jar into your /system/framework folder.
3. In terminal type: su, enter, cd /system/framework, enter, chown 0.0 services.jar, enter, chmod 644 services.jar, enter.
4. Reboot. This will take awhile since it will optimize apps the first time.To install...

==========================================================

About Battery Life: If you think battery is draining quicker, give it a couple of days before assuming the worst.
I'd guess that battery life should get better since the device won't have to restart apps as much as before.

For assistance, testing and support, thanks to:
il Duce, jeffsanace, bog3nator, fernando sor, mrlakadaddy, SteelH

Click THANKS, it tickles :cool:
woot! welcome! officially!

edit: i can say this for the first time ever! FIRST!
 
Last edited:

zeppelinrox

Senior Member
Dec 21, 2010
9,374
21,587
0
IN THE FREAKIN' OP
woot! welcome! officially!

edit: i can say this for the first time ever! FIRST!
Thanks man :)
And thanks again for all the testing you've done so far :cool:
looks to me that you sir have some serious skills in ur bag. you should make some sick ass serious ROM and just take the hole dag on thread over lol....great work man!
heh thanks.
I've never made a ROM.
It would probably be easier to hook up with a team and call it Super Multitasking Overdrive Kick Ass Ignition Nitro Goo.

Or SMOKING ROM for short lol
meanrom has the oom settings at like 10, (some numbers) 40 lol, what settings do you suggest?
What does SuperCharger suggest?
 

zeppelinrox

Senior Member
Dec 21, 2010
9,374
21,587
0
IN THE FREAKIN' OP
I forgot bog3nator posted his boom stick output in the other thread
Code:
You have 770 MB of RAM on your device...
         ...1000 HP settings are recommended!

          -=SuperMinFree Calculator=- says:

   Cust-OOMize with 8, 16, 154, 169, 184, 200 MB!
Not sure why it would say 180mb for you when it says 154 for bog?
Anyway, it's safe to play with settings to find ones that work for your use.
If setting 8 is too high, maybe try 7.
 
  • Like
Reactions: mrlakadaddy

EPayne123

Senior Member
Jan 11, 2010
744
166
0
31
Fort Myers
Sorry, those look like the settings I had gotten. Must be wrong, disregard. My apologies.

Sent from my EVO

---------- Post added at 06:08 AM ---------- Previous post was at 06:07 AM ----------

I would say that anything lower than 6-7 may be cutting it too low for AOSP on our device BUT like u said, it all depends on the end user.

Sent from my EVO
 

zeppelinrox

Senior Member
Dec 21, 2010
9,374
21,587
0
IN THE FREAKIN' OP
Yes if you know the edits to make :p

Once I release the the updated script, you'd be able to follow Post 2 of the SuperCharger thread on how to patch services.odex and you'd run the script in place of Step 5.
But the Windows exe would be updated as well and would work with odex roms.

But for now, if you're able to follow post 2, you can post the 4 smali files and I can do the changes.
The trick with the odex is the BOOTCLASSPATH and copying the signature bits.
Otherwise, I'd be able to do it for you.
 

KaptainRandom

Senior Member
Jul 22, 2011
236
133
63
What does the step 3 terminal entries change? Is that for the rw settings for the srrvices.jar folder?
If so, is it ok to change the rw setting via file manager?

Sent from my EVO using xda app-developers app
 

zeppelinrox

Senior Member
Dec 21, 2010
9,374
21,587
0
IN THE FREAKIN' OP
What does the step 3 terminal entries change? Is that for the rw settings for the srrvices.jar folder?
If so, is it ok to change the rw setting via file manager?

Sent from my EVO using xda app-developers app
Yes that's fine.
You need to do this or else it will "optimize apps" on every boot.
This can works on a stock rom root 4.0 with sense 4.1, in a HTC ONE S? Maybe i try
If it's deodexed (you don't have services.odex) it should work.

Can you post what you have: /system/framework/services.jar and/or odex files?

At the very least I'd like to confirm that the smali files are similar enough.
 
  • Like
Reactions: mrlakadaddy

fr0st420

Senior Member
Apr 9, 2008
1,687
450
83
Kaukauna, WI
Why is this in the original development section? These 2 sections are confusing. Why can't we just have one section?

Back on topic I'm testing on flexes rom and subscribed. ;)

Sent from my EVO
 
Last edited:

arnelolavides

Senior Member
Oct 27, 2010
288
41
0
Jacksonville
Man..I don't know what I'm doing wrong but my phone is stuck on the boot screen..I put it in the framework folder and after that..my phone just turned off and rebooted and stuck on the on bootscreen..running on viperRom deodexed..only way to fix is reflash ROm

Sent from my HTC One XL using Xparent SkyBlue Tapatalk 2
 

bog3nator

Senior Member
Dec 23, 2008
1,806
375
0
37
Lubbock
Man..I don't know what I'm doing wrong but my phone is stuck on the boot screen..I put it in the framework folder and after that..my phone just turned off and rebooted and stuck on the on bootscreen..running on viperRom deodexed..only way to fix is reflash ROm

Sent from my HTC One XL using Xparent SkyBlue Tapatalk 2
that happened to me the first time, just wipe your system and re install the rom, you wont loose your data. did you usethe services.jar for sense 4.0...thats what viper has i beleive
 

arnelolavides

Senior Member
Oct 27, 2010
288
41
0
Jacksonville
Viper4G 1.0.0 is based on sense 4.0. The new version will be sense 4.1.

Edit: I just realized you are not on the EVO 4G LTE. I am not sure what version the HOXL has.

Sent from my EVO using Xparent Blue Tapatalk 2
I'm on viper 1.2.0 so it's based on 4.1 and yes I'm on Hoxl..so I guess it's not compatible with ViperRom on Hoxl at the moment..waiting for the update..:)

Sent from my HTC One XL using Xparent SkyBlue Tapatalk 2