session-android/src/org/thoughtcrime/securesms/util/PowerManagerCompat.java
Greyson Parrelli 1b736e9e04 Ensure notifications are processed after receiving GCM message.
It's unreliable to run these tasks on WorkManager, as there's no
scheduling guarantees.
2018-10-08 10:00:15 -07:00

16 lines
372 B
Java

package org.thoughtcrime.securesms.util;
import android.os.Build;
import android.os.PowerManager;
import android.support.annotation.NonNull;
public class PowerManagerCompat {
public static boolean isDeviceIdleMode(@NonNull PowerManager powerManager) {
if (Build.VERSION.SDK_INT >= 23) {
return powerManager.isDeviceIdleMode();
}
return false;
}
}