How to disable power button when the screen is locked - Nexus 4 Q&A, Help & Troubleshooting

It would be awesome if sombody posts how to do it with rooted Nexus 4 and without any additional apps. I mean to do it on true *nix-way - console :laugh:
Many people need it for security reason, I guess. I digged the file at /system/usr/keylayouts, but cant find what I need to do.
Below are the lines from logcat when long press the power button on locked screen and "power menu" appears.
Code:
W/ViewRootImpl( 1385): Dropping event due to no window focus: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_POWER, scanCode=116, metaState=0, flags=0
x8, repeatCount=3, eventTime=11458677, downTime=11458075, deviceId=1, source=0x101 }

How do you mean disable power button? It's hardware?

Why would you want to do that. How would you get back to your lock screen?
Sent from my SAMSUNG-SGH-I727

I think OP want disable power off menu when phone is locked

RolF2 you're totally right.
Sorry guys, I wasn't clear enough.
I want to disable the power menu button when the screen is locked to prevent "some thief" to switch the phone off.
And in other cases it should work as it does now.
UPD: I know Gravity Box can do it. But my phone has ART running which denies to serve Xposed.
I mean the phone is rooted, encrypted, the password is changed with "vdc changepw", bootloader is re-locked, cerberus is installed and now such kind of little thing (power menu) ruins the full security ))).

I dunno the under workings of how to disable the power menu in the lockscreen but there are some ROMs that have it built in into settings. AICP, Beanstalk, Cataclysm, and Purity have this option. I'm a Purity user and it works well. Cerberus don't work when the phone's off. LoL.
Sent from my Nexus 4 using Tapatalk

Cerberus don't work when the phone's off. LoL.
Click to expand...
Click to collapse
You've got the exact reason of my Q.
P.S. I prefer stock ROM.

Any update/news of a code that can be used to disable the power menu from the kernel level?
That would be great.

DZeros said:
Any update/news of a code that can be used to disable the power menu from the kernel level?
That would be great.
Click to expand...
Click to collapse
Nope. Still waiting for help.

im interested in that too!

I think you're a bit paranoid

Mashed_Potatoes said:
I think you're a bit paranoid
Click to expand...
Click to collapse
To say "a bit paranoid" is to say nothing in my case. )))
But without jokes, this feature is very needed. As one of us said it here before: Cerberus won't work when the phone is switched off.

Related

App request: Home/Optical tracker button to activate lock screen

Hi,
Would it be possible for someone here to create an app with the ability to solve the "only power-button activates the lock screen after standby" issue?
I'm thinking that this would be something a lot of Desire owners would see come in handy.
I would look into it myself, but not being a developer by profession my coding skills are zero. I've tried the app 'No Lock', but it just doesnt do it for me as my Desire wakes up in my pocket with the lockscreen deactivated.
(Couldn't find another thread regarding this, so forgive me if it's already been posted before.)
Br,
David
DPE said:
Hi,
Would it be possible for someone here to create an app with the ability to solve the "only power-button activates the lock screen after standby" issue?
I'm thinking that this would be something a lot of Desire owners would see come in handy.
I would look into it myself, but not being a developer by profession my coding skills are zero. I've tried the app 'No Lock', but it just doesnt do it for me as my Desire wakes up in my pocket with the lockscreen deactivated.
(Couldn't find another thread regarding this, so forgive me if it's already been posted before.)
Br,
David
Click to expand...
Click to collapse
There is an app already called "myLock" which has an advanced mode that allows you to double press any button to unlock the screen, just don't use it with the HTC pattern lock as it messes up.
+1 for this.
Btw, you can try LockBot. It is neat, but the disadvantage is that once you get a call, the lock deactivates, which is plain irritating. If you are carrying your cell in your pocket and you receive a call, it might happen that not only the call gets answered/rejected but it can start dialing some random numbers as well! has happened to me once.
So its not perfect, but it works ok.
I just hated pressing the power button every time i had to unlock the phone.
Thanks. This is actually a usefull tool, and does the job well. However, i'd still like a tool that lets me choose a specific button for activating the unlock slider screen, as id like to keep the slider.
But thanks for the advice.
---------------------------------
Sent via the XDA Tapatalk App
EroThraX said:
There is an app already called "myLock" which has an advanced mode that allows you to double press any button to unlock the screen, just don't use it with the HTC pattern lock as it messes up.
Click to expand...
Click to collapse
I've been using myLock for a few days now and updated this morning. I don't see the advanced features.
It's under mode select for me, press where it says auto unlock.
I believe this is what you want.
I press the menu button to wake up the phone, and menu or slide to unlock it.
myth1001 said:
I believe this is what you want.
I press the menu button to wake up the phone, and menu or slide to unlock it.
Click to expand...
Click to collapse
Thanks...
Still, would'nt it be great with an app to do this!
myth1001 said:
I believe this is what you want.
I press the menu button to wake up the phone, and menu or slide to unlock it.
Click to expand...
Click to collapse
I believe this would work only if your phone is rooted?

