yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] pikachu01:
Actually, reading the code I think I've made a huge mistake downlevelling the HOME_APP_ADJ to 3 (In ThunderBolt!) >.<

HOME_APP_ADJ should stay at 6.

if (r.setAdj >= ProcessList.HIDDEN_APP_MIN_ADJ) {
oomAdj = buildOomTag("bak", " ", r.setAdj, ProcessList.HIDDEN_APP_MIN_ADJ);
} else if (r.setAdj >= ProcessList.SERVICE_B_ADJ) {
oomAdj = buildOomTag("svcb ", null, r.setAdj, ProcessList.SERVICE_B_ADJ);
} else if (r.setAdj >= ProcessList.PREVIOUS_APP_ADJ) {
oomAdj = buildOomTag("prev ", null, r.setAdj, ProcessList.PREVIOUS_APP_ADJ);
} else if (r.setAdj >= ProcessList.HOME_APP_ADJ) {
oomAdj = buildOomTag("home ", null, r.setAdj, ProcessList.HOME_APP_ADJ);
} else if (r.setAdj >= ProcessList.SERVICE_ADJ) {
oomAdj = buildOomTag("svc ", null, r.setAdj, ProcessList.SERVICE_ADJ);
} else if (r.setAdj >= ProcessList.BACKUP_APP_ADJ) {
oomAdj = buildOomTag("bkup ", null, r.setAdj, ProcessList.BACKUP_APP_ADJ);
} else if (r.setAdj >= ProcessList.HEAVY_WEIGHT_APP_ADJ) {
oomAdj = buildOomTag("hvy ", null, r.setAdj, ProcessList.HEAVY_WEIGHT_APP_ADJ);
} else if (r.setAdj >= ProcessList.PERCEPTIBLE_APP_ADJ) {
oomAdj = buildOomTag("prcp ", null, r.setAdj, ProcessList.PERCEPTIBLE_APP_ADJ);
} else if (r.setAdj >= ProcessList.VISIBLE_APP_ADJ) {
oomAdj = buildOomTag("vis ", null, r.setAdj, ProcessList.VISIBLE_APP_ADJ);
} else if (r.setAdj >= ProcessList.FOREGROUND_APP_ADJ) {
oomAdj = buildOomTag("fore ", null, r.setAdj, ProcessList.FOREGROUND_APP_ADJ);
} else if (r.setAdj >= ProcessList.PERSISTENT_PROC_ADJ) {
oomAdj = buildOomTag("pers ", null, r.setAdj, ProcessList.PERSISTENT_PROC_ADJ);
} else if (r.setAdj >= ProcessList.SYSTEM_ADJ) {
oomAdj = buildOomTag("sys ", null, r.setAdj, ProcessList.SYSTEM_ADJ);
} else {
oomAdj = Integer.toString(r.setAdj);
}

See this code. A nested else/if. If HOME_APP_ADJ is 3, a nested else/if will make sure that all visible/perceptible/foreground processes to be earmarked as a Home App.

Having a HOME_APP_ADJ of 1 is even worse. All apps including Foreground/Visible/Perceptible/Heavy_weight/Backup/System etc apps will be earmarked as HOME_APP OOM!!

I'll make this change back to 6 ASAP. Expect to see it by tonight (I think).

Oh and Zep, changing HOME_APP_ADJ to 6 even with the "skip-edit" is tantamount to breaking Android's LMK as well.
[Android Software/Hacking General [Developers Only]] zeppelinrox:
Depends on what that does. It's in "private static final boolean dumpProcessOomList(PrintWriter pw,"

Sounds like it has to do with logging.

And how is leaving the lowMem condition alone still bad?

The internal memory management is now left untouched.

And if SuperCharging the launcher is tantamount to to breaking Android's LMK then that means one thing - some things just need breaking.

