This is a general question about how to ensure that GCM push notifications wake up the device (i.e. unlock the screen, and turn the screen on) so that we can render a custom view and make the phone vibrate and ring. We have been using GCM notifications this way successfully in our application, but after a certain period of time (~10 minutes), the phone will no longer respond to the notifications. After this 10 minute threshold, the user needs to manually unlock their device to in order to initiate the expected behavior (starting an activity that renders a custom view, turns on the ringtone, and vibrates).
We tried turning off battery optimizations on the device and starting a foreground service that implements a partial wake lock. In addition, we have tried using FLAG_SHOW_WHEN_LOCKED, FLAG_KEEP_SCREEN_ON, and FLAG_TURN_SCREEN_ON to make sure the app can bypass the lock screen. All of those efforts have not enabled us to wake up the device after it appears to go into a deep sleep mode at about 10 minutes of idle time.
Can you please inform me of how to circumvent this limit in how long the phone can respond to notifications? The issue appears to be Android version and device/manufacturer agnostic. We have tested on Pixel XL, Pixel 3 XL, Samsung Galaxy S9, Samsung Galaxy S8, and various other devices, all with similar results.
It seems like after a certain point of sleep/idle/locked time, the phone can no longer respond to notifications that attempt to wake up the device, unlock the screen, and turn the screen on. Is there a way around this?