yashsingh1/xdaforums huggingface dataset:
[Galaxy Note II Android Development] Gnarfsan:
Damn :(

Maybe OP could have a look at your KeyguardViewMediator.smali because it was different from mine. Maybe the fix has to be modified for your version or maybe I am doing it wrong somehow, but I was pretty careful when I edited the file. It did work for me, however my file looked exactly like OP's file. Yours had minor differences.

Come to think about it, nintendolinkys file had the same differences as yours.
[Galaxy Note II Android Development] Linuxx84:
This mod may increase battery consumption?
[Galaxy Note II Android Development] Simone:
Part of the OP

Long story short, many people get better battery life by preventing deep sleep because the phone isn't constantly powering up different parts of the circuitry all the time. And from what I found, your phone is forced to wake out of deep sleep a lot, potentially hundreds of times an hour, to perform regular operations.
[Galaxy Note II Android Development] mikeyxda:
I looked and you modded the file correctly. Pepe... I think it is working but you are not looking in the right place in Better Battery Stats: you have to look in "Partial wake locks" to find it. Also, you didn't say if you have any lag or not: just that you couldn't find the wakelock in BBS. Do you still have wake lag? If so, there are only three possibilities: (1) the file Gnarfsan gave you didn't flash properly, (2) the lag is coming from something other than the deep sleep lag, or (3) you have some sort of utility/app that is force-releasing all wakelocks when the screen is off, thereby nullifying this mod. I'm not aware of anything that does that (kills all wake locks) but you never know.

Mike
[Galaxy Note II Android Development] pepe2909:
you're right process is in "Partial wake locks"

lag is gone, but after flash phone not go into deep sleep.
[Galaxy Note II Android Development] jvillatoro:
So far which Roms have already been patched?

I made one for Omega V15 (I am using simplistic 3.5.1 as well)

I think someone made one for ARHD V14

And for DualNote Rom

Can someone make a quick list, I would do it but I am not at my computer right now.

Thanks.

Edit: now we should discuss which cpu profile suits best when the screen is off using this Mod. I saw someone suggested to set Max CPU to 600 and Min to 200 Mhz
[Galaxy Note II Android Development] Gnarfsan:
That is intended. The first post describes this consequence.
[Galaxy Note II Android Development] pepe2909:
I read, so if do not go into deep sleep will consume more battery ?
[Galaxy Note II Android Development] Gnarfsan:
It should consume less battery because the phone doesn't have to go in and out of deep skeep all the time and that is apparently a power consuming process.
[Galaxy Note II Android Development] mikeyxda:
I did a lot of research on that and it's not so easy to answer. Generally, I believe battery will be no worse and possibly better. Google location services, alarms, widgets, push mail, and many other processes end up waking up 99% of phones at least once every 3 minutes anyway and the deep-sleep-->awake-->deep sleep cycles actually consume more power than letting the processor(s) stay awake. On my phone for example, Google location services alone woke the phone 20 times/hr (every 3 minutes) and that's with GPS turned off and no navigation or map activities running! Add a weather widget here, a push mail app there, and I found that my phone was bouncing in and out of deep sleep more than a hundred times an hour! Better (on both battery and circuitry) to just idle at that point. With only one CPU awake with screen off, the radio will draw more power than the CPU idling. Most people don't realize that the screen and radio eat orders of magnitude more power than (especially an idling) CPU, so idling one CPU will have little effect on battery. That said, I suppose if you put your phone in airplane mode and maybe froze a bunch of other apps that wake the phone, maybe battery would be worse with the ZeroWakeLag wakelock and the phone would do better in deep sleep. Reality is: we don't use our phones that way.

From my testing, the Note 2 already appears to limit processing to a single CPU when the screen is off. For extra battery savings, you can set up a screen-off max frequency limit of say 800Mhz to 1.0Ghz. I personally use 1.0Ghz because you only have one processor running and it won't ramp up unless it's needed anyway. Going below about 800Mhz can cause issues like bluetooth music skipping, media share server stuttering, etc. I definitely would not recommend setting the max to 200Mhz with the screen off. But hey, this is Android... never hurts to try. :)

Mike
[Galaxy Note II Android Development] shatroghistro:
Works for me. Thanks ;)

Actually it doesn't :/
[Galaxy Note II Android Development] bizum1:
works for my OMEGA ROM :)
[Galaxy Note II Android Development] pepe2909:
I'll do more tests with and without deep sleep.