But it ain't breaking anything. It just sounded cool :D
[Android Software/Hacking General [Developers Only]] pikachu01:
dumpProcessOomList can be used by some other apps to determine the memory usage of other applications.

Apps might use it (after importing ActivityManagerService) to determine the memory usage of other apps as well as getting the general information of all the ADJ and MEMs of other applications.

The API documentation is here:

http://developer.android.com/reference/android/app/ActivityManager.html

There's also this:

for (i=0; i<N; i++) {
ProcessRecord app = mLruProcesses.get(i);
if (app.nonStoppingAdj >= [B][COLOR="Red"]ProcessList.HOME_APP_ADJ[/COLOR][/B]
&& app.nonStoppingAdj != ProcessList.SERVICE_B_ADJ
&& !app.killedBackground) {
if (app.trimMemoryLevel < curLevel && app.thread != null) {
try {
app.thread.scheduleTrimMemory(curLevel);
} catch (RemoteException e) {
}
if (false) {
// For now we won't do this; our memory trimming seems
// to be good enough at this point that destroying
// activities causes more harm than good.
if (curLevel >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE
&& app != mHomeProcess && app != mPreviousProcess) {
// Need to do this on its own message because the stack may not
// be in a consistent state at this point.
// For these apps we will also finish their activities
// to help them free memory.
mMainStack.scheduleDestroyActivities(app, false, "trim");
}
}
}
app.trimMemoryLevel = curLevel;
step++;
if (step >= factor) {
step = 0;
switch (curLevel) {
case ComponentCallbacks2.TRIM_MEMORY_COMPLETE:
curLevel = ComponentCallbacks2.TRIM_MEMORY_MODERATE;
break;
case ComponentCallbacks2.TRIM_MEMORY_MODERATE:
curLevel = ComponentCallbacks2.TRIM_MEMORY_BACKGROUND;
break;
}
}
} else if (app.nonStoppingAdj == ProcessList.HEAVY_WEIGHT_APP_ADJ) {
if (app.trimMemoryLevel < ComponentCallbacks2.TRIM_MEMORY_BACKGROUND
&& app.thread != null) {
try {
app.thread.scheduleTrimMemory(
ComponentCallbacks2.TRIM_MEMORY_BACKGROUND);
} catch (RemoteException e) {
}
}
app.trimMemoryLevel = ComponentCallbacks2.TRIM_MEMORY_BACKGROUND;
} else {
if ((app.nonStoppingAdj > ProcessList.VISIBLE_APP_ADJ || app.systemNoUi)
&& app.pendingUiClean) {
// If this application is now in the background and it
// had done UI, then give it the special trim level to
// have it free UI resources.
final int level = ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN;
if (app.trimMemoryLevel < level && app.thread != null) {
try {
app.thread.scheduleTrimMemory(level);
} catch (RemoteException e) {
}
}
app.pendingUiClean = false;
}
if (app.trimMemoryLevel < fgTrimLevel && app.thread != null) {
try {
app.thread.scheduleTrimMemory(fgTrimLevel);
} catch (RemoteException e) {
}
}
app.trimMemoryLevel = fgTrimLevel;
}
}

It determines the memory trim level of apps that have more OOM_ADJ than HOME_APP_ADJ. Tweaking HOME_APP_ADJ to 1 might make it looser than what's necessary.

How I wish if I could get your past self to question your current self. He might break a few veins should he knew his future self could contradict him to this extent.

Please don't make me spend time to dig up your old posts that claims the fact that Android LMK MUST be tweaked in order for a full LMK fix.
[Android Software/Hacking General [Developers Only]] daniETingles:
It'd be awesome if someone could help me out.

Is there anyway to install a patched service.jar AFTER you've supercharged already for the first time or do I have to unsupercharge and resupercharge?

Sent from my Paranoid V1.5A Android using the XDA App.
[Android Software/Hacking General [Developers Only]] bbrad:
Just run the windows patcher. No need too unsupercharge
[Android Software/Hacking General [Developers Only]] Topogigi:
Hi Zep,

