mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 19:15:16 +00:00
1b736e9e04
It's unreliable to run these tasks on WorkManager, as there's no scheduling guarantees.
16 lines
372 B
Java
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;
|
|
}
|
|
}
|