Add overlay for Xiaomi Mi 11 Lite 5G

This commit is contained in:
AndroPlus 2021-07-31 18:14:33 +09:00
parent 170e930828
commit c2593df096
5 changed files with 468 additions and 0 deletions

View file

@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-xiaomi-mi11lite5g
LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/overlay
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_PRIVATE_PLATFORM_APIS := true
include $(BUILD_PACKAGE)

View file

@ -0,0 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.phh.treble.overlay.xiaomi.mi11lite5g"
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android"
android:requiredSystemPropertyName="ro.vendor.build.fingerprint"
android:requiredSystemPropertyValue="+*iaomi/renoir*"
android:priority="511"
android:isStatic="true" />
</manifest>

View file

@ -0,0 +1,382 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2017, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources>
<!-- The default peak refresh rate for a given device. Change this value if you want to prevent
the framework from using higher refresh rates, even if display modes with higher refresh
rates are available from hardware composer. Only has an effect if the value is
non-zero. -->
<integer name="config_defaultPeakRefreshRate">90</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>
<!-- 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>5</item>
<item>17</item>
<item>24</item>
<item>31</item>
<item>34</item>
<item>46</item>
<item>59</item>
<item>76</item>
<item>81</item>
<item>82</item>
<item>82</item>
<item>82</item>
<item>83</item>
<item>83</item>
<item>83</item>
<item>84</item>
<item>84</item>
<item>85</item>
<item>85</item>
<item>85</item>
<item>85</item>
<item>86</item>
<item>86</item>
<item>87</item>
<item>89</item>
<item>90</item>
<item>91</item>
<item>93</item>
<item>94</item>
<item>96</item>
<item>97</item>
<item>99</item>
<item>100</item>
<item>101</item>
<item>104</item>
<item>105</item>
<item>106</item>
<item>108</item>
<item>109</item>
<item>111</item>
<item>112</item>
<item>114</item>
<item>116</item>
<item>137</item>
<item>157</item>
<item>180</item>
<item>205</item>
<item>226</item>
<item>257</item>
<item>280</item>
<item>295</item>
<item>369</item>
<item>434</item>
<item>500</item>
<item>500</item>
<item>500</item>
</integer-array>
<!-- 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:
(1-based arrays)
Point 1: (0, value[1]): lux <= 0
Point 2: (level[1], value[2]): 0 < lux <= level[1]
Point 3: (level[2], value[3]): level[2] < lux <= level[3]
...
Point N+1: (level[N], value[N+1]): level[N] < lux
The control points must be strictly increasing. Each control point
corresponds to an entry in the brightness backlight values arrays.
For example, if lux == level[1] (first element of the levels array)
then the brightness will be determined by value[2] (second element
of the brightness values array).
Spline interpolation is used to determine the auto-brightness
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>2</item>
<item>4</item>
<item>6</item>
<item>8</item>
<item>10</item>
<item>15</item>
<item>20</item>
<item>25</item>
<item>30</item>
<item>35</item>
<item>40</item>
<item>45</item>
<item>50</item>
<item>55</item>
<item>60</item>
<item>65</item>
<item>70</item>
<item>75</item>
<item>80</item>
<item>85</item>
<item>90</item>
<item>95</item>
<item>100</item>
<item>120</item>
<item>140</item>
<item>160</item>
<item>180</item>
<item>200</item>
<item>220</item>
<item>240</item>
<item>260</item>
<item>280</item>
<item>300</item>
<item>320</item>
<item>340</item>
<item>360</item>
<item>380</item>
<item>400</item>
<item>420</item>
<item>440</item>
<item>460</item>
<item>480</item>
<item>500</item>
<item>700</item>
<item>900</item>
<item>1100</item>
<item>1300</item>
<item>1500</item>
<item>1700</item>
<item>1900</item>
<item>2000</item>
<item>2500</item>
<item>3000</item>
<item>3500</item>
<item>4000</item>
<item>4500</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_screenThresholdLevels. The darkening threshold is calculated as
screenBrightness * (1.0f - CONSTRAINT_VALUE). When the new screen brightness is lower than
this threshold, it is applied. See the config_screenThresholdLevels description for how
the constraint value is chosen. -->
<integer-array name="config_screenBrightnessBacklight">
<item>2</item>
<item>3</item>
<item>10</item>
<item>15</item>
<item>30</item>
<item>45</item>
<item>60</item>
<item>75</item>
<item>90</item>
<item>105</item>
<item>120</item>
<item>135</item>
<item>150</item>
<item>165</item>
<item>180</item>
<item>195</item>
<item>210</item>
<item>225</item>
<item>240</item>
<item>255</item>
</integer-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 -->
<integer-array name="config_screenBrightnessNits">
<item>2</item>
<item>4</item>
<item>22</item>
<item>30</item>
<item>68</item>
<item>95</item>
<item>133</item>
<item>165</item>
<item>192</item>
<item>218</item>
<item>255</item>
<item>290</item>
<item>326</item>
<item>352</item>
<item>384</item>
<item>399</item>
<item>422</item>
<item>432</item>
<item>442</item>
<item>455</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_dynamicHysteresisLuxLevels. 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_dynamicHysteresisLuxLevels
description for how the constraint value is chosen. -->
<integer-array name="config_dynamicHysteresisBrightLevels">
<item>2000</item>
<item>2000</item>
<item>1000</item>
<item>1000</item>
<item>500</item>
<item>500</item>
<item>500</item>
<item>500</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_dynamicHysteresisLuxLevels. 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_dynamicHysteresisLuxLevels
description for how the constraint value is chosen. -->
<integer-array name="config_dynamicHysteresisDarkLevels">
<item>800</item>
<item>800</item>
<item>800</item>
<item>800</item>
<item>800</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_dynamicHysteresisBrightLevels, and the new darkening
hysteresis constraint value is the n-th element of config_dynamicHysteresisDarkLevels.
The (zero-based) index is calculated as follows: (MAX is the largest index of the array)
condition calculated index
value < lux[0] 0
lux[n] <= value < lux[n+1] n+1
lux[MAX] <= value MAX+1 -->
<integer-array name="config_dynamicHysteresisLuxLevels">
<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 hysteresis constraint values for brightening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_screenThresholdLevels. The brightening threshold is calculated as
screenBrightness * (1.0f + CONSTRAINT_VALUE). When the new screen brightness is higher
than this threshold, it is applied. See the config_screenThresholdLevels description for
how the constraint value is chosen. -->
<integer-array name="config_screenBrighteningThresholds">
<item>0</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_screenThresholdLevels. The darkening threshold is calculated as
screenBrightness * (1.0f - CONSTRAINT_VALUE). When the new screen brightness is lower than
this threshold, it is applied. See the config_screenThresholdLevels description for how
the constraint value is chosen. -->
<integer-array name="config_screenDarkeningThresholds">
<item>0</item>
</integer-array>
<!-- The maximum range of gamma adjustment possible using the screen
auto-brightness adjustment setting. -->
<fraction name="config_autoBrightnessAdjustmentMaxGamma">100%</fraction>
<!-- Stability requirements in milliseconds for accepting a new brightness level. This is used
for debouncing the light sensor. Different constants are used to debounce the light sensor
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>
<!-- Maximum screen brightness allowed by the power manager.
The user is forbidden from setting the brightness above this level. -->
<integer name="config_screenBrightnessSettingMaximum">255</integer>
<!-- Minimum screen brightness setting allowed by the power manager.
The user is forbidden from setting the brightness below this level. -->
<integer name="config_screenBrightnessSettingMinimum">2</integer>
<!-- Minimum screen brightness allowed by the power manager. -->
<integer name="config_screenBrightnessDim">6</integer>
</resources>

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<device name="Android">
<item name="ambient.on">0.1</item>
<item name="screen.on">0.1</item>
<item name="screen.full">0.1</item>
<item name="bluetooth.active">0.1</item>
<item name="bluetooth.on">0.1</item>
<item name="wifi.on">0.1</item>
<item name="wifi.active">0.1</item>
<item name="wifi.scan">0.1</item>
<item name="audio">0.1</item>
<item name="video">0.1</item>
<item name="camera.flashlight">0.1</item>
<item name="camera.avg">0.1</item>
<item name="gps.on">0.1</item>
<item name="radio.active">0.1</item>
<item name="radio.scanning">0.1</item>
<array name="radio.on">
<value>0.2</value>
<value>0.1</value>
</array>
<array name="cpu.active">
<value>0.1</value>
</array>
<array name="cpu.clusters.cores">
<value>1</value>
</array>
<array name="cpu.speeds.cluster0">
<value>400000</value>
</array>
<array name="cpu.active.cluster0">
<value>0.1</value>
</array>
<item name="cpu.idle">0.1</item>
<array name="memory.bandwidths">
<value>22.7</value>
</array>
<item name="battery.capacity">1000</item>
<item name="wifi.controller.idle">0</item>
<item name="wifi.controller.rx">0</item>
<item name="wifi.controller.tx">0</item>
<array name="wifi.controller.tx_levels" />
<item name="wifi.controller.voltage">0</item>
<array name="wifi.batchedscan">
<value>.0002</value>
<value>.002</value>
<value>.02</value>
<value>.2</value>
<value>2</value>
</array>
<item name="modem.controller.sleep">0</item>
<item name="modem.controller.idle">0</item>
<item name="modem.controller.rx">0</item>
<array name="modem.controller.tx">
<value>0</value>
<value>0</value>
<value>0</value>
<value>0</value>
<value>0</value>
</array>
<item name="modem.controller.voltage">0</item>
<array name="gps.signalqualitybased">
<value>0</value>
<value>0</value>
</array>
<item name="gps.voltage">0</item>
</device>

View file

@ -136,6 +136,7 @@ PRODUCT_PACKAGES += \
treble-overlay-vsmart-live \
treble-overlay-webview \
treble-overlay-wifi5g \
treble-overlay-xiaomi-mi11lite5g \
treble-overlay-xiaomi-mi6x \
treble-overlay-xiaomi-mi8 \
treble-overlay-xiaomi-mi8ee \