• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

DroidViews

  • Apps
  • Downloads
    • Android Apps
    • Themes
  • Guides
    • Root
  • ROMs
  • Reviews
  • Wallpapers
  • About Us
  • Contact Us

Force “OK Google” Detection When the Screen is OFF

Naveen Robsworth | 14 Feb 2017 | Google/ Guides

Force OK Google Detection

Voice commands and digital assistants are the new faces of the smartness in smartphones. Operating your smartphone with voice commands is quite useful, and it’s also pretty cool. You can just say a magic word, and it opens Google Maps on your docked phone in the car or play songs while you’re in the shower. “OK Google” is one such great voice assistant (Google Assistant in Pixel devices) from Google which delivers excellent voice interface with your smartphone. Unfortunately, not all devices support “OK Google” detection while the screen if OFF due to lack of supported hardware. Luckily, you can now force OK Google detection on any device while the screen is OFF.

Folks over at XDA developers have come up with this beautiful theory on how to make “OK Google” available all the time. Well, the theory actually works in real time and we’ve tried it on our devices. Before we force “OK Google” detection on your device, let’s just see how it works.

How “OK Google” Works?

You need a special hardware on your device to make “OK Google” work all the time. If you do not have such hardware, there are only two options for this to work – either your device should be plugged into a power source, or the screen should be ON. Well, both the options are pretty useless as plugging your device into a power source all the time beats the purpose of the mobile device. Moreover, you don’t want to leave your screen ON all the time resulting in battery drain. But if you can make your device think it’s either charging, you can force “OK Google” to work even when the screen is OFF.

Here comes the Android debug commands into the show. There is a debug command called “dumpsys battery” which can be used to make your device think it’s charging even though it’s not. You can do this by giving a shell command “dumpsys battery set ac 1” but there are drawbacks with this method. Firstly, the battery icon in the status bar will be frozen, and the data will not be refreshed for other apps. You can easily overcome this with another command “dumpsys battery reset” when the screen is ON. The other drawback is an increase in battery drain even though it’s not much. On my OnePlus 3, it’s just a few minutes difference in battery life which is not much for me.

How to Force “OK Google” detection on All devices

Well, so you need to run two commands to get this working, but it would be stupid to enter them manually every time you turn ON/OFF your device. So, we’ll use an automation app like Tasker to get this working. Also, you’ll need root on your device for these commands to work. So, make sure to root your device before following the below steps.

  1. Install the Tasker app from the Google Play Store link below. You can also use any other automation app for Android.
    [googleplay url=”https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en”/]
  2. Open Tasker app, click on “Plus (+)” button at the bottom. Then, click on Event » Display » Display OFF and then hit back.
    create profile tasker
  3. Now, it’ll ask for creating a new task. Click on New Task » Code » Run Shell. Enter the command “dumpsys battery set ac 1” and tick the checkbox next to “Use root.”
    force ok google tasker profile
  4. Similarly, you need to create a profile for Display ON. Click on Event » Display » Display ON and then hit back. Click on New Task » Code » Run Shell. Enter the command “dumpsys battery reset” and tick the checkbox next to “Use root.”
    disable ok google
  5. Finally, you’ll see something like the below screenshot with two profiles.
    enable tasker
  6. Enable Tasker from its menu. That’s it you’re done.
    enable tasker
  7. Turn off your screen and say “OK Google” and the voice assistant should pop up. If it didn’t, make sure “From any screen”, and “Trusted voice” are enabled in “OK Google” settings.

That’s it, folks. You can now open up maps or play music on any device even with the screen is OFF.

Tags: Google Google Assistant How to Guides OK Google Tips and Tricks

Related Posts

chat bubbles android 11

Activating and Using Chat Bubbles on Android 11

google 3dar

Installing and Using Google 3D AR Animals

phone contacts

Restoring Deleted Contacts on Android

Reader Interactions

Discussion

  1. Jan 29, 2018 at 8:04 PM
    Mario Ray Mahardhika says:
    Reply

    This works half on my Mi Note 3 on MIUI EU ROM (I believe all other Xiaomi phones with registered fingerprint will behave the same). The screen is turned on but I still need to give my fingerprint to unlock it, even after ensuring things in step 7. Worse, my phone cannot be really locked, it keeps trying to unlock itself then locked again. Something must be missing…

  2. Jan 17, 2018 at 1:28 PM
    K1 says:
    Reply

    ZTE Axon 7 (Resurrection remix 7.1) doesn’t work either.

    When I turn off my screen or when it turn it off itself after a while, the display switch it on itself in a second. So now I can’t turn my screen off with those profiles :’D

    • Jan 19, 2018 at 5:14 PM
      KaKi87 says:
      Reply

      Read my answer to Alexander Rormose below 🙂

  3. Nov 8, 2017 at 3:34 AM
    Richard Owens says:
    Reply

    This doesn’t work for me. It seems that the current version of the Google app doesn’t listen for “Ok Google” with the screen off even if power is connected, so spoofing the power state doesn’t help.

    Any ideas?

    • Nov 25, 2017 at 12:54 AM
      AlejandroZ says:
      Reply

      Yeah, same for me on LineageOS 14.1 (Axon 7)

  4. Sep 20, 2017 at 1:09 AM
    Halo says:
    Reply

    You should probably put the note “you need ROOT” as the very first step or even a big bold disclaimer before the article. I wasted my time reading half the article only to find out that you need root for this to work…

  5. Jun 6, 2017 at 9:19 AM
    Bluenumb says:
    Reply

    Hi, I’ve a problem…, I have a Samsung galaxy a5 2017, when the screen off, the battery is set to ON and this reactive the screen… so I can’t use it

    • Jun 6, 2017 at 12:37 PM
      Rakesh says:
      Reply

      Sorry, but I didn’t get you. Can you be clearer?

      • Oct 18, 2017 at 5:22 PM
        Alexander Rormose says:
        Reply

        I have the same problem he has. My screen turns on when it gets connected to the charger. Any idea how to bypass that?

        • Jan 19, 2018 at 5:12 PM
          KaKi87 says:
          Reply

          This is because normally, your screen turns on when you plug your smartphone. You just have to disable this behavior.

Join The Discussion: Cancel reply

We never share our visitor/user details. For more info, Please read our privacy policy before submitting your comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Footer

  • Apps
  • Downloads
    • Android Apps
    • Themes
  • Guides
    • Root
  • ROMs
  • Reviews
  • Wallpapers
  • About Us
  • Contact Us

Privacy Policy | Terms & Conditions
© 2025 · DroidViews