I'm running V6 on my Galaxy note and I fall into the 75% supercharged trap due to the new oom_score_adj sysfs interface not being recognized from the script (It states that OOM values are not set even if they are correctly set in the new oom_score_adj format).

You can find the relevant changes to lowmemorykiller here:

https://android.googlesource.com/kernel/exynos/+/77a6bf41d0d230ce0b2bfca58ddbea6e954fe950^!/

Can you please provide a solution to this?
[Android Software/Hacking General [Developers Only]] zeppelinrox:
ah... are you running the latest SuperCharger - RC11 test 9?

If you are, post any errors that there may be when running it.
[Android Software/Hacking General [Developers Only]] mixednuts:
Interesting... my tabs for Chrome save when going back to it from another app. If it's been a while and / or Chrome is way in the background, and i go back to it, it'll just reload all the tabs as I left it. ?? :confused:
[Android Software/Hacking General [Developers Only]] zeppelinrox:
Well pikachu makes some valid points which, when addressed, can only make it better... wait for the next post :)
[Android Software/Hacking General [Developers Only]] deejaylobo:
Lol, so I guess MegaRAM 2 + Nulled NOS is not so good for multi tasking. I was on XDA and tried to Swipepad to Whatsapp. Twice I just got booted out of Whatsapp. Never seen that behavior before. NN + Multitasking minfrees is much better.
[Android Software/Hacking General [Developers Only]] hazard209:
The following lines are added to the end of build.prop:

ro.ENFORCE_PROCESS_LIMIT=false

ro.MAX_SERVICE_INACTIVITY=

ro.MIN_HIDDEN_APPS=

ro.MAX_HIDDEN_APPS=

ro.CONTENT_APP_IDLE_OFFSET=

ro.EMPTY_APP_IDLE_OFFSET=

ro.MAX_ACTIVITIES=

As for if this is safe for all devices, there's no way to know unless it gets tested on all devices. It works on mine, but this has been a new discovery for this thread in just the past few days so if you don't feel comfortable trying it, then don't.
[Android Software/Hacking General [Developers Only]] karri0n:
Will the tweaks in Kickass Kernel tweaks interfere with the tweaks in Prime's Deprimed kernel?
[Android Software/Hacking General [Developers Only]] mcord11758:
thank you, will report on if it flies or not
[Android Software/Hacking General [Developers Only]] deejaylobo:
Put these values in your /system/build.prop

Don't know about safety but, you should copy the original build.prop to your SD card before you change/replace it.
[Android Software/Hacking General [Developers Only]] hazard209:
I noticed that it was pulling more ram after adding Nulled NOS (Is that the name it's getting? I just used that as a suggestion.) but maybe MegaRAM 1 will work better with it since it's a little less demanding.
[Android Software/Hacking General [Developers Only]] Mattymat:
Hey JCC,

What supercharger settings are you using on your phone? I'm curious what a fellow vibrant owner uses and has the best results with. Right now, I'm using 4 (Balanced 1) as my choice. I haven't really tried all of them other than 2,3 and 4.

Let me know your thoughts.

- Mat
[Android Software/Hacking General [Developers Only]] tikimcfee:
3G Supercharger Question

Hello folks,

Sorry if this has been addressed somewhere else in this thread, but my searching around hasn't really found any results, so any help or advice would be fantastic!

I've been messing around the 3G supercharger, and it seems to have made my connection a little worse rather than better, which if I am to understand is normal depending on phone models (I've got a Droid x2). I'm trying to find a way to reverse or return the settings to normal, but I can't find an option in the script itself, in the v6 script, or anywhere else for that matter!

So, that being said, might someone know how to remove the 3G supercharging?
[Android Software/Hacking General [Developers Only]] xxxicu812:
sorry for the noob!

