Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +12 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,8 @@ public class PhoneStatusBar extends StatusBar { private static final boolean CLOSE_PANEL_WHEN_EMPTIED = true; private static final float BRIGHTNESS_CONTROL_PADDING = 0.15f; private boolean mShowClock; private boolean mBrightnessControl; private boolean mAutoBrightness; Loading Loading @@ -1594,7 +1596,16 @@ public class PhoneStatusBar extends StatusBar { if (yVel < 50.0f) { if (mLinger > 20) { float x = (float) event.getRawX(); int newBrightness = (int) Math.round(((x / mScreenWidth) * android.os.Power.BRIGHTNESS_ON)); float raw = (x / mScreenWidth); // Add a padding to the brightness control on both sides to make it easier // to reach min/max brightness float padded = Math.min(1.0f - BRIGHTNESS_CONTROL_PADDING, Math.max(BRIGHTNESS_CONTROL_PADDING, raw)); float value = (padded - BRIGHTNESS_CONTROL_PADDING) / (1 - (2.0f * BRIGHTNESS_CONTROL_PADDING)); int newBrightness = mMinBrightness + (int) Math.round(value * (android.os.Power.BRIGHTNESS_ON - mMinBrightness)); newBrightness = Math.min(newBrightness, android.os.Power.BRIGHTNESS_ON); newBrightness = Math.max(newBrightness, mMinBrightness); try { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +12 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,8 @@ public class PhoneStatusBar extends StatusBar { private static final boolean CLOSE_PANEL_WHEN_EMPTIED = true; private static final float BRIGHTNESS_CONTROL_PADDING = 0.15f; private boolean mShowClock; private boolean mBrightnessControl; private boolean mAutoBrightness; Loading Loading @@ -1594,7 +1596,16 @@ public class PhoneStatusBar extends StatusBar { if (yVel < 50.0f) { if (mLinger > 20) { float x = (float) event.getRawX(); int newBrightness = (int) Math.round(((x / mScreenWidth) * android.os.Power.BRIGHTNESS_ON)); float raw = (x / mScreenWidth); // Add a padding to the brightness control on both sides to make it easier // to reach min/max brightness float padded = Math.min(1.0f - BRIGHTNESS_CONTROL_PADDING, Math.max(BRIGHTNESS_CONTROL_PADDING, raw)); float value = (padded - BRIGHTNESS_CONTROL_PADDING) / (1 - (2.0f * BRIGHTNESS_CONTROL_PADDING)); int newBrightness = mMinBrightness + (int) Math.round(value * (android.os.Power.BRIGHTNESS_ON - mMinBrightness)); newBrightness = Math.min(newBrightness, android.os.Power.BRIGHTNESS_ON); newBrightness = Math.max(newBrightness, mMinBrightness); try { Loading