How to Fix Delayed Notifications on a Google Pixel Phone on Android 11, 12, 13, 14 Using ADB via USB (Tethered) or On the Device Itself (Untethered)

Posted in Tips and tricks on 17 March 2024

Relevant for Google Pixel models:

  • Pixel 4, Pixel 4a, Pixel 4a 5G, Pixel 4 XL
  • Pixel 5, Pixel 5a, Pixel 5a 5G
  • Pixel 6, Pixel 6a, Pixel 6 Pro
  • Pixel 7, Pixel 7a, Pixel 7 Pro
  • Pixel 8, Pixel 8a, Pixel 8 Pro

Android versions:

  • Android 11
  • Android 12
  • Android 13
  • Android 14

Great Cameras, Buggy OS

One of the requirements for a new project of mine was a dedicated Android smartphone with some of the best cameras on the market. According to the latest tests, the Google Pixel smartphone lineup still leads the pack when it comes to reasonably priced camera phones. It also seems like there haven't been any noticeable improvements on the camera hardware in those since the release of the 6th generation of Pixels. So I picked up a shiny new Pixel 6a, created a new Gmail account and signed in.

All was going well until I realized that most, if not all email and instant messaging apps' notifications were delayed. Sometimes for a minute. Usually – for much longer.

At first I shrugged it off, thinking, "Well, what did I expect? It's an Android phone. You have to spend time fiddling with it to get it to behave as needed...". You know the drill.

Therefore, I made sure to try and fix this with the tools presented by the OS:

  • Disabled Battery Saver and Adaptive Battery
  • Lifted any background activity restrictions for Gmail and messaging apps
  • Allowed those apps to have unrestricted access to the internet
  • Updated both Android and the apps to the latest versions

power-saving-disabled-on-pixel-phone-no-effect

Alas, even after completely powering down and restarting the phone, as recommended in some forums, nothing changed. Within about 5 minutes, the phone would still go into some sort of deep sleep mode, which in turn would cause email and instant messaging notifications to be delayed again.

Really? Do I still have to switch into a "Power User" mode and jump through hoops even in 2024 to fix freaking notifications?

Guess some things never change…

gta-here-we-go-again

Why?

Long story short, it's all because of a power-saving feature called Doze:

Doze reduces battery consumption by deferring background CPU and network activity for apps when the device is unused for long periods of time. App Standby defers background network activity for apps with no recent user activity. While the device is in Doze, apps' access to certain battery-intensive resources is deferred until the maintenance window. The specific restrictions are listed in Power management restrictions.

Sounds nice, until you experience it for yourself in Google Pixel phones in particular. I've never had any issues with notifications on Android phones from brands like Samsung, TCL, Xiaomi to name a few. For some reason only Pixels have always been plagued with the delayed notification issues for years ever since Google migrated those to use their own SoC, known as Google Tensor. I suppose the power efficiency of the SoC wasn't very impressive, so Google had to resort to enabling permanent aggressive power saving in the OS. Even if it came at the cost of apps being constantly killed in the background on a phone with 6GB (!) of RAM, half of which is often free, as well as notifications and push messages being sent with considerable delays.

Luckily, there's a solution.

Disable Google Pixel Light and Deep Sleep Modes Using ADB

adb-tools-icon

ADB, or Android Debug Bridge, is a well-known tool among Android enthusiasts. It allows to perform "fine-tuning" of the OS, remove bloatware and do some other cool stuff. It's a Power User tool, so of course it should be used with care.

Fortunately, disabling Doze via ADB is safe and easy. The only caveat is that you need to do this after every phone restart. But considering how important it is to have reliable notifications, and how rarely you need to reboot a phone, that's hardly an issue.

Activate Developer Options and Enable USB and Wireless Debugging on the Device

  1. Open Settings, and select “About”
  2. Tap on “Build number” seven times until a message pops up that says: "Congratulations! You are now a developer!"
  3. Go back to Settings => System and enter a new section titled “Developer options” at the bottom of the page
  4. Scroll down, and check the “Android debugging” or “USB debugging” entry under “Debugging”
  5. While on this page, make sure to also enable "Wireless Debugging". It will be useful later to permit executing ADB commands right on the phone via an app, without the need to connect it to the computer via USB after each reboot

