[Android Software/Hacking General [Developers Only]] pikachu01:
Leaving it as is (like the memoryTrimming function) is the one that will make the Launcher not Supercharged. You do realize that the ADJ values are not passed to the app, but rather the lowMemory, threshold and a few other thresholds (hiddenApp, secondaryServer, visibleApp, foregroundApp).

Here's how the code works:

- ADJs are set in ProcessList

- ADJs are passed to ActivityManagerService and how killable/unkillable an app is, is determined in the memoryTrimmings and LRU calculations. The function oomAdjToImportance basically calculates the importance of an app (to determine whether it should be less killable or not. Leaving that function as is will basically make your launcher unsupercharged.

Do you even know what constructors are or not =_=.

Constructors are routines that are executed when the class is instantiated. The correct definition is "Class Definition" where each variable/method is defined.

And you're wrong in it being static. All other variables for other ADJs are also static. It's the "final" keyword that is absent from HIDDEN_APP_MIN_ADJ (final keyword denoting that the value is not able to be changed after the class is instantiated).

Here's a programming 101 for you:

- static means after the class is instantiated, any changes to static value will change all values of the same name for all classes. E.g.

class B {
static int a = 1;
}

If I instantiated two new classes of B called B1 and B2, changing the a variable of B1 will change it in B2.

- final means that once the class is instantiated, the value of the variable cannot be changed. If the variable is a pointer, the pointer cannot be changed. It's basically a constant. Hence what I mean by "maybe" the value can be changed later (I don't see it being changed, but an App can import ProcessList, instantiate a class out of it and change the value later. Who knows.

The smali edits are localized. That means, if variable has a "final" keyword, all the values that are used are stored as constants (something you've said as true in a few posts earlier). This means that changing only ProcessList will not yield any difference (for all ADJs except HIDDEN_APP_MIN_ADJ).

The definition of Supercharged is that HOME_APP_ADJ is 1 right? HOME_APP_ADJ is a constant and will be instantiated as its own constant in the smalis. It is not referenced like HIDDEN_APP_MIN_ADJ. I didn't read your long winded scripts, but if you've only changed the ProcessList before our discussion, that means your services.jar is basically unchanged (except for HIDDEN_APP_MIN_ADJ if you've changed it).

I've never mentioned that "Hard-to-Kill" meant having an OOM_ADJ of 1. Having a 2 or 3 is fine too. The crux of this is that if you enable Supercharger (and you change how LRU and/or mem trimmings work, even if you have "Keep Home in Memory", the Android OOM goodness wouldn't be applied to it (only the Linux LMK which is a hard-ruled process killer without regards of what app it is). That would mean it is half-baked.

Umm, try this. After you've Supercharged i.e. HOME_APP_ADJ to 1, check all the apps OOM_ADJ. Do you see something wrong there?

Au contraire, you're the one that is spreading misinformation. Had I not told you about Supercharger being half-baked, would you even realize that you're breaking your own principle of not offering half-baked LMK/OOM fixes?

Yes. That would work too actually.

I see you've provided a source code on your later replies. I'll reply there and see if you can learn something from it ;)

How have you proven it? Until now the discussion was me pointing out your mistakes and you saying that you can fix it.

I don't have the time to look at it. Please paste the code into your post so that I can see it.

I am yet to see the other post. If you've successfully did it, I'll do a slow clap in the end. I'm not a person who never admits his/her own mistakes.

And no, I don't think I will be patching services.jar. My view is that apps should be the one that handles the OOM priorities.

I've provided the source code for everything I've talked about so far. I have yet to see the source code for your 2nd post. Let's see what you've done so far before I comment on it.