is Screen Brightness Mode Auto - Android android.provider

Android examples for android.provider:Settings

Description

is Screen Brightness Mode Auto

Demo Code

import android.content.Context;
import android.provider.Settings;

public class Main {

  public static boolean isScreenBrightnessModeAuto(Context context) {
    return getScreenBrightnessModeState(context) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC ? true : false;
  }/*from w w  w  .  j a va2  s  .c om*/

  public static int getScreenBrightnessModeState(Context context) {
    return Settings.System.getInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE,
        Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
  }

}

Related Tutorials