AnyUnlock: An app to treat N1's power button problem (no root required)

Before developoing this app, I am using
1. Nolock
2. Flyscreen
3. lock widget
in order to
1. use any key to turn the phone on
2. use widget to turn off the phone
3. Use flyscreen to prevent the accident tap
However this combination is huge and invenient. So I deciced to develop a very small app (40k in size) it can
1. Use any key to turn on the phone
2. A widget turn phone off
3. A very simple lock screen to prevent accident tap.
Search AnyUnlock in Android Market and enjoy it. If there are any porblems, please report.
i like it!
perhaps you should include an option to enable or disable the 'lock screen to prevent the accidental tap.'
deenn said:
i like it!
perhaps you should include an option to enable or disable the 'lock screen to prevent the accidental tap.'
Click to expand...
Click to collapse
Yes, I will do that in next version.
It didn't work for my N1. I enabled the app, brought me to the 2nd window where I also enabled it and let the phone shut down and nothing, I had to use the power button to turn the screen back on. Back to nolock.
It was the way I installed it, working now but after installing gingerbread the trackball wake no longer wakes the screen, have to use the volume key. Still very effective but like the trackball wake.
vinnyjr said:
It didn't work for my N1. I enabled the app, brought me to the 2nd window where I also enabled it and let the phone shut down and nothing, I had to use the power button to turn the screen back on. Back to nolock.
Click to expand...
Click to collapse
Yes, there is a bug. If you don't allow the admin permission in the first time. The program will fail. You can disable it, uninstall it and reinstall to take effect.
I also couldn't pick up on an incoming call... it just went to the screen which shows the enable/disable anylock buttons. I couldn't press home or back. Uninstalled it for now.
Sent from my Nexus One using XDA App
deenn said:
I also couldn't pick up on an incoming call... it just went to the screen which shows the enable/disable anylock buttons. I couldn't press home or back. Uninstalled it for now.
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
I have updated to 1.2 with the option to disable simple lock screen. Also I tried to fix your phone call issue. Hopefully it is working.
OK 1.3 released with fixes to some non-n1 devices.
Works fantastic. After enabling the app I went back into settings and unchecked the lock screen. Now it works just the way I wanted. Thanks for the great app.
Vinny
Interesting app since my power button is acting up, Thanks.
cesar67 said:
Interesting app since my power button is acting up, Thanks.
Click to expand...
Click to collapse
You can have a try. The power button is quite vunerable for HTC devices. I hope Android would make an official option to power on the device using any keys.
works brilliantly now! thanks.
maybe you should put in the description in the market that no root is required.
and an option to still use the slider when unlocking? that would be my favorite option.
just pressing the track ball brings you to the unlocking screen with the slider.
This is super awesome, thanks for making this!
Curious, what specific activity does the widget call? I would like to be able to shut the screen off using other things (dock swipe up, tasker, custom widget) etc. is it an android acitivity or one that is specific to AnyUnlock?
I tried each of the 4 or 5 activities in AnyUnlock but they didn't work.
Thanks for making this!
Sent from my Nexus One using XDA App
Just updated to Gingerbread on N1 and the trackball doesn't wake anymore, but volume button still works.
I can also confirm the trackball doesn't work to wake the screen up, but the volume buttons still do.
Hopefully the trackball wake issue will be resolved for gingerbread.
Sent from my Nexus One using XDA App
colins said:
Just updated to Gingerbread on N1 and the trackball doesn't wake anymore, but volume button still works.
Click to expand...
Click to collapse
Yup, I noticed this also with other apps that disable the lockscreen (like Switchpro)
That's too bad.
No Lock too from what another user has stated. There's no way i'm changing from CM7 if there's no possibility of trackball wake!
Does this app just Wake the N1 or does it power ON a device which is powered off ?
I can already wake via the trackball using CM6 , but I need something which will Power it ON as my power button is broken.
OJ in Compton said:
I can also confirm the trackball doesn't work to wake the screen up, but the volume buttons still do.
Click to expand...
Click to collapse
I can also confirm trackball doesn't wake screen but the volume key will. Hopefully the dev. can fix this issue.
Thanks for a great app.
PS Will donate when trackball is fixed.