Thank you very much for the explanations Mike.
[Galaxy Note II Android Development] sifat004:
bricked :(

Why it doesn't work for my phone and i bricked my phone. After that i flashed "Go Back pls.zip" and the rom starts.

I am on Omega v15 and i am not using simplistic framework and on stock kernel. Please someone make one for me as I am dying to use it :(

I have attached my original "android policy.jar"

Thanks in advance.
[Galaxy Note II Android Development] Gnarfsan:
That is because I made it specifically for pepe. The go back script restored his policy file.
[Galaxy Note II Android Development] sifat004:
bro i guess you misunderstood. Your "Go back pls.zip" helped me to restore my android policy.jar and i have started my rom.

actually i used the "android policy.jar" of "jvillatoro" as he is using omega v15. But i dont know why it didnt work for me and my rom was not starting.

So i request you to compile my android.policy.jar so that i can use "no lag wake" in my phone :)
[Galaxy Note II Android Development] Simone:
Hi,

Sorry for being a douche but can anyone implement it to mine?
[Galaxy Note II Android Development] Chrissssssss:
When you're trying to get this working don't rename the android.policy.jar file to something else to back it up before trying to put the new one on.

I tried it and straight away the phone rebooted and wouldn't boot past the boot logo. Oops.
[Galaxy Note II Android Development] MikeyLee:
How can we see what is waking the phone and how often?
[Galaxy Note II Android Development] mikeyxda:
You have to do a logcat and examine that. It can be a bit tedious. I suppose if you look through all the partial wakelocks and kernel wakelocks in Better Battery Stats and look at the count, that'd give you some idea without knowing how to sift through logcats though.

Mike
[Galaxy Note II Android Development] zephyrus17:
I have tried this and it is working as expected however i lost the ink effect mod in 3.5.1 (without using spen).

edit: i restored 3.5.1 and edited it by myself. it is now perfectly working. thanks
[Galaxy Note II Android Development] Gnarfsan:
Ah, ok. But by the time you wrote that post I went away to the country. I wont be seeing a PC until tuesday :(
[Galaxy Note II Android Development] ffolkes:
How does this differ from the wake-lock generating apps in the Play Store?
[Galaxy Note II Android Development] mikeyxda:
I don't know how the apps do the job but I wouldn't want to have an app just to inject a wakelock on screen off. IMO that should be done in the framework in code that is already there for the screen on/off event.

Mike
[Galaxy Note II Android Development] pnxsinned:
I am using omega v14. Will the file which is made for v15 work on mine?
[Galaxy Note II Android Development] t4d73:
Well ok. After about 45 min of installing and uninstalling about 40 different apps, this one finally works. Auto Screen On in play store. So happy I found it because I almost gave up and it does what it says.
[Galaxy Note II Android Development] cmo220:
Could somebody that knows how please mod this for me? Thanks!
[Galaxy Note II Android Development] fryingpan0613:
I can't wait to try this!

check out our rom website, http://updater.team-nocturnal.com/labrats/
[Galaxy Note II Android Development] rcklss1:
could someone please modify mine?

Im on cleanrom ACE 4.6.1

View attachment 1839215

thanks in advance!
[Galaxy Note II Android Development] DocRambone:
A version for Wanam 3.3 (attached)
[Galaxy Note II Android Development] PoD_Hazard:
Mod this for me

Can someone mod this for me Im on MacksRom 3.2
[Galaxy Note II Android Development] sms2000:
I added the feature of passive Partial WakeLock when screen is off into my CPUTableau application.

If you want to use it just install ans specify options:

Enable Overlay [ON]

Permanent PWL [ON]

leave the rest as is.

When enabled the Overlay shows the CPU temperature, current clock and cores enabled/disabled.

Move the little window where you like to have it, double click opens the configuration activity.

ROOT required (only during the first run) for fully functional tableau.

The source code available at https://github.com/sms2000/CPUTableau

From my subjective observation the idea of PWL is OK. The battery drain more or less the same as with Deep Sleep. No screen on lag at all.
[Galaxy Note II Android Development] The_Steph:
Tested for 24 hours now, I do not see any changes in my battery consumption but I do not screen wake up lag at all. Definitely a keeper!!!!!

Thanks mickeyxda!
[Galaxy Note II Android Development] adytum:
This looks very promising indeed.

I don't doubt you, mikey, and you have lots more knowledge than me, but what is puzzling me is: How could the engineers who made the chip behave like this in deep sleep, accept the wake up lag if it truly doesn't conserve battery?
[Galaxy Note II Android Development] The_Steph:
adytum,

I think that what mickeyxda explained is that basically the chip conserves battery but what's eating it is what the OS and application do with it.
[Galaxy Note II Android Development] Gnarfsan:
I agree. Battery life is still good, and no more annoying wake lag. This is awesome!
[Galaxy Note II Android Development] bharathgdk:
:crying: after i tried this phone entered boot loop! :(... lucky for i had a backup .. so just restored the phone!.

Trying to edit the android.policy.jar file...

#ARHD v14.
[Galaxy Note II Android Development] dianlb50:
Phoenix Rom

Can someone please mod this for phoenix rom user's? thx
[Galaxy Note II Android Development] Matthenson20:
http://db.tt/Fz3wmARd

Here's mine for Beans12....thanks a ton

Sent from my Big Ass Beans running Perseus infused Note2
[Galaxy Note II Android Development] ozaghloul:
Can you please modify the first thread with the specific files for each rom, it's getting very messy in the thread.
[Galaxy Note II Android Development] vtec303:
That is a wonderful app it has actually totally eliminated the wake up lag on my phone, thank you very much, Regards. :)
[Galaxy Note II Android Development] Lesi:
Thanks for this :) i think it works, at least, i dont have wake lag, but i have one problem, in setting -> battery, i've got only one thing, its Android OS and it says 100%. and when i click on it, then it says "CPU total ... 247d 22h 23m 12s" it would be nice if its real, u know 247 days with no charging :) but i just wanted to check drain and see only that one thing. Anybody knows how could that happen? :)

Thanks
[Galaxy Note II Android Development] mikeyxda:
All manufacturers push these devices out the door with some glitches that need fixing. In discussing it with other software engineer friends of mine, we've come to the conclusion that the attrition rate of these devices coupled with the short development-to-release times just means that these things are pushed out too quickly to be 100%. I'm sure "start deep sleep as soon as you turn the screen off" sounded good to some committee at a design table somewhere but I truly believe these things are just pushed to market too quickly for people to actually test them fully. What made sense on paper doesn't work so well in real life when you consider all the apps that could (and mostly do) wake the phone often.

So when we devs get these things out on the street and open them up, we find (and often correct) some things that were not anticipated in the design phase. That's pretty typical for a waterfall approach where there is little testing and feedback along the way. It's not a bad thing really, just means we get the product sooner and we open source devs get to pick the poo out of everything and fix a few things along the way, even discovering a bad idea or two along the way. I honestly think this "race to deep sleep" idea was just ill conceived. The wake lag is so bad on these devices that it's almost a deal breaker for me. I'm just glad it's fixable. In the short week or so that I had the device, I missed a couple candid shots solely due to screen wake lag. Try to explain to a baby who is only going to smile for a few seconds... "Wait, hold that smile... I've got wake lag". :D

Mike
[Galaxy Note II Android Development] :
can someone help me with this cyanogemod nightly android.policy.jar? its from the latest one (wednesday 3-28-13) :)
[Galaxy Note II Android Development] adytum:
Thanks for the nice post, mikey, you make a lot of sense :)
[Galaxy Note II Android Development] ffolkes:
Can anyone help me with this error:

