rosemary: overlay: Kang auto brightness configuration from 'guacamole'

* Taken from https://github.com/LineageOS/android_device_oneplus_guacamole/blob/lineage-18.1/overlay/frameworks/base/core/res/res/values/config.xml
  as of dc41338b60372c97e7468c0b71db198638efba32.

Signed-off-by: bengris32 <bengris32@protonmail.ch>
Change-Id: Id24900fb0ebe4d27e7a1c8ac57a2a40d270c35e2
This commit is contained in:
bengris32
2023-02-14 12:35:55 +01:00
committed by Matsvei Niaverau
parent c9468c758d
commit 833253fe63

View File

@@ -95,154 +95,16 @@
when adapting to brighter or darker environments. This parameter controls how quickly
brightness changes occur in response to an observed change in light level that exceeds the
hysteresis threshold. -->
<integer name="config_autoBrightnessBrighteningLightDebounce">1000</integer>
<integer name="config_autoBrightnessDarkeningLightDebounce">1000</integer>
<integer name="config_autoBrightnessBrighteningLightDebounce">2000</integer>
<integer name="config_autoBrightnessDarkeningLightDebounce">4000</integer>
<!-- Array of hysteresis constraint values for brightening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_ambientThresholdLevels. The brightening threshold is calculated as
lux * (1.0f + CONSTRAINT_VALUE). When the current lux is higher than this threshold,
the screen brightness is recalculated. See the config_ambientThresholdLevels
description for how the constraint value is chosen. -->
<integer-array name="config_ambientBrighteningThresholds">
<item>2</item>
<item>5</item>
<item>10</item>
<item>30</item>
<item>100</item>
<item>400</item>
<item>600</item>
<item>1000</item>
</integer-array>
<!-- Amount of time it takes for the light sensor to warm up in milliseconds.
For this time after the screen turns on, the Power Manager
will not debounce light sensor readings -->
<integer name="config_lightSensorWarmupTime">200</integer>
<!-- Array of hysteresis constraint values for darkening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_ambientThresholdLevels. The darkening threshold is calculated as
lux * (1.0f - CONSTRAINT_VALUE). When the current lux is lower than this threshold,
the screen brightness is recalculated. See the config_ambientThresholdLevels
description for how the constraint value is chosen. -->
<integer-array name="config_ambientDarkeningThresholds">
<item>800</item>
<item>800</item>
<item>500</item>
<item>500</item>
<item>500</item>
<item>500</item>
<item>500</item>
<item>500</item>
</integer-array>
<!-- Array of ambient lux threshold values. This is used for determining hysteresis constraint
values by calculating the index to use for lookup and then setting the constraint value
to the corresponding value of the array. The new brightening hysteresis constraint value
is the n-th element of config_ambientBrighteningThresholds, and the new darkening
hysteresis constraint value is the n-th element of config_ambientDarkeningThresholds.
The (zero-based) index is calculated as follows: (MAX is the largest index of the array)
condition calculated index
value < level[0] 0
level[n] <= value < level[n+1] n+1
level[MAX] <= value MAX+1 -->
<integer-array name="config_ambientThresholdLevels">
<item>2</item>
<item>10</item>
<item>30</item>
<item>100</item>
<item>800</item>
<item>2000</item>
<item>4000</item>
</integer-array>
<!-- Array of desired screen brightness in nits corresponding to the lux values
in the config_autoBrightnessLevels array. As with config_screenBrightnessMinimumNits and
config_screenBrightnessMaximumNits, the display brightness is defined as the measured
brightness of an all-white image.
If this is defined then:
- config_autoBrightnessLcdBacklightValues should not be defined
- config_screenBrightnessNits must be defined
- config_screenBrightnessBacklight must be defined
This array should have size one greater than the size of the config_autoBrightnessLevels
array. The brightness values must be non-negative and non-decreasing. This must be
overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessDisplayValuesNits">
<item>5</item>
<item>5</item>
<item>6</item>
<item>10</item>
<item>16</item>
<item>20</item>
<item>24</item>
<item>30</item>
<item>35</item>
<item>45</item>
<item>55</item>
<item>70</item>
<item>85</item>
<item>98</item>
<item>98</item>
<item>98</item>
<item>99</item>
<item>100</item>
<item>100</item>
<item>101</item>
<item>103</item>
<item>103</item>
<item>106</item>
<item>108</item>
<item>114</item>
<item>130</item>
<item>150</item>
<item>180</item>
<item>200</item>
<item>250</item>
<item>280</item>
<item>320</item>
<item>350</item>
<item>390</item>
<item>455</item>
</integer-array>
<!-- Array of output values for LCD backlight corresponding to the lux values
in the config_autoBrightnessLevels array. This array should have size one greater
than the size of the config_autoBrightnessLevels array.
The brightness values must be between 0 and 255 and be non-decreasing.
This must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>22</item>
<item>22</item>
<item>28</item>
<item>45</item>
<item>72</item>
<item>88</item>
<item>108</item>
<item>135</item>
<item>158</item>
<item>205</item>
<item>248</item>
<item>318</item>
<item>391</item>
<item>475</item>
<item>475</item>
<item>475</item>
<item>480</item>
<item>485</item>
<item>485</item>
<item>493</item>
<item>503</item>
<item>503</item>
<item>518</item>
<item>526</item>
<item>553</item>
<item>610</item>
<item>700</item>
<item>835</item>
<item>930</item>
<item>1163</item>
<item>1305</item>
<item>1488</item>
<item>1625</item>
<item>1805</item>
<item>2047</item>
</integer-array>
<!-- Fast brightness animation ramp rate in brightness units per second-->
<integer translatable="false" name="config_brightness_ramp_rate_fast">400</integer>
<!-- Array of light sensor lux values to define our levels for auto backlight brightness support.
The N entries of this array define N + 1 control points as follows:
@@ -261,40 +123,281 @@
backlight values for lux levels between these control points.
Must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessLevels">
<item>1</item>
<item>4</item>
<item>12</item>
<item>20</item>
<item>40</item>
<item>65</item>
<item>95</item>
<item>140</item>
<item>200</item>
<item>350</item>
<item>650</item>
<item>1300</item>
<item>2000</item>
<item>3300</item>
<item>6000</item>
</integer-array>
<!-- Array of desired screen brightness in nits corresponding to the lux values
in the config_autoBrightnessLevels array. As with config_screenBrightnessMinimumNits and
config_screenBrightnessMaximumNits, the display brightness is defined as the measured
brightness of an all-white image.
If this is defined then:
- config_autoBrightnessLcdBacklightValues should not be defined
- config_screenBrightnessNits must be defined
- config_screenBrightnessBacklight must be defined
This array should have size one greater than the size of the config_autoBrightnessLevels
array. The brightness values must be non-negative and non-decreasing. This must be
overridden in platform specific overlays -->
<array name="config_autoBrightnessDisplayValuesNits">
<item>2.0487</item>
<item>4.8394</item>
<item>17.2619</item>
<item>39.2619</item>
<item>50.671</item>
<item>92.3019</item>
<item>94.2512</item>
<item>98.37</item>
<item>100.152</item>
<item>105.297</item>
<item>120.385</item>
<item>142.064</item>
<item>226.5179</item>
<item>248.0267</item>
<item>353.2814</item>
<item>427.6287</item>
</array>
<!-- An array of floats describing the screen brightness in nits corresponding to the backlight
values in the config_screenBrightnessBacklight array. On OLED displays these values
should be measured with an all white image while the display is in the fully on state.
Note that this value should *not* reflect the maximum brightness value for any high
brightness modes but only the maximum brightness value obtainable in a sustainable manner.
This array should be equal in size to config_screenBrightnessBacklight -->
<array name="config_screenBrightnessNits">
<item>2.0482</item>
<item>2.543</item>
<item>3.0253</item>
<item>3.5077</item>
<item>4.0824</item>
<item>4.4748</item>
<item>5.08</item>
<item>6.4233</item>
<item>8.0848</item>
<item>11.6607</item>
<item>13.2347</item>
<item>15.0676</item>
<item>16.8302</item>
<item>18.4261</item>
<item>20.3103</item>
<item>21.9042</item>
<item>23.5456</item>
<item>25.2137</item>
<item>27.1769</item>
<item>28.9571</item>
<item>30.5244</item>
<item>32.3535</item>
<item>34.0867</item>
<item>42.366</item>
<item>51.1309</item>
<item>59.52</item>
<item>67.744</item>
<item>75.9738</item>
<item>84.6332</item>
<item>94.1525</item>
<item>102.2207</item>
<item>110.4878</item>
<item>117.0405</item>
<item>124.3733</item>
<item>130.9928</item>
<item>140.4247</item>
<item>149.3156</item>
<item>157.1995</item>
<item>165.3651</item>
<item>173.2726</item>
<item>181.4272</item>
<item>189.1402</item>
<item>197.5334</item>
<item>205.6301</item>
<item>213.9381</item>
<item>222.2769</item>
<item>230.0891</item>
<item>238.6084</item>
<item>246.5399</item>
<item>255.6544</item>
<item>263.6221</item>
<item>271.9324</item>
<item>279.1449</item>
<item>288.5736</item>
<item>297.6628</item>
<item>306.1899</item>
<item>314.4511</item>
<item>322.1404</item>
<item>330.969</item>
<item>338.2251</item>
<item>346.2251</item>
<item>354.567</item>
<item>370.799</item>
<item>413.1738</item>
<item>415.6397</item>
<item>417.264</item>
<item>419.264</item>
<item>421.264</item>
<item>424.646</item>
<item>427.6287</item>
</array>
<!-- An array describing the screen's backlight values corresponding to the brightness
values in the config_screenBrightnessNits array.
This array should be equal in size to config_screenBrightnessBacklight. -->
<integer-array name="config_screenBrightnessBacklight">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>30</item>
<item>35</item>
<item>40</item>
<item>45</item>
<item>50</item>
<item>55</item>
<item>60</item>
<item>70</item>
<item>100</item>
<item>105</item>
<item>110</item>
<item>115</item>
<item>120</item>
<item>125</item>
<item>130</item>
<item>135</item>
<item>140</item>
<item>145</item>
<item>150</item>
<item>155</item>
<item>160</item>
<item>165</item>
<item>170</item>
<item>175</item>
<item>180</item>
<item>185</item>
<item>190</item>
<item>195</item>
<item>200</item>
<item>205</item>
<item>210</item>
<item>215</item>
<item>220</item>
<item>225</item>
<item>230</item>
<item>235</item>
<item>240</item>
<item>245</item>
<item>250</item>
<item>251</item>
<item>252</item>
<item>253</item>
<item>254</item>
<item>255</item>
<item>275</item>
<item>295</item>
<item>380</item>
<item>600</item>
<item>800</item>
<item>950</item>
</integer-array>
<!-- Array of hysteresis constraint values for brightening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_ambientThresholdLevels. The brightening threshold is calculated as
lux * (1.0f + CONSTRAINT_VALUE). When the current lux is higher than this threshold,
the screen brightness is recalculated. See the config_ambientThresholdLevels
description for how the constraint value is chosen. -->
<integer-array name="config_ambientBrighteningThresholds">
<item>9000</item> <!-- 1 -->
<item>8000</item> <!-- 4 -->
<item>7000</item> <!-- 12 -->
<item>5000</item> <!-- 20 -->
<item>3500</item> <!-- 40 -->
<item>2500</item> <!-- 65 -->
<item>2000</item> <!-- 90 -->
<item>2000</item>
<item>2000</item>
<item>2000</item>
<item>2000</item>
<item>1500</item>
<item>1500</item>
<item>1000</item>
<item>1000</item>
</integer-array>
<!-- Array of hysteresis constraint values for darkening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_ambientThresholdLevels. The darkening threshold is calculated as
lux * (1.0f - CONSTRAINT_VALUE). When the current lux is lower than this threshold,
the screen brightness is recalculated. See the config_ambientThresholdLevels
description for how the constraint value is chosen. -->
<integer-array name="config_ambientDarkeningThresholds">
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
<!-- Array of ambient lux threshold values. This is used for determining hysteresis constraint
values by calculating the index to use for lookup and then setting the constraint value
to the corresponding value of the array. The new brightening hysteresis constraint value
is the n-th element of config_ambientBrighteningThresholds, and the new darkening
hysteresis constraint value is the n-th element of config_ambientDarkeningThresholds.
The (zero-based) index is calculated as follows: (MAX is the largest index of the array)
condition calculated index
value < level[0] 0
level[n] <= value < level[n+1] n+1
level[MAX] <= value MAX+1 -->
<integer-array name="config_ambientThresholdLevels">
<item>1</item>
<item>4</item>
<item>12</item>
<item>20</item>
<item>40</item>
<item>65</item>
<item>95</item>
<item>140</item>
<item>200</item>
<item>350</item>
<item>650</item>
<item>1300</item>
<item>1650</item>
<item>1900</item>
<item>2100</item>
<item>2400</item>
<item>2700</item>
<item>3000</item>
<item>2000</item>
<item>3300</item>
</integer-array>
<!-- Whether a software navigation bar should be shown. NOTE: in the future this may be