how do i run the un3g backup??
[Android Software/Hacking General [Developers Only]] kirkcody:
What would be the best setting for a Mytouch 4g ?, i think we have 768mb of memory...im currently trying setting 3
[Android Software/Hacking General [Developers Only]] sag7392:
Hey has anyone tried this yet? I just may give it a try for the hell of it. As far as the null values...my benchmark scores are lower, but I swear things really do open faster and smoother...I don't quite understand why. I ran it all day and didn't see any adverse affects...no FC's, no random reboots, no battery drain, and my RAM stayed above 100mb's even when opening several apps. Man if we can nail down the timer issue...these scripts could possibly change the game in the world of Android!

So with that...I'm going to give those values a run and see what happens. I have some errands to run and a workout session, so I'll report back later.
[Android Software/Hacking General [Developers Only]] sag7392:
option 8 for starters
[Android Software/Hacking General [Developers Only]] nolandrew:
Just delete the new build.prop and rename build.prop.un3g to build.prop in /system

Sent via evo
[Android Software/Hacking General [Developers Only]] tikimcfee:
Thanks much my friend - all taken care of. =)
[Android Software/Hacking General [Developers Only]] netson99:
from the ActivityManagerService.java, here is the value that will be read from .prop files :

so this values can only be edited in the source :

Before my sleep time :) my HD2 run about 60 process and in the morning, there is no apps get killed !!!

and about adj parameters, I use Dorimanx's parameters ( I run Dorimanx v. 2.7.0 HE ROM)

and here is the default value on AcivityManagerService.java - paste to pastebin

and here is pastebin of my top command : top - command on my HD2

---!!---
[Android Software/Hacking General [Developers Only]] dorimanx:
hey dudes, I am sad about the task killer, that we worked so hard to fix...

I have set in source all that zepp proposed, compiled back, and zipped to services.jar

put it back to framework,

changed perms and owner, all fix.

rebooted, and was so exited! but when I look at services I see 38 and no more, and still logs in logcat about app#16 no longer want.

to make it boot, I had to update the smile compiler /decopiler from 1.1 to 1.2.6

only then rom booted ok.

I think that there is more places to set, there are many files for servicemanager in source folder.

so for now back to hidden min 25, no other way.

at least people like the idea of none of apps get killed by auto,.

nice to see you here netson99 :D

and wow you run 78 services... i have top 42, :D

creator is always without boots ,haha.

if i will make task manager to work i will sound the alarm ;-)

Sent from my Dorimanx Rom on HTC HD2
[Android Software/Hacking General [Developers Only]] sag7392:
Hey Dori, can you give me the lines to add the values you mentioned?

Zep, the lines you suggested don't work. It was killing apps all over the place...one in particular was my widget locker app...which never gets killed. So those lines are no go with values of 5.
[Android Software/Hacking General [Developers Only]] zeppelinrox:
What's NOS stand for? lol

You can delete /system/build.prop then rename the un3g (the original) to build.prop

Maybe I should update the script with uninstall :p
[Android Software/Hacking General [Developers Only]] zeppelinrox:
That's actually good news... that means that ro.HIDDEN_APP_MAX_ADJ=5 has an effect.

Seems that ro.HIDDEN_APP_MAX_ADJ would by default get assigned the same adj value as empty app...

Willing to try another?

ro.HIDDEN_APP_MIN_ADJ=5

ro.HIDDEN_APP_MAX_ADJ=20