W/dalvikvm( 3624): VFY: invalid field access (field Lcom/android/internal/policy/impl/keyguard/KeyguardViewMediator;.mScreenOn, through Landroid/os/PowerManager$WakeLock; ref)

I'm trying to get this on RootBox, but it isn't working well, just get boot loops. I had to add an additional /keyguard/ in there to match the rest of the syntax of the file. Idk what I'm doing though.
[Galaxy Note II Android Development] PoD_Hazard:
For some reason I can't recompile my classout file, Idk what I'm doing wrong
[Galaxy Note II Android Development] jimzmaycry:
amazing guide.. i've tried it on my OMEGA ROM 15 with SF 3.5.1 and it works like a charm..now i have no more screen-wake-lag.. !! :good::good:

i will test the battery efect later, but as long as my phone is "very fast" i dont care about the battery.. :p

i've attached my android.policy.jar , feel free to use it..
[Galaxy Note II Android Development] :
Sorry to ask but how does this app work?

Will it work without modified android.policy.jar as mentioned in first post, or it works with it modified?

Thanks a zillion!
[Galaxy Note II Android Development] sms2000:
The app works without any .jar mods. If you modify your .jar the app will do nothing good or bad.

Just provide another WakeLock above the one from .jar.

If you want to drop back to DeepSleep you have to restore .jar and remove the option "Permanent PWL" in the application.

