Loading services/core/java/com/android/server/display/ColorDisplayService.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -115,6 +115,7 @@ public final class ColorDisplayService extends SystemService { private static final int MSG_APPLY_NIGHT_DISPLAY_IMMEDIATE = 0; private static final int MSG_APPLY_NIGHT_DISPLAY_IMMEDIATE = 0; private static final int MSG_APPLY_NIGHT_DISPLAY_ANIMATED = 1; private static final int MSG_APPLY_NIGHT_DISPLAY_ANIMATED = 1; private static final int MSG_APPLY_GLOBAL_SATURATION = 2; private static final int MSG_APPLY_GLOBAL_SATURATION = 2; private static final int MSG_APPLY_DISPLAY_WHITE_BALANCE = 3; /** /** * Return value if a setting has not been set. * Return value if a setting has not been set. Loading Loading @@ -870,7 +871,7 @@ public final class ColorDisplayService extends SystemService { // If disabled, clear the tint. If enabled, do nothing more here and let the next // If disabled, clear the tint. If enabled, do nothing more here and let the next // temperature update set the correct tint. // temperature update set the correct tint. if (!activated) { if (!activated) { applyTint(mDisplayWhiteBalanceTintController, false); mHandler.sendEmptyMessage(MSG_APPLY_DISPLAY_WHITE_BALANCE); } } } } Loading Loading @@ -1542,7 +1543,7 @@ public final class ColorDisplayService extends SystemService { mDisplayWhiteBalanceTintController.setMatrix(cct); mDisplayWhiteBalanceTintController.setMatrix(cct); if (mDisplayWhiteBalanceTintController.isActivated()) { if (mDisplayWhiteBalanceTintController.isActivated()) { applyTint(mDisplayWhiteBalanceTintController, false); mHandler.sendEmptyMessage(MSG_APPLY_DISPLAY_WHITE_BALANCE); return true; return true; } } return false; return false; Loading Loading @@ -1602,6 +1603,9 @@ public final class ColorDisplayService extends SystemService { case MSG_APPLY_NIGHT_DISPLAY_ANIMATED: case MSG_APPLY_NIGHT_DISPLAY_ANIMATED: applyTint(mNightDisplayTintController, false); applyTint(mNightDisplayTintController, false); break; break; case MSG_APPLY_DISPLAY_WHITE_BALANCE: applyTint(mDisplayWhiteBalanceTintController, false); break; } } } } } } Loading services/core/java/com/android/server/display/DisplayTransformManager.java +16 −25 Original line number Original line Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class DisplayTransformManager { * Map of level -> color transformation matrix. * Map of level -> color transformation matrix. */ */ @GuardedBy("mColorMatrix") @GuardedBy("mColorMatrix") private final SparseArray<float[]> mColorMatrix = new SparseArray<>(3); private final SparseArray<float[]> mColorMatrix = new SparseArray<>(5); /** /** * Temporary matrix used internally by {@link #computeColorMatrixLocked()}. * Temporary matrix used internally by {@link #computeColorMatrixLocked()}. */ */ Loading Loading @@ -147,6 +147,21 @@ public class DisplayTransformManager { } } } } /** * Sets the current Daltonization mode. This adjusts the color space to correct for or simulate * various types of color blindness. * * @param mode the new Daltonization mode, or -1 to disable */ public void setDaltonizerMode(int mode) { synchronized (mDaltonizerModeLock) { if (mDaltonizerMode != mode) { mDaltonizerMode = mode; applyDaltonizerMode(mode); } } } /** /** * Returns the composition of all current color matrices, or {@code null} if there are none. * Returns the composition of all current color matrices, or {@code null} if there are none. */ */ Loading @@ -166,30 +181,6 @@ public class DisplayTransformManager { return result[count % 2]; return result[count % 2]; } } /** * Returns the current Daltonization mode. */ public int getDaltonizerMode() { synchronized (mDaltonizerModeLock) { return mDaltonizerMode; } } /** * Sets the current Daltonization mode. This adjusts the color space to correct for or simulate * various types of color blindness. * * @param mode the new Daltonization mode, or -1 to disable */ public void setDaltonizerMode(int mode) { synchronized (mDaltonizerModeLock) { if (mDaltonizerMode != mode) { mDaltonizerMode = mode; applyDaltonizerMode(mode); } } } /** /** * Propagates the provided color transformation matrix to the SurfaceFlinger. * Propagates the provided color transformation matrix to the SurfaceFlinger. */ */ Loading Loading
services/core/java/com/android/server/display/ColorDisplayService.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -115,6 +115,7 @@ public final class ColorDisplayService extends SystemService { private static final int MSG_APPLY_NIGHT_DISPLAY_IMMEDIATE = 0; private static final int MSG_APPLY_NIGHT_DISPLAY_IMMEDIATE = 0; private static final int MSG_APPLY_NIGHT_DISPLAY_ANIMATED = 1; private static final int MSG_APPLY_NIGHT_DISPLAY_ANIMATED = 1; private static final int MSG_APPLY_GLOBAL_SATURATION = 2; private static final int MSG_APPLY_GLOBAL_SATURATION = 2; private static final int MSG_APPLY_DISPLAY_WHITE_BALANCE = 3; /** /** * Return value if a setting has not been set. * Return value if a setting has not been set. Loading Loading @@ -870,7 +871,7 @@ public final class ColorDisplayService extends SystemService { // If disabled, clear the tint. If enabled, do nothing more here and let the next // If disabled, clear the tint. If enabled, do nothing more here and let the next // temperature update set the correct tint. // temperature update set the correct tint. if (!activated) { if (!activated) { applyTint(mDisplayWhiteBalanceTintController, false); mHandler.sendEmptyMessage(MSG_APPLY_DISPLAY_WHITE_BALANCE); } } } } Loading Loading @@ -1542,7 +1543,7 @@ public final class ColorDisplayService extends SystemService { mDisplayWhiteBalanceTintController.setMatrix(cct); mDisplayWhiteBalanceTintController.setMatrix(cct); if (mDisplayWhiteBalanceTintController.isActivated()) { if (mDisplayWhiteBalanceTintController.isActivated()) { applyTint(mDisplayWhiteBalanceTintController, false); mHandler.sendEmptyMessage(MSG_APPLY_DISPLAY_WHITE_BALANCE); return true; return true; } } return false; return false; Loading Loading @@ -1602,6 +1603,9 @@ public final class ColorDisplayService extends SystemService { case MSG_APPLY_NIGHT_DISPLAY_ANIMATED: case MSG_APPLY_NIGHT_DISPLAY_ANIMATED: applyTint(mNightDisplayTintController, false); applyTint(mNightDisplayTintController, false); break; break; case MSG_APPLY_DISPLAY_WHITE_BALANCE: applyTint(mDisplayWhiteBalanceTintController, false); break; } } } } } } Loading
services/core/java/com/android/server/display/DisplayTransformManager.java +16 −25 Original line number Original line Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class DisplayTransformManager { * Map of level -> color transformation matrix. * Map of level -> color transformation matrix. */ */ @GuardedBy("mColorMatrix") @GuardedBy("mColorMatrix") private final SparseArray<float[]> mColorMatrix = new SparseArray<>(3); private final SparseArray<float[]> mColorMatrix = new SparseArray<>(5); /** /** * Temporary matrix used internally by {@link #computeColorMatrixLocked()}. * Temporary matrix used internally by {@link #computeColorMatrixLocked()}. */ */ Loading Loading @@ -147,6 +147,21 @@ public class DisplayTransformManager { } } } } /** * Sets the current Daltonization mode. This adjusts the color space to correct for or simulate * various types of color blindness. * * @param mode the new Daltonization mode, or -1 to disable */ public void setDaltonizerMode(int mode) { synchronized (mDaltonizerModeLock) { if (mDaltonizerMode != mode) { mDaltonizerMode = mode; applyDaltonizerMode(mode); } } } /** /** * Returns the composition of all current color matrices, or {@code null} if there are none. * Returns the composition of all current color matrices, or {@code null} if there are none. */ */ Loading @@ -166,30 +181,6 @@ public class DisplayTransformManager { return result[count % 2]; return result[count % 2]; } } /** * Returns the current Daltonization mode. */ public int getDaltonizerMode() { synchronized (mDaltonizerModeLock) { return mDaltonizerMode; } } /** * Sets the current Daltonization mode. This adjusts the color space to correct for or simulate * various types of color blindness. * * @param mode the new Daltonization mode, or -1 to disable */ public void setDaltonizerMode(int mode) { synchronized (mDaltonizerModeLock) { if (mDaltonizerMode != mode) { mDaltonizerMode = mode; applyDaltonizerMode(mode); } } } /** /** * Propagates the provided color transformation matrix to the SurfaceFlinger. * Propagates the provided color transformation matrix to the SurfaceFlinger. */ */ Loading