Merge remote-tracking branch 'refs/remotes/bbp/o8.1-gsi-dev'
Conflicts:
overlay.mk
diff --git a/Huawei/P20Lite/Android.mk b/Huawei/P20Lite/Android.mk
new file mode 100644
index 0000000..f35371b
--- /dev/null
+++ b/Huawei/P20Lite/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := optional
+LOCAL_PACKAGE_NAME := treble-overlay-huawei-p20l
+LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
+include $(BUILD_PACKAGE)
diff --git a/Huawei/P20Lite/AndroidManifest.xml b/Huawei/P20Lite/AndroidManifest.xml
new file mode 100644
index 0000000..bbf2983
--- /dev/null
+++ b/Huawei/P20Lite/AndroidManifest.xml
@@ -0,0 +1,10 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="me.phh.treble.overlay.huawei.p20l"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="android"
+ android:requiredSystemPropertyName="ro.product.board"
+ android:requiredSystemPropertyValue="ANE"
+ android:priority="20"
+ android:isStatic="true" />
+</manifest>
diff --git a/Huawei/P20Lite/res/values-land/notch.xml b/Huawei/P20Lite/res/values-land/notch.xml
new file mode 100644
index 0000000..7e9d1fc
--- /dev/null
+++ b/Huawei/P20Lite/res/values-land/notch.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Height of the status bar -->
+ <dimen name="status_bar_height">24dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/Huawei/P20Lite/res/values/notch.xml b/Huawei/P20Lite/res/values/notch.xml
new file mode 100644
index 0000000..1a3355e
--- /dev/null
+++ b/Huawei/P20Lite/res/values/notch.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Height of the status bar -->
+ <dimen name="status_bar_height">90px</dimen>
+</resources>
\ No newline at end of file
diff --git a/Moto/G6Plus/Android.mk b/Moto/G6Plus/Android.mk
new file mode 100644
index 0000000..7f3130a
--- /dev/null
+++ b/Moto/G6Plus/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := optional
+LOCAL_PACKAGE_NAME := treble-overlay-moto-g6plus
+LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
+include $(BUILD_PACKAGE)
diff --git a/Moto/G6Plus/AndroidManifest.xml b/Moto/G6Plus/AndroidManifest.xml
new file mode 100644
index 0000000..29e9c36
--- /dev/null
+++ b/Moto/G6Plus/AndroidManifest.xml
@@ -0,0 +1,10 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="me.phh.treble.overlay.oneplus.op6"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="android"
+ android:requiredSystemPropertyName="ro.vendor.product.name"
+ android:requiredSystemPropertyValue="evert_retail"
+ android:priority="18"
+ android:isStatic="true" />
+</manifest>
diff --git a/Moto/G6Plus/res/values/config.xml b/Moto/G6Plus/res/values/config.xml
new file mode 100644
index 0000000..8ca34b7
--- /dev/null
+++ b/Moto/G6Plus/res/values/config.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="config_enableAutoPowerModes">true</bool>
+ <integer name="config_autoPowerModeAnyMotionSensor">30</integer>
+ <bool name="config_wifi_dual_band_support">true</bool>
+ <bool name="config_wifi_fast_bss_transition_enabled">true</bool>
+ <bool name="config_wifi_background_scan_support">true</bool>
+ <bool name="config_wifi_enable_disconnection_debounce">true</bool>
+ <bool name="config_automatic_brightness_available">true</bool>
+ <integer name="config_brightness_ramp_rate_fast">200</integer>
+ <integer name="config_brightness_ramp_rate_slow">40</integer>
+ <bool name="config_setColorTransformAccelerated">true</bool>
+ <bool name="config_nightDisplayAvailable">false</bool>
+ <bool name="config_suspendWhenScreenOffDueToProximity">true</bool>
+
+ <integer-array name="config_longPressVibePattern">
+ <item>0</item>
+ <item>25</item>
+ </integer-array>
+ <integer-array name="config_virtualKeyVibePattern">
+ <item>0</item>
+ <item>34</item>
+ </integer-array>
+ <integer-array name="config_keyboardTapVibePattern">
+ <item>0</item>
+ <item>25</item>
+ </integer-array>
+ <bool name="config_hotswapCapable">true</bool>
+ <integer name="config_screenBrightnessSettingMinimum">2</integer>
+ <integer name="config_screenBrightnessSettingDefault">77</integer>
+ <integer name="config_screenBrightnessDoze">17</integer>
+ <integer name="config_autoBrightnessBrighteningLightDebounce">2000</integer>
+ <integer name="config_screenBrightnessDark">2</integer>
+ <integer-array name="config_autoBrightnessLcdBacklightValues">
+ <item>2</item>
+ <item>9</item>
+ <item>30</item>
+ <item>47</item>
+ <item>55</item>
+ <item>64</item>
+ <item>77</item>
+ <item>77</item>
+ <item>77</item>
+ <item>77</item>
+ <item>96</item>
+ <item>115</item>
+ <item>128</item>
+ <item>134</item>
+ <item>179</item>
+ <item>191</item>
+ <item>191</item>
+ <item>191</item>
+ <item>256</item>
+ </integer-array>
+ <integer-array name="config_autoBrightnessLevels">
+ <item>2</item>
+ <item>10</item>
+ <item>50</item>
+ <item>90</item>
+ <item>100</item>
+ <item>150</item>
+ <item>200</item>
+ <item>300</item>
+ <item>400</item>
+ <item>500</item>
+ <item>800</item>
+ <item>1000</item>
+ <item>1300</item>
+ <item>2000</item>
+ <item>3000</item>
+ <item>4000</item>
+ <item>8000</item>
+ <item>10000</item>
+ </integer-array>
+ <bool name="config_bluetooth_le_peripheral_mode_supported">true</bool>
+ <integer name="config_bluetooth_operating_voltage_mv">3300</integer>
+ <bool name="skip_restoring_network_selection">true</bool>
+ <bool name="config_showNavigationBar">true</bool>
+
+ <string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
+ <bool name="config_dozeAfterScreenOff">true</bool>
+ <bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>
+ <bool name="config_cellBroadcastAppLinks">true</bool>
+
+ <integer name="config_mobile_mtu">1410</integer>
+ <bool name="config_speed_up_audio_on_mt_calls">true</bool>
+ <bool name="config_auto_attach_data_on_creation">false</bool>
+ <string-array name="config_gpsParameters">
+ <item>XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra2.bin</item>
+ <item>XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra2.bin</item>
+ <item>XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra2.bin</item>
+ <item>NTP_SERVER=north-america.pool.ntp.org</item>
+ <item>SUPL_MODE=0</item>
+ <item>SUPL_HOST=NONE</item>
+ <item>SUPL_PORT=7275</item>
+ <item>SUPL_VER=0x20000</item>
+ <item>LPP_PROFILE=3</item>
+ <item>NMEA_PROVIDER=0</item>
+ <item>A_GLONASS_POS_PROTOCOL_SELECT=0</item>
+ <item>ERR_ESTIMATE=0</item>
+ <item>INTERMEDIATE_POS=0</item>
+ <item>SUPL_ES=0</item>
+ <item>GPS_LOCK=1</item>
+ </string-array>
+ <bool name="config_switch_phone_on_voice_reg_state_change">false</bool>
+ <bool name="config_use_sim_language_file">true</bool>
+ <integer name="config_cameraLaunchGestureSensorType">65540</integer>
+ <string name="config_cameraLaunchGestureSensorStringType">com.motorola.sensor.camera_activate</string>
+
+
+ <!-- big ram -->
+ <integer name="config_multiuserMaximumUsers">4</integer>
+ <bool name="config_enableMultiUserUI">true</bool>
+ <bool name="config_pinnerCameraApp">true</bool>
+ <string-array name="config_defaultPinnerServiceFiles">
+ <item>/system/framework/arm64/boot-framework.oat</item>
+ <item>/system/framework/arm64/boot-framework.vdex</item>
+ <item>/system/framework/oat/arm64/services.odex</item>
+ <item>/system/framework/oat/arm64/services.vdex</item>
+ <item>/system/framework/arm64/boot.oat</item>
+ <item>/system/framework/arm64/boot.vdex</item>
+ <item>/system/framework/arm64/boot-core-libart.oat</item>
+ <item>/system/framework/arm64/boot-core-libart.vdex</item>
+ </string-array>
+</resources>
diff --git a/Moto/G6Plus/res/xml/power_profile.xml b/Moto/G6Plus/res/xml/power_profile.xml
new file mode 100644
index 0000000..d500461
--- /dev/null
+++ b/Moto/G6Plus/res/xml/power_profile.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<device name="Android">
+ <item name="none">0</item>
+ <item name="screen.on">101.378</item>
+ <item name="screen.full">340.004</item>
+ <item name="wifi.on">0.615</item>
+ <item name="wifi.active">75.153</item>
+ <item name="wifi.scan">73.073</item>
+ <item name="camera.avg">543.943</item>
+ <item name="camera.flashlight">213.516</item>
+ <item name="gps.on">64.945</item>
+ <item name="radio.active">319.737</item>
+ <item name="radio.scanning">26.611</item>
+ <array name="radio.on">
+ <value>4.593</value>
+ <value>10.000</value>
+ <value>15.000</value>
+ <value>20.000</value>
+ <value>25.000</value>
+ <value>30.000</value>
+ <value>35.000</value>
+ <value>40.000</value>
+ <value>45.000</value>
+ <value>51.006</value>
+ </array>
+ <array name="cpu.clusters.cores">
+ <value>4</value>
+ <value>4</value>
+ </array>
+ <array name="cpu.speeds.cluster0">
+ <value>787200</value>
+ <value>1113600</value>
+ <value>1344000</value>
+ <value>1516800</value>
+ <value>1670400</value>
+ <value>1881600</value>
+ <value>2016000</value>
+ <value>2150400</value>
+ <value>2208000</value>
+ </array>
+ <array name="cpu.active.cluster0">
+ <value>126.452</value>
+ <value>128.179</value>
+ <value>129.346</value>
+ <value>127.745</value>
+ <value>129.388</value>
+ <value>96.166</value>
+ <value>125.054</value>
+ <value>134.040</value>
+ <value>144.796</value>
+ </array>
+ <array name="cpu.speeds.cluster1">
+ <value>614400</value>
+ <value>883200</value>
+ <value>1094400</value>
+ <value>1382400</value>
+ <value>1536000</value>
+ <value>1728000</value>
+ <value>1843200</value>
+ </array>
+ <array name="cpu.active.cluster1">
+ <value>144.060</value>
+ <value>145.751</value>
+ <value>145.877</value>
+ <value>145.952</value>
+ <value>147.084</value>
+ <value>147.961</value>
+ <value>216.257</value>
+ </array>
+ <item name="cpu.idle">4.031</item>
+ <item name="cpu.awake">8.398</item>
+ <item name="battery.capacity">3200</item>
+</device>
\ No newline at end of file
diff --git a/Sharp/S2/Android.mk b/Sharp/S2/Android.mk
new file mode 100644
index 0000000..7be93b3
--- /dev/null
+++ b/Sharp/S2/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := optional
+LOCAL_PACKAGE_NAME := treble-overlay-sharp-s2
+LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
+include $(BUILD_PACKAGE)
diff --git a/Sharp/S2/AndroidManifest.xml b/Sharp/S2/AndroidManifest.xml
new file mode 100644
index 0000000..8326091
--- /dev/null
+++ b/Sharp/S2/AndroidManifest.xml
@@ -0,0 +1,10 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="me.phh.treble.overlay.sharp.s2"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="android"
+ android:requiredSystemPropertyName="ro.product.board"
+ android:requiredSystemPropertyValue="SAT"
+ android:priority="18"
+ android:isStatic="true" />
+</manifest>
diff --git a/Sharp/S2/res/values-land/notch.xml b/Sharp/S2/res/values-land/notch.xml
new file mode 100644
index 0000000..1264013
--- /dev/null
+++ b/Sharp/S2/res/values-land/notch.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Height of the status bar -->
+ <dimen name="status_bar_height">24.0dip</dimen>
+</resources>
diff --git a/Sharp/S2/res/values/config.xml b/Sharp/S2/res/values/config.xml
new file mode 100644
index 0000000..8c522ee
--- /dev/null
+++ b/Sharp/S2/res/values/config.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="config_automatic_brightness_available">true</bool>
+ <integer name="config_screenBrightnessSettingMinimum">1</integer>
+ <integer name="config_screenBrightnessDoze">17</integer>
+ <integer name="config_screenBrightnessSettingDefault">66</integer>
+ <integer name="config_autoBrightnessBrighteningLightDebounce">1000</integer>
+ <integer name="config_autoBrightnessDarkeningLightDebounce">1000</integer>
+ <integer name="config_screenBrightnessDark">1</integer>
+ <integer name="config_screenBrightnessDim">10</integer>
+ <integer name="config_brightness_ramp_rate_fast">180</integer>
+ <integer name="config_brightness_ramp_rate_slow">60</integer>
+ <fraction name="config_autoBrightnessAdjustmentMaxGamma">299.99695%</fraction>
+ <integer-array name="config_autoBrightnessLevels">
+ <item>1</item>
+ <item>2</item>
+ <item>4</item>
+ <item>5</item>
+ <item>8</item>
+ <item>13</item>
+ <item>17</item>
+ <item>21</item>
+ <item>26</item>
+ <item>30</item>
+ <item>34</item>
+ <item>39</item>
+ <item>60</item>
+ <item>140</item>
+ <item>310</item>
+ <item>400</item>
+ <item>500</item>
+ <item>600</item>
+ <item>1000</item>
+ <item>1200</item>
+ <item>1500</item>
+ <item>3000</item>
+ <item>3500</item>
+ <item>4000</item>
+ </integer-array>
+ <integer-array name="config_autoBrightnessLcdBacklightValues">
+ <item>2</item>
+ <item>2</item>
+ <item>3</item>
+ <item>3</item>
+ <item>8</item>
+ <item>10</item>
+ <item>12</item>
+ <item>15</item>
+ <item>17</item>
+ <item>24</item>
+ <item>30</item>
+ <item>30</item>
+ <item>44</item>
+ <item>45</item>
+ <item>48</item>
+ <item>55</item>
+ <item>64</item>
+ <item>66</item>
+ <item>69</item>
+ <item>84</item>
+ <item>93</item>
+ <item>105</item>
+ <item>200</item>
+ <item>240</item>
+ <item>255</item>
+ </integer-array>
+ <integer-array name="config_autoBrightnessButtonBacklightValues">
+ <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>
+
+ <!-- big ram -->
+ <bool name="config_pinnerCameraApp">true</bool>
+ <integer name="config_multiuserMaximumUsers">4</integer>
+
+</resources>
diff --git a/Sharp/S2/res/values/notch.xml b/Sharp/S2/res/values/notch.xml
new file mode 100644
index 0000000..4e1ccc5
--- /dev/null
+++ b/Sharp/S2/res/values/notch.xml
@@ -0,0 +1,23 @@
+<?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>
+ <!-- Height of the status bar -->
+ <dimen name="status_bar_height">121.0px</dimen>
+ <dimen name="rounded_corner_content_padding">4.0dip</dimen>
+</resources>
diff --git a/Sharp/S2/res/xml/power_profile.xml b/Sharp/S2/res/xml/power_profile.xml
new file mode 100644
index 0000000..d042d59
--- /dev/null
+++ b/Sharp/S2/res/xml/power_profile.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<device name="Android">
+ <item name="none">0</item>
+ <item name="screen.on">63</item>
+ <item name="screen.full">261</item>
+ <array name="cpu.clusters.cores">
+ <value>4</value>
+ <value>4</value>
+ </array>
+ <array name="cpu.speeds.cluster0">
+ <value>633000</value>
+ <value>902000</value>
+ <value>1113000</value>
+ <value>1401000</value>
+ <value>1536000</value>
+ <value>1747000</value>
+ <value>1843000</value>
+ </array>
+ <array name="cpu.active.cluster0">
+ <value>34</value>
+ <value>60</value>
+ <value>85</value>
+ <value>128</value>
+ <value>163</value>
+ <value>202</value>
+ <value>253</value>
+ </array>
+ <array name="cpu.speeds.cluster1">
+ <value>1113000</value>
+ <value>1401000</value>
+ <value>1747000</value>
+ <value>1958000</value>
+ <value>2150000</value>
+ </array>
+ <array name="cpu.active.cluster1">
+ <value>226</value>
+ <value>331</value>
+ <value>497</value>
+ <value>614</value>
+ <value>777</value>
+ </array>
+ <item name="cpu.awake">1.6</item>
+ <item name="cpu.idle">0.1</item>
+ <item name="battery.capacity">3000</item>
+</device>
\ No newline at end of file
diff --git a/Touchscreen/Android.mk b/Touchscreen/Android.mk
deleted file mode 100644
index 3966b30..0000000
--- a/Touchscreen/Android.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-LOCAL_PACKAGE_NAME := Touchscreen
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_PACKAGE)
diff --git a/Touchscreen/AndroidManifest.xml b/Touchscreen/AndroidManifest.xml
deleted file mode 100644
index 50e3b92..0000000
--- a/Touchscreen/AndroidManifest.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="me.phh.treble.touchscreen"
- android:sharedUserId="android.uid.system">
-
- <uses-permission android:name="android.permission.SET_INPUT_CALIBRATION" />
- <application
- android:label="@string/app_label">
-
- <receiver android:name=".Starter">
- <intent-filter>
- <action android:name="android.intent.action.BOOT_COMPLETED"/>
- </intent-filter>
- </receiver>
- </application>
-
-</manifest>
diff --git a/Touchscreen/res/values/strings.xml b/Touchscreen/res/values/strings.xml
deleted file mode 100644
index 1bd9b00..0000000
--- a/Touchscreen/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="app_label">Hardware Overlay Picker</string>
-</resources>
diff --git a/Touchscreen/src/me/phh/treble/touchscreen/Starter.java b/Touchscreen/src/me/phh/treble/touchscreen/Starter.java
deleted file mode 100644
index bc5fcf4..0000000
--- a/Touchscreen/src/me/phh/treble/touchscreen/Starter.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package me.phh.treble.touchscreen;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.om.IOverlayManager;
-import android.hardware.input.InputManager;
-import android.view.InputDevice;
-import android.view.MotionEvent;
-import android.hardware.input.TouchCalibration;
-import android.os.RemoteException;
-import android.os.ServiceManager;
-import android.os.SystemProperties;
-import android.util.Log;
-
-public class Starter extends BroadcastReceiver {
- private final static String TAG = "TouchScreen";
-
- private int getRotation(Context ctxt, Intent intent) {
- int rotation = -1;
- String vndFingerprint = SystemProperties.get("ro.vendor.build.fingerprint", "");
- int hwrotation = SystemProperties.getInt("ro.sf.hwrotation", -1);
- if(vndFingerprint.contains("full_x970_t10") && hwrotation == 270) {
- rotation = 271;
- }
- if(intent.hasExtra("rotation")) {
- rotation = intent.getIntExtra("rotation", rotation);
- }
- return rotation;
- }
-
- @Override
- public void onReceive(Context ctxt, Intent intent) {
- int rotation = getRotation(ctxt, intent);
- if(rotation == -1) return;
- android.util.Log.d("PHH", "Applying rotation " + rotation);
- InputManager im = ctxt.getSystemService(InputManager.class);
- int[] ids = im.getInputDeviceIds();
- for(int id: ids) {
- InputDevice dev = im.getInputDevice(id);
- String descriptor = dev.getDescriptor();
- android.util.Log.d("PHH", "Checking device " + descriptor + ":" + dev.getSources());
- if( (dev.getSources() & InputDevice.SOURCE_TOUCHSCREEN) == InputDevice.SOURCE_TOUCHSCREEN ) {
- InputDevice.MotionRange rangeX = dev.getMotionRange(MotionEvent.AXIS_X);
- InputDevice.MotionRange rangeY = dev.getMotionRange(MotionEvent.AXIS_Y);
-
- float dX = rangeX.getMax();
- float dY = rangeY.getMax();
- //TouchCalibration cal = new TouchCalibration(
- // 0.0f, dX/dY, 0.0f,
- // dY/dX, 0.0f, 0.0f);
- TouchCalibration cal;
- if(rotation == 0) {
- cal = new TouchCalibration(
- 1.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f);
- } else if(rotation == 90) {
- cal = new TouchCalibration(
- 0.0f, dX/dY, 0.0f,
- dY/dX, 0.0f, 0.0f);
- } else if(rotation == 91) {
- cal = new TouchCalibration(
- 0.0f, -dX/dY, dX,
- dY/dX, 0.0f, 0.0f);
- } else if(rotation == 180) {
- cal = new TouchCalibration(
- -1.0f, 0.0f, dX,
- 0.0f, -1.0f, dY);
- } else if(rotation == 270) {
- cal = new TouchCalibration(
- 0.0f, -dX/dY, dX,
- -dY/dX, 0.0f, dY);
- } else if(rotation == 271) {
- cal = new TouchCalibration(
- 0.0f, dX/dY, 0.0f,
- -dY/dX, 0.0f, dY);
- } else {
- cal = new TouchCalibration(
- 1.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f);
- }
-
- android.util.Log.d("PHH", "Setting touch calibration " + dY/dX + ":" + dX/dY);
- im.setTouchCalibration(descriptor, 0, cal);
- im.setTouchCalibration(descriptor, 1, cal);
- im.setTouchCalibration(descriptor, 2, cal);
- im.setTouchCalibration(descriptor, 3, cal);
- }
- }
- }
-}
diff --git a/Xiaomi/Redmi6Pro/Android.mk b/Xiaomi/Redmi6Pro/Android.mk
new file mode 100644
index 0000000..74f106f
--- /dev/null
+++ b/Xiaomi/Redmi6Pro/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := optional
+LOCAL_PACKAGE_NAME := treble-overlay-xiaomi-redmi6pro
+LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
+include $(BUILD_PACKAGE)
diff --git a/Xiaomi/Redmi6Pro/AndroidManifest.xml b/Xiaomi/Redmi6Pro/AndroidManifest.xml
new file mode 100644
index 0000000..7b297ea
--- /dev/null
+++ b/Xiaomi/Redmi6Pro/AndroidManifest.xml
@@ -0,0 +1,10 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="me.phh.treble.overlay.xiaomi.redmi6pro"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="android"
+ android:requiredSystemPropertyName="ro.vendor.product.device"
+ android:requiredSystemPropertyValue="sakura"
+ android:priority="19"
+ android:isStatic="true" />
+</manifest>
diff --git a/Xiaomi/Redmi6Pro/res/values-land/notch.xml b/Xiaomi/Redmi6Pro/res/values-land/notch.xml
new file mode 100644
index 0000000..7e9d1fc
--- /dev/null
+++ b/Xiaomi/Redmi6Pro/res/values-land/notch.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Height of the status bar -->
+ <dimen name="status_bar_height">24dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/Xiaomi/Redmi6Pro/res/values/notch.xml b/Xiaomi/Redmi6Pro/res/values/notch.xml
new file mode 100644
index 0000000..1481825
--- /dev/null
+++ b/Xiaomi/Redmi6Pro/res/values/notch.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Height of the status bar -->
+ <dimen name="status_bar_height">110px</dimen>
+</resources>
\ No newline at end of file
diff --git a/overlay.mk b/overlay.mk
index 2bd5440..cab14d1 100644
--- a/overlay.mk
+++ b/overlay.mk
@@ -1,26 +1,31 @@
PRODUCT_PACKAGES += \
treble-overlay-asus-zenfone5 \
treble-overlay-huawei \
+ treble-overlay-huawei-p20l \
treble-overlay-huawei-telephony \
treble-overlay-lg-g7 \
treble-overlay-NavBar \
treble-overlay-NightMode \
treble-overlay-Telephony-LTE \
+ treble-overlay-sharp-s2 \
treble-overlay-SystemUI-FalseLocks \
treble-overlay-devinputjack \
treble-overlay-oneplus-op6 \
+ treble-overlay-moto-g6plus \
treble-overlay-wifi5g \
+ treble-overlay-samsung-s9 \
treble-overlay-xiaomi-mi8 \
treble-overlay-xiaomi-mi8ee \
treble-overlay-xiaomi-mi8se \
treble-overlay-xiaomi-mimix2s \
+ treble-overlay-xiaomi-redmi6pro \
HardwareOverlayPicker \
QtiAudio \
Touchscreen \
- android.hidl.base@1.0 \
- android.hidl.manager@1.0 \
- HotwordEnrollmentOKGoogleHI6403 \
- HotwordEnrollmentXGoogleHI6403
+ android.hidl.base@1.0 \
+ android.hidl.manager@1.0 \
+ HotwordEnrollmentOKGoogleHI6403 \
+ HotwordEnrollmentXGoogleHI6403
# Huawei Camera
PRODUCT_COPY_FILES += \