밝기 설정하는 범위가 0~255 잖아요
근데 255로 설정하면 100% 로 잘 설정되는데
128로 적용하면 50% 가 되어야 할것같은데 48% 입니다.
1% 로 적용하고 싶어서 2.55로 설정하면 .. 실제론 0% 가 되어 버리네요
100:256=50:x
x=128 이잖아요... ㅠ
뭘 잘못 했을까요.. ㅠㅠ
private void setScreenBrightness(Activity mContext, int environmentScreenBrightness){
Double environmentScreenBrightnessValue = environmentScreenBrightness*2.55;
environmentScreenBrightness=(int)Math.ceil(environmentScreenBrightnessValue);
Settings.System.putInt(mContext.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
Settings.System.putInt(mContext.getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS, environmentScreenBrightness);//0~255
}