Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18ac4e25 authored by Christine Franks's avatar Christine Franks
Browse files

Add config for display white balance default state

Bug: 123930917
Test: manual

Change-Id: Ie0ec627197df6443ff4ea1c82855e97467273ff0
parent 9dfc48d0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1031,6 +1031,9 @@
    <!-- Boolean indicating whether display white balance is supported. -->
    <bool name="config_displayWhiteBalanceAvailable">false</bool>

    <!-- Boolean indicating whether display white balance should be enabled by default. -->
    <bool name="config_displayWhiteBalanceEnabledDefault">false</bool>

    <!-- Minimum color temperature, in Kelvin, supported by display white balance. -->
    <integer name="config_displayWhiteBalanceColorTemperatureMin">4000</integer>

+1 −2
Original line number Diff line number Diff line
@@ -3147,7 +3147,6 @@

  <java-symbol type="bool" name="config_setColorTransformAccelerated" />
  <java-symbol type="bool" name="config_setColorTransformAcceleratedPerLayer" />
  <java-symbol type="bool" name="config_displayWhiteBalanceAvailable" />
  <java-symbol type="bool" name="config_nightDisplayAvailable" />
  <java-symbol type="bool" name="config_allowDisablingAssistDisclosure" />
  <java-symbol type="integer" name="config_defaultNightDisplayAutoMode" />
@@ -3159,8 +3158,8 @@
  <java-symbol type="array" name="config_nightDisplayColorTemperatureCoefficients" />
  <java-symbol type="array" name="config_nightDisplayColorTemperatureCoefficientsNative" />
  <java-symbol type="array" name="config_availableColorModes" />

  <java-symbol type="bool" name="config_displayWhiteBalanceAvailable" />
  <java-symbol type="bool" name="config_displayWhiteBalanceEnabledDefault" />
  <java-symbol type="integer" name="config_displayWhiteBalanceColorTemperatureMin" />
  <java-symbol type="integer" name="config_displayWhiteBalanceColorTemperatureMax" />
  <java-symbol type="integer" name="config_displayWhiteBalanceColorTemperatureDefault" />
+8 −2
Original line number Diff line number Diff line
@@ -461,7 +461,9 @@ public final class ColorDisplayService extends SystemService {
                    .setMatrix(mNightDisplayTintController.getColorTemperatureSetting());
        }

        if (mDisplayWhiteBalanceTintController.isAvailable(getContext())) {
            updateDisplayWhiteBalanceStatus();
        }

        final DisplayTransformManager dtm = getLocalService(DisplayTransformManager.class);
        dtm.setColorMode(mode, mNightDisplayTintController.getMatrix());
@@ -624,7 +626,11 @@ public final class ColorDisplayService extends SystemService {
            return false;
        }
        return Secure.getIntForUser(getContext().getContentResolver(),
                Secure.DISPLAY_WHITE_BALANCE_ENABLED, 0, mCurrentUser) == 1;
                Secure.DISPLAY_WHITE_BALANCE_ENABLED,
                getContext().getResources()
                        .getBoolean(R.bool.config_displayWhiteBalanceEnabledDefault) ? 1
                        : 0,
                mCurrentUser) == 1;
    }

    private boolean isDeviceColorManagedInternal() {