Loading packages/SystemUI/res/values/config.xml +3 −0 Original line number Original line Diff line number Diff line Loading @@ -273,6 +273,9 @@ <!-- Doze: the brightness value to use for the higher brightness AOD mode --> <!-- Doze: the brightness value to use for the higher brightness AOD mode --> <integer name="config_doze_aod_brightness_high">27</integer> <integer name="config_doze_aod_brightness_high">27</integer> <!-- Doze: the brightness value to use for the sunlight AOD mode --> <integer name="config_doze_aod_brightness_sunlight">28</integer> <!-- Doze: whether the double tap sensor reports 2D touch coordinates --> <!-- Doze: whether the double tap sensor reports 2D touch coordinates --> <bool name="doze_double_tap_reports_touch_coordinates">false</bool> <bool name="doze_double_tap_reports_touch_coordinates">false</bool> Loading packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java +9 −3 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen private final int mHighBrightness; private final int mHighBrightness; private final int mLowBrightness; private final int mLowBrightness; private final int mSunlightBrightness; public DozeScreenBrightness(Context context, DozeMachine.Service service, public DozeScreenBrightness(Context context, DozeMachine.Service service, SensorManager sensorManager, Sensor lightSensor, Handler handler) { SensorManager sensorManager, Sensor lightSensor, Handler handler) { Loading @@ -52,6 +53,8 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen R.integer.config_doze_aod_brightness_low); R.integer.config_doze_aod_brightness_low); mHighBrightness = context.getResources().getInteger( mHighBrightness = context.getResources().getInteger( R.integer.config_doze_aod_brightness_high); R.integer.config_doze_aod_brightness_high); mSunlightBrightness = context.getResources().getInteger( R.integer.config_doze_aod_brightness_sunlight); } } @Override @Override Loading Loading @@ -83,9 +86,12 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen } } private int computeBrightness(int sensorValue) { private int computeBrightness(int sensorValue) { // The sensor reports 0 for off, 1 for low brightness and 2 for high brightness. // The sensor reports 0 for off, 1 for low brightness, 2 for high brightness, and 3 for // We currently use DozeScreenState for screen off, so we treat off as low brightness. // sunlight. We currently use DozeScreenState for screen off, so we treat off as low if (sensorValue >= 2) { // brightness. if (sensorValue >= 3) { return mSunlightBrightness; } else if (sensorValue == 2) { return mHighBrightness; return mHighBrightness; } else { } else { return mLowBrightness; return mLowBrightness; Loading Loading
packages/SystemUI/res/values/config.xml +3 −0 Original line number Original line Diff line number Diff line Loading @@ -273,6 +273,9 @@ <!-- Doze: the brightness value to use for the higher brightness AOD mode --> <!-- Doze: the brightness value to use for the higher brightness AOD mode --> <integer name="config_doze_aod_brightness_high">27</integer> <integer name="config_doze_aod_brightness_high">27</integer> <!-- Doze: the brightness value to use for the sunlight AOD mode --> <integer name="config_doze_aod_brightness_sunlight">28</integer> <!-- Doze: whether the double tap sensor reports 2D touch coordinates --> <!-- Doze: whether the double tap sensor reports 2D touch coordinates --> <bool name="doze_double_tap_reports_touch_coordinates">false</bool> <bool name="doze_double_tap_reports_touch_coordinates">false</bool> Loading
packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java +9 −3 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen private final int mHighBrightness; private final int mHighBrightness; private final int mLowBrightness; private final int mLowBrightness; private final int mSunlightBrightness; public DozeScreenBrightness(Context context, DozeMachine.Service service, public DozeScreenBrightness(Context context, DozeMachine.Service service, SensorManager sensorManager, Sensor lightSensor, Handler handler) { SensorManager sensorManager, Sensor lightSensor, Handler handler) { Loading @@ -52,6 +53,8 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen R.integer.config_doze_aod_brightness_low); R.integer.config_doze_aod_brightness_low); mHighBrightness = context.getResources().getInteger( mHighBrightness = context.getResources().getInteger( R.integer.config_doze_aod_brightness_high); R.integer.config_doze_aod_brightness_high); mSunlightBrightness = context.getResources().getInteger( R.integer.config_doze_aod_brightness_sunlight); } } @Override @Override Loading Loading @@ -83,9 +86,12 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen } } private int computeBrightness(int sensorValue) { private int computeBrightness(int sensorValue) { // The sensor reports 0 for off, 1 for low brightness and 2 for high brightness. // The sensor reports 0 for off, 1 for low brightness, 2 for high brightness, and 3 for // We currently use DozeScreenState for screen off, so we treat off as low brightness. // sunlight. We currently use DozeScreenState for screen off, so we treat off as low if (sensorValue >= 2) { // brightness. if (sensorValue >= 3) { return mSunlightBrightness; } else if (sensorValue == 2) { return mHighBrightness; return mHighBrightness; } else { } else { return mLowBrightness; return mLowBrightness; Loading