Loading core/java/android/hardware/display/DisplayManagerInternal.java +17 −0 Original line number Diff line number Diff line Loading @@ -751,6 +751,23 @@ public abstract class DisplayManagerInternal { */ boolean blockScreenOn(Runnable unblocker); /** * Get the brightness levels used to determine automatic brightness based on lux levels. * @param mode The auto-brightness mode * (AutomaticBrightnessController.AutomaticBrightnessMode) * @return The brightness levels for the specified mode. The values are between * {@link PowerManager.BRIGHTNESS_MIN} and {@link PowerManager.BRIGHTNESS_MAX}. */ float[] getAutoBrightnessLevels(int mode); /** * Get the lux levels used to determine automatic brightness. * @param mode The auto-brightness mode * (AutomaticBrightnessController.AutomaticBrightnessMode) * @return The lux levels for the specified mode */ float[] getAutoBrightnessLuxLevels(int mode); /** Returns whether displayoffload supports the given display state. */ static boolean isSupportedOffloadState(int displayState) { return Display.isSuspendedState(displayState); Loading services/core/java/com/android/server/display/AutomaticBrightnessController.java +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ public class AutomaticBrightnessController { public static final int AUTO_BRIGHTNESS_MODE_DEFAULT = 0; public static final int AUTO_BRIGHTNESS_MODE_IDLE = 1; public static final int AUTO_BRIGHTNESS_MODE_DOZE = 2; public static final int AUTO_BRIGHTNESS_MODE_MAX = AUTO_BRIGHTNESS_MODE_DOZE; // How long the current sensor reading is assumed to be valid beyond the current time. // This provides a bit of prediction, as well as ensures that the weight for the last sample is Loading services/core/java/com/android/server/display/DisplayOffloadSessionImpl.java +18 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.display; import static com.android.server.display.AutomaticBrightnessController.AUTO_BRIGHTNESS_MODE_MAX; import android.annotation.Nullable; import android.hardware.display.DisplayManagerInternal; import android.os.PowerManager; Loading Loading @@ -65,6 +67,22 @@ public class DisplayOffloadSessionImpl implements DisplayManagerInternal.Display return true; } @Override public float[] getAutoBrightnessLevels(int mode) { if (mode < 0 || mode > AUTO_BRIGHTNESS_MODE_MAX) { throw new IllegalArgumentException("Unknown auto-brightness mode: " + mode); } return mDisplayPowerController.getAutoBrightnessLevels(mode); } @Override public float[] getAutoBrightnessLuxLevels(int mode) { if (mode < 0 || mode > AUTO_BRIGHTNESS_MODE_MAX) { throw new IllegalArgumentException("Unknown auto-brightness mode: " + mode); } return mDisplayPowerController.getAutoBrightnessLuxLevels(mode); } /** * Start the offload session. The method returns if the session is already active. * @return Whether the session was started successfully Loading services/core/java/com/android/server/display/DisplayPowerController.java +14 −0 Original line number Diff line number Diff line Loading @@ -2213,6 +2213,20 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call // The old DPC is no longer supported } @Override public float[] getAutoBrightnessLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { // The old DPC is no longer supported return null; } @Override public float[] getAutoBrightnessLuxLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { // The old DPC is no longer supported return null; } @Override public BrightnessInfo getBrightnessInfo() { synchronized (mCachedBrightnessInfo) { Loading services/core/java/com/android/server/display/DisplayPowerController2.java +18 −0 Original line number Diff line number Diff line Loading @@ -1885,6 +1885,24 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal mHandler.sendMessageAtTime(msg, mClock.uptimeMillis()); } @Override public float[] getAutoBrightnessLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { int preset = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_FOR_ALS, Settings.System.SCREEN_BRIGHTNESS_AUTOMATIC_NORMAL, UserHandle.USER_CURRENT); return mDisplayDeviceConfig.getAutoBrightnessBrighteningLevels(mode, preset); } @Override public float[] getAutoBrightnessLuxLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { int preset = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_FOR_ALS, Settings.System.SCREEN_BRIGHTNESS_AUTOMATIC_NORMAL, UserHandle.USER_CURRENT); return mDisplayDeviceConfig.getAutoBrightnessBrighteningLevelsLux(mode, preset); } @Override public BrightnessInfo getBrightnessInfo() { synchronized (mCachedBrightnessInfo) { Loading Loading
core/java/android/hardware/display/DisplayManagerInternal.java +17 −0 Original line number Diff line number Diff line Loading @@ -751,6 +751,23 @@ public abstract class DisplayManagerInternal { */ boolean blockScreenOn(Runnable unblocker); /** * Get the brightness levels used to determine automatic brightness based on lux levels. * @param mode The auto-brightness mode * (AutomaticBrightnessController.AutomaticBrightnessMode) * @return The brightness levels for the specified mode. The values are between * {@link PowerManager.BRIGHTNESS_MIN} and {@link PowerManager.BRIGHTNESS_MAX}. */ float[] getAutoBrightnessLevels(int mode); /** * Get the lux levels used to determine automatic brightness. * @param mode The auto-brightness mode * (AutomaticBrightnessController.AutomaticBrightnessMode) * @return The lux levels for the specified mode */ float[] getAutoBrightnessLuxLevels(int mode); /** Returns whether displayoffload supports the given display state. */ static boolean isSupportedOffloadState(int displayState) { return Display.isSuspendedState(displayState); Loading
services/core/java/com/android/server/display/AutomaticBrightnessController.java +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ public class AutomaticBrightnessController { public static final int AUTO_BRIGHTNESS_MODE_DEFAULT = 0; public static final int AUTO_BRIGHTNESS_MODE_IDLE = 1; public static final int AUTO_BRIGHTNESS_MODE_DOZE = 2; public static final int AUTO_BRIGHTNESS_MODE_MAX = AUTO_BRIGHTNESS_MODE_DOZE; // How long the current sensor reading is assumed to be valid beyond the current time. // This provides a bit of prediction, as well as ensures that the weight for the last sample is Loading
services/core/java/com/android/server/display/DisplayOffloadSessionImpl.java +18 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.display; import static com.android.server.display.AutomaticBrightnessController.AUTO_BRIGHTNESS_MODE_MAX; import android.annotation.Nullable; import android.hardware.display.DisplayManagerInternal; import android.os.PowerManager; Loading Loading @@ -65,6 +67,22 @@ public class DisplayOffloadSessionImpl implements DisplayManagerInternal.Display return true; } @Override public float[] getAutoBrightnessLevels(int mode) { if (mode < 0 || mode > AUTO_BRIGHTNESS_MODE_MAX) { throw new IllegalArgumentException("Unknown auto-brightness mode: " + mode); } return mDisplayPowerController.getAutoBrightnessLevels(mode); } @Override public float[] getAutoBrightnessLuxLevels(int mode) { if (mode < 0 || mode > AUTO_BRIGHTNESS_MODE_MAX) { throw new IllegalArgumentException("Unknown auto-brightness mode: " + mode); } return mDisplayPowerController.getAutoBrightnessLuxLevels(mode); } /** * Start the offload session. The method returns if the session is already active. * @return Whether the session was started successfully Loading
services/core/java/com/android/server/display/DisplayPowerController.java +14 −0 Original line number Diff line number Diff line Loading @@ -2213,6 +2213,20 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call // The old DPC is no longer supported } @Override public float[] getAutoBrightnessLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { // The old DPC is no longer supported return null; } @Override public float[] getAutoBrightnessLuxLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { // The old DPC is no longer supported return null; } @Override public BrightnessInfo getBrightnessInfo() { synchronized (mCachedBrightnessInfo) { Loading
services/core/java/com/android/server/display/DisplayPowerController2.java +18 −0 Original line number Diff line number Diff line Loading @@ -1885,6 +1885,24 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal mHandler.sendMessageAtTime(msg, mClock.uptimeMillis()); } @Override public float[] getAutoBrightnessLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { int preset = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_FOR_ALS, Settings.System.SCREEN_BRIGHTNESS_AUTOMATIC_NORMAL, UserHandle.USER_CURRENT); return mDisplayDeviceConfig.getAutoBrightnessBrighteningLevels(mode, preset); } @Override public float[] getAutoBrightnessLuxLevels( @AutomaticBrightnessController.AutomaticBrightnessMode int mode) { int preset = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_FOR_ALS, Settings.System.SCREEN_BRIGHTNESS_AUTOMATIC_NORMAL, UserHandle.USER_CURRENT); return mDisplayDeviceConfig.getAutoBrightnessBrighteningLevelsLux(mode, preset); } @Override public BrightnessInfo getBrightnessInfo() { synchronized (mCachedBrightnessInfo) { Loading