(use dori's idea of confusing oom killer... but with the hidden app max instead of hidden app min lol)
[Android Software/Hacking General [Developers Only]] hazard209:
Nitrous Oxide Systems and generally it's a slang racing term for NO2.
[Android Software/Hacking General [Developers Only]] pikachu01:
Chrome might have a on-suspend action to save tabs into memory. It's very much app dependent.
[Android Software/Hacking General [Developers Only]] jgcaap:
Just wanna see the next update wich both of you will make. I am sure it'll be something amazing. :)
[Android Software/Hacking General [Developers Only]] Topogigi:
Yes, I'm running the latest and greatest. And no, no error messages are thrown out because the new lowmemorykiller interface automagically translates the old and deprecated oom_adj values to the new oom_score_adj values. When you run the v6 supercharger script, though, you always reach only 75% because the old adj values are compared with the new oom_score_adj values and they do not match. So, to the average joe, your script seems to be broken somewhere or it just seems to be not fully functional while it does fully work under the hood...
[Android Software/Hacking General [Developers Only]] mixednuts:
Hmmm... so that sparks another question that came to mind while reading some previous posts - should we rely on the developer's ability, who developed the specific app in question, to manage the memory (that the app may or may not need) properly?

My apologies if the question / comment makes no sense... I'm not gonna pretend I understand even a 1/4 of what you and zep are posting about.
[Android Software/Hacking General [Developers Only]] pikachu01:
There is a whole debug tool and environment for implementing memory checks. Even in windows, and if your program consumes a whole lot of memory, not having a way to know and control it will spell disaster. You can ask any Android app developer about it. The APIs are there for reference.
[Android Software/Hacking General [Developers Only]] zeppelinrox:
OK so about that one.

I did change that part but I can refine it by changing the appropriate if conditions in AMS smali - by making it true only if the values are equal.

I've been going over the code again and there is another similar routine which is probably more important than that one

static int oomAdjToImportance(int adj, ActivityManager.RunningAppProcessInfo currApp) {
if (adj >= ProcessList.HIDDEN_APP_MIN_ADJ) {
if (currApp != null) {
currApp.lru = adj - ProcessList.HIDDEN_APP_MIN_ADJ + 1;
}
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND;
} else if (adj >= ProcessList.SERVICE_B_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE;
} else if (adj >= ProcessList.HOME_APP_ADJ) {
if (currApp != null) {
currApp.lru = 0;
}
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND;
} else if (adj >= ProcessList.SERVICE_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE;
} else if (adj >= ProcessList.HEAVY_WEIGHT_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_CANT_SAVE_STATE;
} else if (adj >= ProcessList.PERCEPTIBLE_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_PERCEPTIBLE;
} else if (adj >= ProcessList.VISIBLE_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE;
} else {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
}
}

The good news about that code is that it is not applicable to pre-ICS.

I changed this as well so will fix that one up too.

There's another similar routine with those "IMPORTANCE_*" values but that one wasn't modified.

Actually, that trimming routine wasn't changed.

As previously noted, the AMS smali edits require the changing of the applicable 0x6 for home to 0x1 (for die-hard launcher) in many places.

Same goes for editing the other ADJs.

So to properly change the ADJ for Previous Apps requires many changes as well... and same goes for Visible Apps, etc...

Anyway, when it came to editing that part - I got the bootloops so left it out - I guess Android is smart enough to tell me when I've gone too far :p

So why was I not satisfied with the initial few edits that are in Post 2 and why is the web app no longer good enough?

Precisely because

I'm still my old self

- I want the mod to be as complete as possible so that discrepancies/inconsistencies would be minimized.

However, you helped me see that, in a few instances, I actually went too far in my attempt to be as complete as possible.

Yes, that's what you would call irony lol

So the goal is to keep SuperCharging the launcher while minimizing the impact on the bigger picture.

As for the minfree tweaking, I was thinking that if I can figure out how that array works exactly, I can burn the minfrees right in there with the Ulitmatic Mod ;)
[Android Software/Hacking General [Developers Only]] zeppelinrox:
hmm... ok... show me the output of the boom stick since that relies on the oom_adj file to figure out the groupings.