[Q] Volume Button Wake

I'm looking for a simple app that allows the the Atrix to be woken up via the volume buttons.
I know that there are several other apps, but they all center around removing the lock screen, or replacing it. I *want* the lock screen, I just also want to be able to use the volume keys to wake the phone up.
Is there ANYTHING out there like this? Just this SIMPLE function? I'd even use a bloated app if it allowed me to use the stock lock screen.
Just try widget locker. You can customize it so it can be simple like you want it.
Never live in the past but always learn from it.
"No Lock". Flawless & free..
Sent from my MB860 using XDA Premium App
Tennis11 said:
Just try widget locker. You can customize it so it can be simple like you want it.
Never live in the past but always learn from it.
Click to expand...
Click to collapse
I gave it a try, and it *almost* works like I want it. I use the fingerprint to unlock, and if you have both the pattern and the fingerprint set, it appears as though after the device wakes up you still need to swipe the screen. This is a hassle. Maybe I'm missing something in the configuration? Also, it appears that WidgetLocker is laggy as hell.
Vangelis13 said:
"No Lock". Flawless & free..
Sent from my MB860 using XDA Premium App
Click to expand...
Click to collapse
I specifically said that I *WANT* my lock screen.
I only need the ability to wake up the device by pressing a volume key.
jsylvia007 said:
I gave it a try, and it *almost* works like I want it. I use the fingerprint to unlock, and if you have both the pattern and the fingerprint set, it appears as though after the device wakes up you still need to swipe the screen. This is a hassle. Maybe I'm missing something in the configuration? Also, it appears that WidgetLocker is laggy as hell.
I specifically said that I *WANT* my lock screen.
I only need the ability to wake up the device by pressing a volume key.
Click to expand...
Click to collapse
You're welcome. Whtvrtf..
Sent from my Motorola Olympus using XDA Premium App.
I'm not sure why you are upset?
I asked for an application that allowed me to keep my factory lock screen, and NoLock does not do that. If you have "NoLock" enabled, then the volume keys wake up the phone... they also UNLOCK the phone. If you disable "NoLock", you have the lock screen back, but the volume keys do not wake the phone.
Maybe if you had actually read the post, you would have realized why I responded the way I did.
I know there's an app for it. But I can't remember.
One thing is if you have tasker set context volume buttons, task screen on.
Never live in the past but always learn from it.
Tennis11 said:
I know there's an app for it. But I can't remember.
One thing is if you have tasker set context volume buttons, task screen on.
Never live in the past but always learn from it.
Click to expand...
Click to collapse
I cant find any way to choose the volume button in tasker context. any helpful suggestions?
I'm just starting out with Tasker, and man are there some endless possibilities. I also can't find any references to the volume buttons. Any help would be appreciated.
jsylvia007 said:
I'm just starting out with Tasker, and man are there some endless possibilities. I also can't find any references to the volume buttons. Any help would be appreciated.
Click to expand...
Click to collapse
Me too, that would be perfect.
For now, you caa use "anyunlock" on market. This tool is not stable if you use with advance task killer and fast reboot. This is shorterm solution with me!
Sent from my MB860 using XDA App
Zanr Zij said:
For now, you caa use "anyunlock" on market. This tool is not stable if you use with advance task killer and fast reboot. This is shorterm solution with me!
Sent from my MB860 using XDA App
Click to expand...
Click to collapse
This app right in the FAQ section says, "Can I use the standard Android Lock Screen", and the answer from the developer is no... Still not what I'm looking for.
Any luck finding that?
WidgetUnlocker now allegedly supports the finger print scanner of the ATRIX. I have found it unreliable at BEST.
I'm waiting for another release to see if the capability gets more stable.
The problem with wu is that it's canceling the slide to answer and that renders it useless.
Sent from my Atrix
Nolock will prevent full lockscreen but allow to bring out of sleep mode via either volume buttons or power button. The timed sleep mode in settings will put phone to sleep.
Sent from my MB860 using Tapatalk

