Skip to content

Instantly share code, notes, and snippets.

@clexanis
Last active October 13, 2021 11:44
Show Gist options
  • Save clexanis/3db25180640a1d268a1b24955266cb49 to your computer and use it in GitHub Desktop.
Save clexanis/3db25180640a1d268a1b24955266cb49 to your computer and use it in GitHub Desktop.
Instant notification with Gmail in Android

Instant notification with Gmail in Android.

Since the addition of "doze" on recent versions of Android, notifications of new messages from Gmail can have a delay (from several minutes to a few hours). More here. Since Android 10, it is possible to add gmail to the white-list of "doze", without this setting being forgotten at each startup.

Connect to device.

Verify that you are connected to your device with adb by using the following command:

adb devices

NOTE: If adb replies that you are not authorized, you must authorize the connection from your Android device.

Whitelist Gmail.

Add gmail to the whitelist with the following command:

adb shell dumpsys deviceidle whitelist +com.google.android.gm

Verify whitelisted applications.

You can check the applications in the white list with the following command:

adb shell dumpsys deviceidle whitelist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment