Project Ara Smartphone Will Run Modified Android L with Hot Swapping

Project Ara is a very exciting topic–both for hardware and … more

Streamline Android Theme Customization with Graphic Porter

I dont have a custom theme on my Android phone, and the reason for this is because … more

Boost the Brightness of Your Sony Xperia Z1’s LED

I think the last time anyone has ever used a physical torch to find their earphones, … more

XDA Xposed Tuesday: Modify the Look of Your Volume Control – XDA TV

How many screenshots have you seen with a volume status bar in the … more
Post Reply

[Q] Disabling soft and hard power/reset in android

1st February 2014, 12:43 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Dec 2012
Hi all,

I found similar questions on different forums yet they usually asked regarding solutions in API. I'd prefer to ask the question allowing for a broader spectrum of solutions.

I was wondering whether or not it's possible through code to disable any kind of powering off, including resetting, for the duration of a certain activity. It would be greatly preferable if it didn't involve having to use a rooted phone. The solution needn't involve an exact method via the API but rather an algorithm such as putting the phone in a loop of some sort so that powering down isn't possible until the end of the procedure. During this time the application is waiting to receive a communication from a server which dictates that it's fine to continue regular activity (including returning functionality of power options) .

Any creative ideas
1st February 2014, 02:59 PM   |  #2  
Masrepus's Avatar
Senior Member
Thanks Meter: 74
 
662 posts
Join Date:Joined: Feb 2013
More
Hm u mean resetting like holding down power button for force restart? This can't be aborted by an app, as it just shuts down with i call it 'brute force'. So it will shut your activity down as well.
But for the normal power off via the menu, i could imagine you could prevent that by letting the phone do massive cpu operations, as if my old phone had a really hard lag, the power off via power menu didn't work. But it really must be some massive massive task, as it has to make the whole phone lag terribly and this must be done in the first half second after giving the commamd to shut down... So i dont think this is really to implement without blocking the command on root level

---------------------------------
Phone : My new Nexus 4!
OS:
Pure KitKat 4.4.2 stock, no root, no mods (but only for the first time ;D)
---------------------------------

Gesendet von Tapatalk
1st February 2014, 04:14 PM   |  #3  
OP Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Dec 2012
I'd imagine that anti theft solutions implement something similar to locking down a phone until a release code is supplied. What's the point of geolocating it if a thief can just turn it off?
1st February 2014, 11:57 PM   |  #4  
Member
Thanks Meter: 21
 
88 posts
Join Date:Joined: Sep 2013
You can try to show an Window via WindowManager to hide the Dialog which is shown when you long press your power button.. Maybe it work.
But normally you can't do that. If you do too much CPU work Android will just force close your App with that ANR Message (App Not Responsing)
2nd February 2014, 09:01 AM   |  #5  
Masrepus's Avatar
Senior Member
Thanks Meter: 74
 
662 posts
Join Date:Joined: Feb 2013
More
Quote:
Originally Posted by perditi0nspam

I'd imagine that anti theft solutions implement something similar to locking down a phone until a release code is supplied. What's the point of geolocating it if a thief can just turn it off?

No, antitheft solutions only prevent the thief to access the phone, but they dont pervent it from being shut down

---------------------------------
Phone : My new Nexus 4!
OS:
Pure KitKat 4.4.2 stock, no root, no mods (but only for the first time ;D)
---------------------------------

Gesendet von Tapatalk

---------- Post added at 11:01 AM ---------- Previous post was at 11:00 AM ----------

Quote:
Originally Posted by EmptinessFiller

You can try to show an Window via WindowManager to hide the Dialog which is shown when you long press your power button.. Maybe it work.
But normally you can't do that. If you do too much CPU work Android will just force close your App with that ANR Message (App Not Responsing)

I think that wont work neither as the dialog is shown on top of everything, even on top of the window you try to open

---------------------------------
Phone : My new Nexus 4!
OS:
Pure KitKat 4.4.2 stock, no root, no mods (but only for the first time ;D)
---------------------------------

Gesendet von Tapatalk
2nd February 2014, 02:23 PM   |  #6  
OP Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Dec 2012
First of all, thanks for the prompt responses

A differnet forum suggested the following (a few years ago):

"
So guys i have successfully disabled power off menu of Motorola Atrix 4G (MB860-Froyo)while asleep (screen off and locked) now power button only wakes mobile and does not show power menu.

Use any file explorer with text file editor and go to /system/usr/keylayout/ -- where following files modified shown below. The flag of all POWER enteries changed from WAKE TO WAKE_DROPPED and restart mobile --- hurrrrrrah done: -

cpcap-key.kl
key 107 POWER WAKE_DROPPED

evfwd.kl
key 116 POWER WAKE_DROPPED

qwerty.kl
key 116 POWER WAKE_DROPPED


usb_keyboard_102_en.us.kl
key 116 POWER WAKE_DROPPED
"

Any idea if that would disable both hardware and software resets for a set period of time? Would it require root?
2nd February 2014, 08:08 PM   |  #7  
Masrepus's Avatar
Senior Member
Thanks Meter: 74
 
662 posts
Join Date:Joined: Feb 2013
More
Hm yeah should work
You obviously will need root as you are changing system files.

---------------------------------
Phone : My new Nexus 4!
OS:
Pure KitKat 4.4.2 stock, no root, no mods (but only for the first time ;D)
---------------------------------

Gesendet von Tapatalk

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Java for Android App Development by ThreadRank