How to differentiate between the device entering a Doze maintenance window and coming out of Doze
问题 I have a method which periodically runs to keep a network connection alive. During Doze mode, I would like to disable it from running periodically and run exactly once during a maintenance window. When the device comes out of Doze, I would like the method to be called periodically again. How can I accomplish this ? I have registered a receiver that listens for the PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED broadcast and then calls PowerManager.isDeviceIdleMode() . However, this return false