Now you can decide how to issue ADB commands:

  1. Connect the phone to a computer and issue the command via ADB (classic, "tethered" option)
  2. Set up ADB on the phone itself and send commands via an app. This way you'll never have to connect the device to a computer to disable idle mode ever again (recommended, "untethered" option)

Disable Device Idle Modes Using ADB on a Computer

I'll explain how to do this on Windows as the most popular OS. If you have MacOS, you're probably using an iPhone anyway. And if you are a Linux user, you're smart enough to figure it out from here.

  1. Download ADB for Windows zip from Google and unpack it into some directory. For MacOS and Linux – refer to the "Installing adb and fastboot" section in this article
  2. Download USB Drivers – see the "Download the Google USB Driver ZIP file (ZIP)" option. Unpack somewhere. Then navigate to the folder with the files, right click on the "android_winusb.ini" file and Choose "Install"
  3. Navigate to the folder with the previously unpacked adb.exe, hold shift and right click anywhere in the window. Select either the "Start Command Prompt" or the "Start Windows Power Shell" option, whichever is available on your machine
  4. Connect the phone to the computer, unlock the phone and in a pop-up confirm that "this computer can be trusted for debugging"
  5. Back to the computer: in the console window type:
adb shell dumpsys deviceidle disable

You should receive confirmation that both power-saving modes are disabled:

idle-modes-disabled-via-adb-on-pc

Done!

Until next reboot that is…

Disable Device Idle Modes Using the ADB Shell mobile app

Obviously, using a computer to repeat this procedure every time the phone is rebooted is inconvenient. Here's where Wireless Debugging you enabled previously comes in!

  1. Connect the phone to any WiFi network
  2. Follow this article to install the app and set up wireless debugging: How to Run ADB Commands on Android Without a Computer. Before you ask – yes, making use of the split screen app display mode is necessary
  3. After successfully pairing the ADB Shell app with the phone, enter the "Local Shell" section of the app and input the same command as when using ADB on a computer. Press Send on your on-screen keyboard or use the ⏎ button:
adb shell dumpsys deviceidle disable

You should receive confirmation that both power-saving modes are disabled:

adb-shell-on-pixel-phone-disable-idle-modes

Done!

Now even after rebooting the phone it will take just a couple moments to re-apply the fix! The only two things you'd need to do before running the app would be:

  1. Connect to a WiFi network
  2. Re-enable wireless debugging in Settings if it switched off since last reboot

If It Works, It Works

There you have it. A vital fix for Google Pixel phones to allow for reliable push notifications.

Sure, it only lasts until the next reboot. But that's still a million times better than having notifications that hardly work at all, right? Now you should begin receiving notifications from Gmail and instant messaging apps as soon as new messages arrive. No matter how long your phone has been sitting idle.

I have just one question…

What the Hell, Google!?

Why, in the year 2024, in your latest and greatest Android 14, on a phone made by your company, do we have to go through the hokey pokey and come up with workarounds for bugs that should have been fixed long ago?

I compared the phone's battery life with and without the fix and didn't see a significant difference. Idle mode on your Android phones is broken. It has been broken for years! Either fix it for good or at least allow the options in the Settings app to actually make a damn difference and not be the placebo switches they are in Android 14!

If it weren't for the excellent cameras and camera software, I would definitely have gone with another smartphone manufacturer. But for about $300, there aren't many alternatives that offer both a powerful, non-bloated Android OS and amazing imaging capabilities for both still and video capture.

So I guess this will have to do for now.

P.S. Just to be thorough and to confirm that this workaround is suitable (read: required) for the older Pixel models based on a variant of the Tensor SoC, I went through the same procedure, but on my Pixel 4a running Android 11. And what do you know – Telegram messenger started actually receiving messages with the phone left idle for any length of time, which was never the case on this unit! So I encourage you to try this on your Pixel: it's a safe and effective solution to the problem of missing notifications on all Tensor-based Google Pixel phones.

Hope this helps!