Mabe you can also tell me what is in the corresponding oom_score_ad file for a few of those apps.
[Android Software/Hacking General [Developers Only]] mixednuts:
Just figured I'd share and add to the subject... same behaviour with stock browser - tabs are saved even after LMK / time kills it.
[Android Software/Hacking General [Developers Only]] ShoeVan:
Has anyone tried this on JB HTC one X? On the JB update HTC removed the charge only feature and now only MTP can be used, so I'm not so sure if that will affect anything. I get to the point where I have to type "sh /storage/sdcard0/ALL*" on my computer. At that point the script starts to run and it does its intro and stuff, but it gets stuck at "All ICS have.." and doesnt go any further.
[Android Software/Hacking General [Developers Only]] gokart2:
Found the binary install issue was do to the binaries wraith provided are for Superuser, not SuperSU. Tried changing SU's the flashable way, but can't get root priviledges with the latest Superuser. Going to build it into my current rom when I get around a PC with 7zip, and see if that works. Although, I have seen the supercharger used/working with SuperSU....? Busy box version is in fact wraith's 1.19.4.
[Android Software/Hacking General [Developers Only]] mixednuts:
Just my feedback - haven't had much luck with the 3.2 Superuser flashable zip... had to use the 3.1.1 version. Afterwards, you may also want to think about installing the Superuser Update Fixer from the Play Store as well.
[Android Software/Hacking General [Developers Only]] gokart2:
Thanks. I tried v3.1.3. Guess I'll try v3.1.1 and see.

Edit: Same issue. Can't get root priviledges after flashing any Superuser zip. Gonna have to wait and try building it into the rom. Or try to port wraiths binary to work with SuperSU.
[Android Software/Hacking General [Developers Only]] ostar2:
Where do I download version 10?
[Android Software/Hacking General [Developers Only]] UpInTheAir:
Wait for it to be released.......
[Android Software/Hacking General [Developers Only]] pikachu01:
Yeah, that's the code I intended to paste (much more important than the Dump function. I saw it then when I came back from lunch, quickly copy pasted the lesser important code than this one).

static int oomAdjToImportance(int adj, ActivityManager.RunningAppProcessInfo currApp) {
if (adj >= ProcessList.HIDDEN_APP_MIN_ADJ) {
if (currApp != null) {
currApp.lru = adj - ProcessList.HIDDEN_APP_MIN_ADJ + 1;
}
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND;
} else if (adj >= ProcessList.SERVICE_B_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE;
} else if (adj >= ProcessList.HOME_APP_ADJ) {
if (currApp != null) {
currApp.lru = 0;
}
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND;
} else if (adj >= ProcessList.SERVICE_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE;
} else if (adj >= ProcessList.HEAVY_WEIGHT_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_CANT_SAVE_STATE;
} else if (adj >= ProcessList.PERCEPTIBLE_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_PERCEPTIBLE;
} else if (adj >= ProcessList.VISIBLE_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE;
} else {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
}
}

You need to know however that only changing one part of the code and not the other parts (which you incidentally get boot loops out of) will also result in the mismatch in the OOM_ADJ as well as how Android handles some out of memory situations.

If you're still the old you, you wouldn't just junk "Tweak Android LMK + Linux LMK in sync or bust" manifesto that you had like an old shoe :/

As I've mentioned before. How the app handles the out of memory situation depends on how it was programmed in the first place. An app can release memory/save state/ make itself harder to kill/ make itself easier to kill when in background etc. It all depends on what the programmer does with the API.

The same thing can be said about Battery APIs. Not all the apps will complain about not starting itself when the battery is lower than 20%. Only certain apps do. Other apps might print out a warning if battery gets lower than a threshold. Other apps might disable some features. Well you should get the gist of it by now right?
[Android Software/Hacking General [Developers Only]] Lt.Win:
@Zeppelinrox - You should really submit your Recognized Developer app in 2013. Senior Member doesn't suit you. :p
[Android Software/Hacking General [Developers Only]] jova33:
Wow... smart people collaborating.... wish I could contribute more than a f--k yeah... 'Merica

But keep up the smart people stuff, and good jobs.

Sent from my wireless telephonic device.