[MOD][REQUEST] Disable Capacitive Buttons

I am currently running AOKP on my Tmobile version and enabled the onscreen navigation bar. Id like to know if we have a script that disables the capacitive buttons yet on this device, and if not, a request for a dev to make one. Thank you.
I haven't been able to disable them, but if you just want to have the capacitive buttons not light up snag "Screen Filter" as it lets you turn off the button lights (set it to 100% if you don't want to dim your screen). I also used "Auto Start (no root)" to have it start at boot.
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
Dandude159 said:
I am currently running AOKP on my Tmobile version and enabled the onscreen navigation bar. Id like to know if we have a script that disables the capacitive buttons yet on this device, and if not, a request for a dev to make one. Thank you.
Click to expand...
Click to collapse
What do you mean disable those buttons? Disable actions when pressing them?
So you have a huge useless bezel at the bottom of your screen?
Simple Line changes in the key map.
Sent from my SPH-L710 using Tapatalk 2
nabbed said:
What do you mean disable those buttons? Disable actions when pressing them?
So you have a huge useless bezel at the bottom of your screen?
Click to expand...
Click to collapse
Well mostly disable the light. I want to use the on screen navigation keys in AOKP as a substitute.
Dandude159 said:
Well mostly disable the light. I want to use the on screen navigation keys in AOKP as a substitute.
Click to expand...
Click to collapse
Are you for real?
I don't mean to be a **** but come on!
Settings/Display/Touch Key Light Duration/Always Off.
LOL i bet a lot of people didn't know that (including me).... i mean i've been to that setting before to see how long the lights could be "on" for. but never noticed there was a "always off" option
nabbed said:
Are you for real?
I don't mean to be a **** but come on!
Settings/Display/Touch Key Light Duration/Always Off.
Click to expand...
Click to collapse
Please don't be rude, especially because you are wrong. This option is only available in the stock touchwiz based rom. I am on AOKP.
Dandude159 said:
Please don't be rude, especially because you are wrong. This option is only available in the stock touchwiz based rom. I am on AOKP.
Click to expand...
Click to collapse
Sry. Reading comprehension was subpar on my part.
This is actually a very useful tool if available. On my Asus Transformer Prime, there is a lock setting that disables the capacitive buttons while you watch a movie or play a game. I know the OP wants to disable the capacitive buttons for the purpose of replacing it with the AOKP onscreen buttons, but I would like to have that ability just to disable it so that I don't accidentally press on those buttons while playing game or watching video. Like a quick setting from the notification bar to lock it would be perfect!
Ill be subscribing to this thread for when we get a daily driver AOSP rom on Verizon. I too would like to disable the capacitive buttons and have on-screen navigation buttons instead. I find the capacitive buttons are too hard to press when I want to and too easy to accidentally press when I don't want to.
Sent from my SCH-I535 using xda premium
So, I don't know how to actually disable the button function (I'm running task's AOKP rom) and I didn't like using that Screen Filter app to keep the backlight off since it keeps it in the notification bar.
However, it is pretty easy to keep just the backlight off. Go into Settings>Display>Custom Backlight Settings. Check the "Use custom" option and go into "Edit other levels...".
Change the value for all the different levels from 1 to 0. Reboot and enjoy!
clark44 said:
Simple Line changes in the key map.
Sent from my SPH-L710 using Tapatalk 2
Click to expand...
Click to collapse
Do you happen to know what or where this line of code is so that we may modify it...?
Thanks,

