Android examples for Hardware:Battery
Check whether the battery optimization settings available in the current OS version
//package com.java2s; import android.os.Build; public class Main { /**// w w w . ja v a 2s . c o m * Check whether the battery optimization settings available in the current OS version * * @return */ public static boolean isBatteryOptimizationSettingsAvailable() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M; } }