Actually this app is intended to provide CPU characteristics in the real time regardless what is shown on the screen (home, game, internet, lock, phone etc.). I simply added another option...
[Galaxy Note II Android Development] vtec303:
Thank you again I did not do any modifications to policy.jar and using this app on pacman rom and it has eliminated the wake-up lag completely..... awesome, plus I can also see info about cpu cores n temperature, nice job mate, keep it up, Regards.
[Galaxy Note II Android Development] PoD_Hazard:
Sorry about all the questions earlier in this post but I got my Android.policy.jar file modified and ill upload my file later. Big thanks goes out to mikeyxda for bringing this to my attention, and my file is from MacksRom 3.2, big thanks to Mack for his awesome from, from what I noticed with the battery life it did seem slightly better and the wake up speed is definitely noticeable.... for the better here is a screen shot of the Zero Wake Lag running and ill upload the file a little later
[Galaxy Note II Android Development] jpkbeddu:
How can I get the app..? I see only source in the link above.. Can anyone share please.

Sent from my GT-N7100
[Galaxy Note II Android Development] PoD_Hazard:
Page 8 post #76
[Galaxy Note II Android Development] t4d73:
Works good. Thanks.

---------- Post added at 04:52 PM ---------- Previous post was at 04:47 PM ----------

You know it's very difficult to find an app like this in the play store that actually works and does what it's supposed to. You should think about publishing. Many people would probably pay for it. I would.
[Galaxy Note II Android Development] lucalaco:
But there is an APP to set this or not ?
[Galaxy Note II Android Development] t4d73:
Lol read the post directly above mine.
[Galaxy Note II Android Development] ffolkes:
Thanks, but I'm running Rootbox (4.2.2) 0323 nightly, and this never gives me a PWL. Yes, I have it enabled in the settings popup, but it doesn't work...
[Galaxy Note II Android Development] sms2000:
Actually I never tested the application above 4.1.2. What 4.2.2 ROM makes problems ?

Also the PWL is enabled only when screen is off. No reason to keep it when screen on.
[Galaxy Note II Android Development] btbamzao:
I installed on PAC rom and never was asked for su permissions. It never caused pwl.
[Galaxy Note II Android Development] zephyrus17:
Can you make a transparent overlay for it?
[Galaxy Note II Android Development] sms2000:
You mean making the fully transparent window?

Possible but inefficient. You will not able to read data on a checkered screen.

Regarding the updated JB version (4.2.2 and CM10.1) I cannot verify myself for now (I'm locked with 4.1.2 with all my devices), but I found a possible bug.

If you still have problems with acquiring PWL, please collect and send me the log:

adb logcat *:S CPUTableauService:V > log.txt

The important parts are 'screen off' and 'screen on' processing when 'Permanent PWL' enabled in options. A matter of few seconds only.

Thanks.

Updated:
[Galaxy Note II Android Development] sms2000:
CPU Tableau only asks for SU when some CPU related files are not read-accessible. Like those CPU core enable/disable or CPU temperature.

The affected files are marked as read-accessible and here I need SU. Nothing more as everyone may check for himself in sources.

Regarding PWL there is a possible time race inside Android. The latest fix should take care of it but I need someone with 4.2.2 (CM10.1) to test.
[Galaxy Note II Android Development] sms2000:
Installed SlimBean V3 just for debugging.

It works!

I used BetterBatteryStats to check. Still it's only one plain N7100 and not a fully representative testing...
[Galaxy Note II Android Development] btbamzao:
Testing now.
[Galaxy Note II Android Development] ffolkes:
The night before last I charged my phone then unplugged it, and when I got up BBS showed 0.9%/hr drain with normal deep sleep. Last night I repeated this but with a PWL, and I got 0.7%/hr. While that is within a margin of error, it does at least show so far there isn't a downside to idle PWLs.

Thank you mikeyxda for thinking outside the box.
[Galaxy Note II Android Development] ffolkes:
Thanks, it works now, but I noticed the overlay seriously spazzes out when you drag it. It jumps all over. Just letting you know. :)
[Galaxy Note II Android Development] fga:
I'm agree with you but what about cpu life ? Just curious any idea ?

Thanks,

★GT-N7100★
[Galaxy Note II Android Development] zooka:
Works great on PhoeniX ROM v9.0! Thanks.

