I often end up accidentally rebooting my Nexus 6 while having it in my pocket, because the power buttons gets pushed for more than 10 seconds.

Considering the long boot times, this can be very annoying.

I can see why it is important to have a way to force-reboot your when it gets stuck, even though I haven't had this type of issue yet.

Is there are way I can change the force-reboot behaviour?

Perhaps increase the time in which power button must be pushed or change it to a combination of buttons (i.e. volume up + power button for 10 seconds) ...anythign that makes it less likely to be triggered by my pocket.

  • If you can get your hands on the equipment and code to alter the BIOS residing on the motherboard of your phone, it may be possible, but as far as I know, all Android devices reboot after holding down the power button for 10 seconds as a kind of emergency reboot. Imagine your phone hangs and does not allow you to reboot, even has a built-in, non-replaceable battery; you would have to wait until the battery is dead to you can use your phone again.
    – GiantTree
    Commented Oct 15, 2015 at 12:07
  • @GiantTree I am aware of why this feature exists and have mentioned it. I was just wondering if anybody figured out a way how to tweak the firmware. Commented Oct 15, 2015 at 12:12
  • 1
    I can't evade the force-reboot directly but I was thinking, what if you can be notified using vibration that the device is in pocket and button is stuck for long (at most 500ms)? That can be done. I want to know, is the device rooted?
    – Firelord
    Commented Oct 15, 2015 at 19:04
  • Was about to say tasker, but I cannot find a power button variable
    – Dan Brown
    Commented Oct 15, 2015 at 21:14
  • @Firelord that is a very interesting idea! I wouldn't mind rooting it to make it work. Commented Oct 16, 2015 at 13:20

1 Answer 1


I was hoping some flexibility in long-press timeout using AutoInput but the apps slows down my OS considerably to do anything with it.

Anyhow, all I suggest is to use Xposed Additions (free/paid; requires Xposed Framework; if you've Android 5.x, you would need to flash some files from custom recovery. See this XDA thread by rovo89 for such case).

We need Tasker (paid, 7 day free trial) too.


(Tested on Android 5.0.2 and 5.1.1)

  1. Install both the apps → activate Xposed Additions's module → launch Xposed Additions

  2. Tap Buttons → set Long press delay slider to maximum (500ms) → Add new Key → press Power key to select it → Power

  3. Tap Add new Condition → Screen Off → Screen Off → enable Long Press → Shortcut → Task Shortcut → New Task → name the task.

    Note: You can try MacroDroid's MacroDroid Shortcut in place of Task Shortcut. The free version is restricted to one action per macro, so you wouldn't get any flexibility, but it is acceptable here.

  4. For your task, action would be:

    • Alert → VibrateTime: select the vibration time (in milliseconds)

    It is possible that vibration for 1000ms would not be enough for you. In that case, add combination of actions. For example, in addition to last Vibrate action, you can also do:

    • Task → Wait → select MS or/and Seconds slightly greater than milliseconds selected in last Vibrate action

      Wait is important because if you add continuous Vibrate actions then you would end up skipping almost of them except the first one. Tasker doesn't queue vibrate requests, as it seems to me.

    • Now, add another Vibrate action and copy-paste the whole cycle as much as you want.
  5. Select an icon for your task and there you go.

You can now test your solution.


For users having AutoInput satisfactorily running, you can emulate long-press of a key. I tested my solution on Volume Up key and it worked perfectly. Well almost!

For Tasker:

Profile 1: Event → Plugin → AutoInput → Key → Configuration:

  • select your key under Keys
  • select Key Action to Key Down

Task 1: Actions:

  1. Variable → Variable Set → Variable: %Set → To: 0
  2. Task → Wait → select MS or Seconds for your desired long-press timeout. Choose 1 Second for experimental purposes
  3. Task → If → %Set eq 0
  4. Alert → Vibrate → Time: 1000ms

Profile 2: Event → Plugin → AutoInput → Key → Configuration:

  • select your key under Keys
  • select Key Action to Key Up

Task 2: Actions:

  1. Variable → Variable Set → Variable: %Set → To: 1

Use the action Key Suppress from Plugin → AutoInput → Modes, wherever feels necessary. Also, I didn't yet experiment with screen off state.

Now, the theory: The flow is in this manner:

  • When your selected key (say Key-X) would be pressed, profile 1 would activate.
  • When the key would be released, profile 2 would activate.
  • We know that for long-press the key needs to be continuously pressed for some time.
  • Now, if I long-press Key-X then for that time being profile 2 would not activate and so I can set %Set to 0 in profile 1 → wait for long-press timeout (slightly less) → check if %Set is still 0 (%Set would become 1 if key gets released) and then execute the Vibrate action.

Simple! Let me know if it works for Power key.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .