[MOD] Wake on Volume Keys via android.policy.jar

rozzco

Senior Member
Mar 4, 2011
381
51
58
No, it's not normal at all. This is actually the first update to this mod since everyone went to gingerbread.

Hey, go figure, I've just managed to reproduce the problem that rozzco and you have reported. My phone didn't wake on volume. You guys will have to hold tight while I investigate. I'm on the France Orange 2.3.4 by the way, but I'm glad it's occurring on all ROMs it seems, so there should be a common fix.
I think it might be tied to the fingerprint reader somehow. I was testing to see how long it takes before it quit working and at 5 seconds it vibrated twice, woke up and reported that the swipe was too short. I did not touch the fp sensor.
 

maledyris

Senior Member
Mar 25, 2011
170
58
0
Burnaby
I think it might be tied to the fingerprint reader somehow. I was testing to see how long it takes before it quit working and at 5 seconds it vibrated twice, woke up and reported that the swipe was too short. I did not touch the fp sensor.
I've been poring over the byte code, and actually, I think it's related to a new feature Motorola added called "Deep Sleep". This wasn't present in the previous Froyo code. It seems to completely disable other buttons except power when it's on. Not actually sure what it's supposed to accomplish, besides irritate those of us who are trying to get wake on volume working :rolleyes: Battery savings? Mine are actually worse with GB than Froyo :confused:
Anyway, I should be able to get around this, but it's going to take a bit more digging and experimentation.

Incidentally, and not related to this, I just noticed now that the PhoneWindowManager code made some mention of fm radio states and com.motorola.fmradio.state... Interesting...
 

rozzco

Senior Member
Mar 4, 2011
381
51
58
I have discovered that if the phone sits for hours that the mod works as advertised! I think you are right on with the deep sleep thing! ;)
 
Last edited:

RogerPodacter

Senior Member
Apr 12, 2010
5,655
425
0
Los Angeles, CA
I've been poring over the byte code, and actually, I think it's related to a new feature Motorola added called "Deep Sleep". This wasn't present in the previous Froyo code. It seems to completely disable other buttons except power when it's on. Not actually sure what it's supposed to accomplish, besides irritate those of us who are trying to get wake on volume working :rolleyes: Battery savings? Mine are actually worse with GB than Froyo :confused:
Anyway, I should be able to get around this, but it's going to take a bit more digging and experimentation.

Incidentally, and not related to this, I just noticed now that the PhoneWindowManager code made some mention of fm radio states and com.motorola.fmradio.state... Interesting...
An interesting parallel is that on the nexus one the trackball wake worked in 2.2, but in the 2.3 update google changed things and trackball wake is no longer possible. So cyan couldn't use the actual ota update because of no wake.
 
  • Like
Reactions: maledyris

maledyris

Senior Member
Mar 25, 2011
170
58
0
Burnaby
An interesting parallel is that on the nexus one the trackball wake worked in 2.2, but in the 2.3 update google changed things and trackball wake is no longer possible. So cyan couldn't use the actual ota update because of no wake.
That's actually potentially important info. It suggests that the change is in the PowerManager itself, rather than moto's new DeepSleepService, which I was noticing made calls to the real power manager. I was requesting DeepSleepService to not function... Still the keys didn't work. Either I made mistakes in how I was trying to disable it, or the deep sleep stuff is at too high a level to affect re-enabling the buttons.
 

maledyris

Senior Member
Mar 25, 2011
170
58
0
Burnaby
So, I haven't tracked down the problem, mainly because the GB ROM I was using had such bad battery that my phone was practically unusable. I had to focus on that first. In the end, I went to the Bell leaked GB. Battery seemed good again, so I went back to investigating this wake on volume problem...

But now I have a problem that isn't really a problem for me. Wake on volume is working on this Bell GB ROM!

This leads me to believe that the ROMs that it isn't working on might have some bug in them? Well, France GB was definitely buggy (a few random reboots, plus wake issues... potentially wake lock). Plus, it seems to have more debugging code left in than the Bell one. Comparing the PhoneWindow class of the France GB ROM and the Bell GB ROM showed about 99 differences, all in the onKeyDown method. I might be able to fix it, but I'll need to see. I may have to try other ROMs and do more comparisons. We need an AOSP ROM for Atrix. That would make for the purest ROM to compare against.

In the meantime, I've reposted a new version with fixed permissions, since this mod will apparently work for all Froyo users, and some Gingerbread users.
 

maledyris

Senior Member
Mar 25, 2011
170
58
0
Burnaby
cant seem to get it to work running gingerblur 4.5 on 1.8.3.

http://pastebin.com/jvwRMhGp

bell atrix
Try replacing the Windows batch file with this new one which doesn't try to call the sh files, then let me know if it works out for you. I think I know what the problem you're having is, but this is probably easier and should get you up and running.
 

Attachments

[email protected]

Senior Member
Sep 24, 2007
1,465
194
93
Hello.

I've flashed (ROM)Home Base 4.5.9.1 stock ..9/7 2.5Update (EXT4/LAGFIX)FASTEST ATRIX BLUR ROM and it already has the wake on volume patch.
When I executed "restore" from this mod's package it couldn't find old android.policy.jar, so my guess is it only works if you use the mod to add the patch..

So, what one would need to do to remove wake on volume keys if they don't have original android.policy.jar?

Thank you.
 

kwick60073

Member
Mar 30, 2011
41
3
0
Gurnee, IL
Has anyone worked out waking on volume keys with CM7? The script failed when trying to patch the policy jar file...not a real surprise. Upon inspection of the KeyguardViewMediator.smali file, the method is there, but the lines referring 0x18 and 0x19 (described in OP) are not there.