Sent from my GT-N7100
[Galaxy Note II Android Development] liesenfeld:
CPUTableau installation

Sorry for this noob-question.

How do I "install" the CPUTableau? It is not an apk. Is it a flashable zip?
[Galaxy Note II Android Development] sms2000:
Yeah, I know. To fix those jumps some rework required. I'm not a GUI guy and it may take some time.

---------- Post added at 09:50 AM ---------- Previous post was at 09:48 AM ----------

See #106 post. It's an APK. Download, install, run and select options.
[Galaxy Note II Android Development] liquidguru:
Can someone confirm that this will work on any ROM with Simplistic Framework v.3.5.1 and the attached file?

Thanks
[Galaxy Note II Android Development] dipdap:
android.policy.jar for Android Revolution HD 14.0

Maybe I am overlooking it, but is there a modified android.policy.jar for the Android Revolution HD 14.0 rom?

So far I only see the one for ARHD but with Simplistic Framework v.3.5.1.

the CPUTableau.apk works fine, but I don't want the widget displayed on my screen.

thanks for the help.
[Galaxy Note II Android Development] muasxees:
I'm lost.
[Galaxy Note II Android Development] zooka:
Yes, it does. Download file and replace it. Do make a backup first.
[Galaxy Note II Android Development] estillo:
this would help for non-advanced user :)

[TIPS]Instant Wake Lock Galaxy Note II
[Galaxy Note II Android Development] vtec303:
This app is just awesome, big thanx for sharing mate, Regards.
[Galaxy Note II Android Development] sms2000:
CPUTableau ver. 1.2.61

CPUTableau app improved:

1. Erratic motion fixed more or less, Android limits)

2. Permanent PWL is unrelated to Overlay now. You can enable PWL and disable Overlay if you like.
[Galaxy Note II Android Development] pnxsinned:
Nice app mate, Cheers! Works as intended.

Appreciate it.
[Galaxy Note II Android Development] :
still doesnt seem to work on cm10 nightly
[Galaxy Note II Android Development] sms2000:
I need logcat from CM10.

Worked with SlimBean on my 7100.
[Galaxy Note II Android Development] reinberto:
can you please upload yours?

i need one for phoenix 9.0
[Galaxy Note II Android Development] zooka:
@reinberto: I downloaded file from post #39, made a backup of the original file from Phoenix Rom then replaced it and rebooted the phone. You will instantly see that is working or not. When you press Home or power button, screen almost instantly lights up.
[Galaxy Note II Android Development] jjardinero.01:
will this work CM10.1 Nighlies?
[Galaxy Note II Android Development] speghead:
Thank you for the app. It did eliminate wake lag but for whatever reason I got some pretty bad battery drain with it.. had the two options checked. And in 2.5 hrs of idle it lost over 5%. I'm not sure if this is how it is supposed to work, I was under impression it would not really make a big difference on battery.

And to the OP, thanks a ton for this guide. Have never decompiled anything in my life and with a bit of research I was able to do the mod on the latest CleanROM. Will see how it does on my battery.. :cowboy:
[Galaxy Note II Android Development] Axelman8:
+1 BatteryDrain is quite an issue here .. but must say that it works flawlessly. So hope you can fix the drain. I am not gonna uninstall it.. like too much. Thnx
[Galaxy Note II Android Development] kingofthebraves:
Tried it and it works!! One thing though, I'm concerned this might not be as good as modifiying the codes on your own. Can anyone confirm this? I tried it on my s3 as well and while it does work, the lock screen still appears faster on my note 2.
[Galaxy Note II Android Development] sms2000:
My fault. There is a polling thread with very hungry wait state (100ms). I just compiled a wrong version.

Older versions used about 2000ms polling state in passive mode and even that is too short. I'm going to experiment with 10sec.

I'll fix it ASAP, my Note 2 behaves erratically those days.

EDIT: try to disable Overlay in options. The Overlay in this version the primary battery eater.
[Galaxy Note II Android Development] reinberto:
But I don't use simplistic framework
[Galaxy Note II Android Development] Gnarfsan:
I have made an android.policy.jar file for ARHD 14.

Don't forget to bacup first, guys.

Please note that the undo file contains the android.policy.jar that I modified.

If you want to make sure that you restore the correct one, simply open the undo file in 7-zip and copy your android.policy.jar in, overwriting mine.
[Galaxy Note II Android Development] sms2000:
CPUTableau ver. 1.2.72

Updated.

Motion improved.

Polling is shorten on battery.