Slightly wet the button area, now the home button keeps triggering non stop.

Slightly wet the button area, now the home button keeps triggering non stop. Everything else works fine.
Ive tried the following solutionsb
https://forum.xda-developers.com/oneplus-2/general/guide-oneplus-2-home-button-dead-t3324321
Phone is currently sitting in a bag of rice so let's see how that goes.
Meanwhile, can anybody think of a way to disable the home button (perhaps through terminal or something)? Because the phone would basically be usable.. I know there are button settings, so if only I could somehow put home button as "no action".
sl___ said:
Slightly wet the button area, now the home button keeps triggering non stop. Everything else works fine.
Ive tried the following solutionsb
https://forum.xda-developers.com/oneplus-2/general/guide-oneplus-2-home-button-dead-t3324321
Phone is currently sitting in a bag of rice so let's see how that goes.
Meanwhile, can anybody think of a way to disable the home button (perhaps through terminal or something)? Because the phone would basically be usable.. I know there are button settings, so if only I could somehow put home button as "no action".
Click to expand...
Click to collapse
Just ON " Enable on-screen nav bar " in settings>butons
and OFF " Always enable menu button " in settings>butons.
tbiwalkar said:
Just ON " Enable on-screen nav bar " in settings>butons
and OFF " Always enable menu button " in settings>butons.
Click to expand...
Click to collapse
The thing is the constant pressing of home button makes me not able to navigate anywhere.
The only place I can actually do something is in recovery, because the home button doesn't actually do anything.
If there's a way I can enable it in terminal in recovery mode that would be great.
sl___ said:
The thing is the constant pressing of home button makes me not able to navigate anywhere.
The only place I can actually do something is in recovery, because the home button doesn't actually do anything.
If there's a way I can enable it in terminal in recovery mode that would be great.
Click to expand...
Click to collapse
what rom are you on? maybe someone on same rom can pull his build.prop and use qemu string to enable nav bar and u can push it in using twrp
tbiwalkar said:
what rom are you on? maybe someone on same rom can pull his build.prop and use qemu string to enable nav bar and u can push it in using twrp
Click to expand...
Click to collapse
Thanks for the idea. I'm using resurrection remix - will ask somebody on the thread. What does qemu string mean?
tbiwalkar said:
what rom are you on? maybe someone on same rom can pull his build.prop and use qemu string to enable nav bar and u can push it in using twrp
Click to expand...
Click to collapse
Nevermind, I figured out how to enable on screen nav, but I need a way to disable the hardware buttons..
Edit: figured it all out!
sl___ said:
Nevermind, I figured out how to enable on screen nav, but I need a way to disable the hardware buttons..
Edit: figured it all out!
Click to expand...
Click to collapse
Hope the moisture dries out and your fingerprint reader starts working normally
Tip of advice for everyone who has problems with the fingerprint reader after it got wet or started to get crazy for any weird reasons at all.
Drain the phone battery until it dies. Then try to boot it up to drain even the last power in it.
Then recharge the phone.
By draining the battery and recharghing it you reset the phone's sensors.
Be lucky some of you aren't living in a country like me where the weather is moist all the time. I had to do this method thrice this week ??
Sent from my ONE+² using Tapatalk⁴

Categories

Resources