is Battery Optimization Settings Available - Android android.os

Android examples for android.os:Battery

Description

is Battery Optimization Settings Available

Demo Code

import android.os.Build;

public class Main {

  /**// ww w . j  av a2  s.  com
   * 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;
  }

}

Related Tutorials