session-android/src/org/thoughtcrime/securesms/util/PowerManagerCompat.java
2020-08-19 10:06:26 +10:00

16 lines
365 B
Java

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