Update patches
diff --git a/patches/platform_build/0001-Revert-Remove-root-folder-bt_firmware-in-GSI.patch b/patches/platform_build/0001-Revert-Remove-root-folder-bt_firmware-in-GSI.patch
index a562e71..272890c 100644
--- a/patches/platform_build/0001-Revert-Remove-root-folder-bt_firmware-in-GSI.patch
+++ b/patches/platform_build/0001-Revert-Remove-root-folder-bt_firmware-in-GSI.patch
@@ -1,4 +1,4 @@
-From 363cac7dd03a359471d7aa97d7f5d8a8bcba5e11 Mon Sep 17 00:00:00 2001
+From 837c24d2cfefa1276740b8cf54e748ad160ff5c6 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 27 Mar 2018 23:26:49 +0200
 Subject: [PATCH 1/2] Revert "Remove root folder bt_firmware in GSI"
diff --git a/patches/platform_build/0002-Set-ro.build.fingerprint-in-system-etc-prop.default.patch b/patches/platform_build/0002-Set-ro.build.fingerprint-in-system-etc-prop.default.patch
index da04fd7..2dc9aba 100644
--- a/patches/platform_build/0002-Set-ro.build.fingerprint-in-system-etc-prop.default.patch
+++ b/patches/platform_build/0002-Set-ro.build.fingerprint-in-system-etc-prop.default.patch
@@ -1,4 +1,4 @@
-From fb0a46552cb2c96658deb171bc83a8184211d864 Mon Sep 17 00:00:00 2001
+From aea3c71e33167e2867baacb173d8b219f6ebc5c7 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Mon, 5 Mar 2018 22:27:50 +0100
 Subject: [PATCH 2/2] Set ro.build.fingerprint in system/etc/prop.default
diff --git a/patches/platform_frameworks_av/0001-FIH-devices-Fix-Earpiece-audio-output.patch b/patches/platform_frameworks_av/0001-FIH-devices-Fix-Earpiece-audio-output.patch
index c5ad3b8..de36668 100644
--- a/patches/platform_frameworks_av/0001-FIH-devices-Fix-Earpiece-audio-output.patch
+++ b/patches/platform_frameworks_av/0001-FIH-devices-Fix-Earpiece-audio-output.patch
@@ -1,4 +1,4 @@
-From 71286a6af35eeebf33171848285c9e6dc0da1366 Mon Sep 17 00:00:00 2001
+From c4b8b08cc758f28b4582bf9a16e1185bdc8eeb34 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 24 Apr 2018 00:14:28 +0200
 Subject: [PATCH 1/4] FIH devices: Fix "Earpiece" audio output
diff --git a/patches/platform_frameworks_av/0002-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch b/patches/platform_frameworks_av/0002-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
index ddae3c7..9e1d2fd 100644
--- a/patches/platform_frameworks_av/0002-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
+++ b/patches/platform_frameworks_av/0002-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
@@ -1,4 +1,4 @@
-From 3e6bf2b4bd5cc97399e8bfe0dace8f4b2c6f69cc Mon Sep 17 00:00:00 2001
+From 2c2a7ca972e38efbf020fc6f152c3489e9181255 Mon Sep 17 00:00:00 2001
 From: Alexander Pohl <pohl199885@gmail.com>
 Date: Fri, 15 Jun 2018 19:58:07 +0200
 Subject: [PATCH 2/4] Fix WiFi-Display on Huawei devices (EMUI 8.0)
diff --git a/patches/platform_frameworks_av/0003-Kirin-Remove-lock-to-prevent-self-lock.patch b/patches/platform_frameworks_av/0003-Kirin-Remove-lock-to-prevent-self-lock.patch
index 4320ceb..1a5d9ff 100644
--- a/patches/platform_frameworks_av/0003-Kirin-Remove-lock-to-prevent-self-lock.patch
+++ b/patches/platform_frameworks_av/0003-Kirin-Remove-lock-to-prevent-self-lock.patch
@@ -1,4 +1,4 @@
-From 3ff17862deda0303940be62e8f6cbb4eed06e292 Mon Sep 17 00:00:00 2001
+From dc503a4a486e76ef04dedd9552790472bf2e6efa Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sun, 19 Aug 2018 22:59:06 +0200
 Subject: [PATCH 3/4] ::Kirin:: Remove lock to prevent self-lock
diff --git a/patches/platform_frameworks_av/0004-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch b/patches/platform_frameworks_av/0004-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
index 7426512..4daeccd 100644
--- a/patches/platform_frameworks_av/0004-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
+++ b/patches/platform_frameworks_av/0004-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
@@ -1,4 +1,4 @@
-From ec657f31e92f4a58791a39025632f0350a7750db Mon Sep 17 00:00:00 2001
+From b230536a4577e53e68e2f2a70e25939f8ef313b7 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sun, 19 Aug 2018 23:05:26 +0200
 Subject: [PATCH 4/4] We might not have a mFlashlight at this state, but that's
diff --git a/patches/platform_frameworks_base/0001-Fix-backlight-control-on-Galaxy-S9.patch b/patches/platform_frameworks_base/0001-Fix-backlight-control-on-Galaxy-S9.patch
index 23c56cb..20e28f2 100644
--- a/patches/platform_frameworks_base/0001-Fix-backlight-control-on-Galaxy-S9.patch
+++ b/patches/platform_frameworks_base/0001-Fix-backlight-control-on-Galaxy-S9.patch
@@ -1,4 +1,4 @@
-From 83c5a5d0e192b901ec36059bf2fb1fc8d63de1a7 Mon Sep 17 00:00:00 2001
+From 0063d0cc057d4adc104282b0e86e76b9d3c7802f Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sat, 24 Mar 2018 08:01:48 +0100
 Subject: [PATCH 01/24] Fix backlight control on Galaxy S9(+)
diff --git a/patches/platform_frameworks_base/0002-Relax-requirement-for-visible-flag-to-sdcards.patch b/patches/platform_frameworks_base/0002-Relax-requirement-for-visible-flag-to-sdcards.patch
index 0f0b2ee..7f6e974 100644
--- a/patches/platform_frameworks_base/0002-Relax-requirement-for-visible-flag-to-sdcards.patch
+++ b/patches/platform_frameworks_base/0002-Relax-requirement-for-visible-flag-to-sdcards.patch
@@ -1,4 +1,4 @@
-From 4547592e86f29d043daf0f3385c802949fa73193 Mon Sep 17 00:00:00 2001
+From 2d24fcb8ea4f97ea30361a5b96779a4a0ec81cce Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 28 Nov 2017 18:28:04 +0100
 Subject: [PATCH 02/24] Relax requirement for visible flag to sdcards
diff --git a/patches/platform_frameworks_base/0003-Also-scan-system-overlay.patch b/patches/platform_frameworks_base/0003-Also-scan-system-overlay.patch
index 739d468..7127f64 100644
--- a/patches/platform_frameworks_base/0003-Also-scan-system-overlay.patch
+++ b/patches/platform_frameworks_base/0003-Also-scan-system-overlay.patch
@@ -1,4 +1,4 @@
-From b3bf3329f50ba0fc4a494a772d5f76b66dc67a2c Mon Sep 17 00:00:00 2001
+From 2376ba3a5185b0da29d58cbf961d7fe5dd2b78f8 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 1 May 2018 17:47:36 +0200
 Subject: [PATCH 03/24] Also scan /system/overlay
diff --git a/patches/platform_frameworks_base/0004-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch b/patches/platform_frameworks_base/0004-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
index 1851fde..033a81f 100644
--- a/patches/platform_frameworks_base/0004-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
+++ b/patches/platform_frameworks_base/0004-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
@@ -1,4 +1,4 @@
-From 89b3b71fc07b7069b7c5f345762925b9743e6361 Mon Sep 17 00:00:00 2001
+From af6f55b6fb20847e82f7a72de1a1b9ead618e7bb Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Thu, 17 May 2018 20:28:35 +0200
 Subject: [PATCH 04/24] Don't crash if there is IR HAL is not declared
diff --git a/patches/platform_frameworks_base/0005-Fix-62.patch b/patches/platform_frameworks_base/0005-Fix-62.patch
index f559f3d..dc28102 100644
--- a/patches/platform_frameworks_base/0005-Fix-62.patch
+++ b/patches/platform_frameworks_base/0005-Fix-62.patch
@@ -1,4 +1,4 @@
-From ca27968613cbe47b158a690f82347586264bbe54 Mon Sep 17 00:00:00 2001
+From 800c6600224adc9d1109515a97d0c04eb9475c97 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Wed, 30 May 2018 14:05:30 +0200
 Subject: [PATCH 05/24] Fix(?) #62
diff --git a/patches/platform_frameworks_base/0006-S9-brightness-override-only-for-screen.patch b/patches/platform_frameworks_base/0006-S9-brightness-override-only-for-screen.patch
index d9a97cb..6a74fb6 100644
--- a/patches/platform_frameworks_base/0006-S9-brightness-override-only-for-screen.patch
+++ b/patches/platform_frameworks_base/0006-S9-brightness-override-only-for-screen.patch
@@ -1,4 +1,4 @@
-From 5b5bafd457463ca4c90d3d2470703655179220ae Mon Sep 17 00:00:00 2001
+From c7673c9102e2e315300f9d45fe5d285171f1dc74 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <pierre-hugues.husson@softathome.com>
 Date: Thu, 7 Jun 2018 13:36:51 +0200
 Subject: [PATCH 06/24] S9 brightness override only for screen
diff --git a/patches/platform_frameworks_base/0007-WIP-Fix-OP6-brightness.patch b/patches/platform_frameworks_base/0007-WIP-Fix-OP6-brightness.patch
index 2b17db8..befc981 100644
--- a/patches/platform_frameworks_base/0007-WIP-Fix-OP6-brightness.patch
+++ b/patches/platform_frameworks_base/0007-WIP-Fix-OP6-brightness.patch
@@ -1,4 +1,4 @@
-From c23233a753225db8dcb6c74c53c0edc0ab2be44e Mon Sep 17 00:00:00 2001
+From 3fdadd53f180dd2aa763cbb27eae1e988bda5004 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <pierre-hugues.husson@softathome.com>
 Date: Thu, 7 Jun 2018 13:42:02 +0200
 Subject: [PATCH 07/24] [WIP] Fix OP6 brightness
diff --git a/patches/platform_frameworks_base/0008-Try-to-make-brightness-more-generic-using-property-s.patch b/patches/platform_frameworks_base/0008-Try-to-make-brightness-more-generic-using-property-s.patch
index 9179c65..8db357f 100644
--- a/patches/platform_frameworks_base/0008-Try-to-make-brightness-more-generic-using-property-s.patch
+++ b/patches/platform_frameworks_base/0008-Try-to-make-brightness-more-generic-using-property-s.patch
@@ -1,4 +1,4 @@
-From c87dbdb6ff897e1f25ce90acf136b4606337db00 Mon Sep 17 00:00:00 2001
+From 29c2e6622433ac08aa09a557b97981baefaec32f Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sun, 10 Jun 2018 22:54:55 +0200
 Subject: [PATCH 08/24] Try to make brightness more generic using property set
diff --git a/patches/platform_frameworks_base/0009-property-matching-RROs-allow-to-prefix-the-value-wit.patch b/patches/platform_frameworks_base/0009-property-matching-RROs-allow-to-prefix-the-value-wit.patch
index 5ee151b..7addead 100644
--- a/patches/platform_frameworks_base/0009-property-matching-RROs-allow-to-prefix-the-value-wit.patch
+++ b/patches/platform_frameworks_base/0009-property-matching-RROs-allow-to-prefix-the-value-wit.patch
@@ -1,4 +1,4 @@
-From af7f850833c9de9d3f055406038dfe7c9108a0e3 Mon Sep 17 00:00:00 2001
+From 8b5455e6c07e05db4276d1ba3c1b689d7fe18923 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 12 Jun 2018 22:55:32 +0200
 Subject: [PATCH 09/24] property-matching RROs: allow to prefix the value with
diff --git a/patches/platform_frameworks_base/0010-Fix-typo-on-fnmatch-return-value-check.patch b/patches/platform_frameworks_base/0010-Fix-typo-on-fnmatch-return-value-check.patch
index f53991c..47442c2 100644
--- a/patches/platform_frameworks_base/0010-Fix-typo-on-fnmatch-return-value-check.patch
+++ b/patches/platform_frameworks_base/0010-Fix-typo-on-fnmatch-return-value-check.patch
@@ -1,4 +1,4 @@
-From 88e3e3df61a84c0a569fe128e1e22776af2e9aa8 Mon Sep 17 00:00:00 2001
+From 82dba9aa0570e109aab6c72f5359a08159d202dd Mon Sep 17 00:00:00 2001
 From: Song Fuchang <song.fc@gmail.com>
 Date: Sun, 17 Jun 2018 22:39:37 +0800
 Subject: [PATCH 10/24] Fix typo on fnmatch return value check
diff --git a/patches/platform_frameworks_base/0011-Add-Qualcomm-starlte.patch b/patches/platform_frameworks_base/0011-Add-Qualcomm-starlte.patch
index afce3b5..de14727 100644
--- a/patches/platform_frameworks_base/0011-Add-Qualcomm-starlte.patch
+++ b/patches/platform_frameworks_base/0011-Add-Qualcomm-starlte.patch
@@ -1,4 +1,4 @@
-From f91ab52edbb4ed99689e0347f08cb9cd135bdbc5 Mon Sep 17 00:00:00 2001
+From 8c0a533e719e0555f8fdda2528c622bab88c831b Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Mon, 25 Jun 2018 22:43:32 +0200
 Subject: [PATCH 11/24] Add Qualcomm starlte
diff --git a/patches/platform_frameworks_base/0012-Galaxy-S9-remaining-of-HAL-onEnroll-is-actually-a-pe.patch b/patches/platform_frameworks_base/0012-Galaxy-S9-remaining-of-HAL-onEnroll-is-actually-a-pe.patch
index 775bc52..f44b69f 100644
--- a/patches/platform_frameworks_base/0012-Galaxy-S9-remaining-of-HAL-onEnroll-is-actually-a-pe.patch
+++ b/patches/platform_frameworks_base/0012-Galaxy-S9-remaining-of-HAL-onEnroll-is-actually-a-pe.patch
@@ -1,4 +1,4 @@
-From 880144142eec1864485ae289d6772e046453612d Mon Sep 17 00:00:00 2001
+From e19645c6678ce67683443deea6adddda833ee496 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Mon, 2 Jul 2018 23:36:39 +0200
 Subject: [PATCH 12/24] [Galaxy S9] "remaining" of HAL onEnroll is actually a
diff --git a/patches/platform_frameworks_base/0013-Show-APN-Settings-for-CDMA-carriers.patch b/patches/platform_frameworks_base/0013-Show-APN-Settings-for-CDMA-carriers.patch
index a540259..b117808 100644
--- a/patches/platform_frameworks_base/0013-Show-APN-Settings-for-CDMA-carriers.patch
+++ b/patches/platform_frameworks_base/0013-Show-APN-Settings-for-CDMA-carriers.patch
@@ -1,4 +1,4 @@
-From 879613f77988fb4b1c628fd51e6b330e02cddfc3 Mon Sep 17 00:00:00 2001
+From 1b0d3db06e36c509905964258dbe1e5e2cbf72ed Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Mon, 6 Aug 2018 12:49:00 +0200
 Subject: [PATCH 13/24] Show APN Settings for CDMA carriers
diff --git a/patches/platform_frameworks_base/0014-Change-SignalStrentgh-to-change-behaviour-based-on-p.patch b/patches/platform_frameworks_base/0014-Change-SignalStrentgh-to-change-behaviour-based-on-p.patch
index 0a344ce..e1e67f0 100644
--- a/patches/platform_frameworks_base/0014-Change-SignalStrentgh-to-change-behaviour-based-on-p.patch
+++ b/patches/platform_frameworks_base/0014-Change-SignalStrentgh-to-change-behaviour-based-on-p.patch
@@ -1,4 +1,4 @@
-From fd818b3249a795d3e231fa9346372c183099c745 Mon Sep 17 00:00:00 2001
+From a46085a2f5252bdda5cdba4c846327e47ffaffba Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Mon, 6 Aug 2018 20:01:44 +0200
 Subject: [PATCH 14/24] Change SignalStrentgh to change behaviour based on
diff --git a/patches/platform_frameworks_base/0015-idmap-Don-t-silently-ignore-RROs-with-same-priority.patch b/patches/platform_frameworks_base/0015-idmap-Don-t-silently-ignore-RROs-with-same-priority.patch
index 92ba683..c4ec433 100644
--- a/patches/platform_frameworks_base/0015-idmap-Don-t-silently-ignore-RROs-with-same-priority.patch
+++ b/patches/platform_frameworks_base/0015-idmap-Don-t-silently-ignore-RROs-with-same-priority.patch
@@ -1,4 +1,4 @@
-From 3ec335c1a6346e2f5ee03bf603839b730c12928c Mon Sep 17 00:00:00 2001
+From 99a090647fcac70446d5f6e2effec214c63009f4 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sun, 19 Aug 2018 10:51:06 +0200
 Subject: [PATCH 15/24] idmap: Don't silently ignore RROs with same priority
diff --git a/patches/platform_frameworks_base/0016-Move-SysuiDarkThemeOverlay-to-system.patch b/patches/platform_frameworks_base/0016-Move-SysuiDarkThemeOverlay-to-system.patch
index 12b4bd7..b808b51 100644
--- a/patches/platform_frameworks_base/0016-Move-SysuiDarkThemeOverlay-to-system.patch
+++ b/patches/platform_frameworks_base/0016-Move-SysuiDarkThemeOverlay-to-system.patch
@@ -1,4 +1,4 @@
-From 9629e7118d06a375d96f2967be54f3c2348b5b89 Mon Sep 17 00:00:00 2001
+From e75f9d28caacf9960c4e27a909f218dfd3908141 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sun, 19 Aug 2018 10:57:21 +0200
 Subject: [PATCH 16/24] Move SysuiDarkThemeOverlay to /system
diff --git a/patches/platform_frameworks_base/0017-Reintroduce-button-backlight-and-respective-inactivi.patch b/patches/platform_frameworks_base/0017-Reintroduce-button-backlight-and-respective-inactivi.patch
index b7bdf66..b3d287e 100644
--- a/patches/platform_frameworks_base/0017-Reintroduce-button-backlight-and-respective-inactivi.patch
+++ b/patches/platform_frameworks_base/0017-Reintroduce-button-backlight-and-respective-inactivi.patch
@@ -1,4 +1,4 @@
-From 4459e03e52773a42d83bca5a02172d658e7fc2b9 Mon Sep 17 00:00:00 2001
+From 3cc7058915def58c3371bae1c9b15f1fa6579095 Mon Sep 17 00:00:00 2001
 From: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
 Date: Fri, 23 Nov 2012 14:23:16 +0000
 Subject: [PATCH 17/24] Reintroduce button-backlight (and respective inactivity
diff --git a/patches/platform_frameworks_base/0018-power-Disable-keyboard-button-lights-while-dozing-dr.patch b/patches/platform_frameworks_base/0018-power-Disable-keyboard-button-lights-while-dozing-dr.patch
index 2e0304b..33bb759 100644
--- a/patches/platform_frameworks_base/0018-power-Disable-keyboard-button-lights-while-dozing-dr.patch
+++ b/patches/platform_frameworks_base/0018-power-Disable-keyboard-button-lights-while-dozing-dr.patch
@@ -1,4 +1,4 @@
-From 70a48b3381acd2b8cf0ef090c188ae95635d5921 Mon Sep 17 00:00:00 2001
+From 8d350deeaa1504eb31547c7ec974e0088bd54e29 Mon Sep 17 00:00:00 2001
 From: Steve Kondik <steve@cyngn.com>
 Date: Sat, 3 Jan 2015 05:13:26 -0800
 Subject: [PATCH 18/24] power: Disable keyboard/button lights while
diff --git a/patches/platform_frameworks_base/0019-It-is-okay-not-to-have-wifi-in-SystemUI-on-FDE-lock.patch b/patches/platform_frameworks_base/0019-It-is-okay-not-to-have-wifi-in-SystemUI-on-FDE-lock.patch
index ba7cd71..c980e42 100644
--- a/patches/platform_frameworks_base/0019-It-is-okay-not-to-have-wifi-in-SystemUI-on-FDE-lock.patch
+++ b/patches/platform_frameworks_base/0019-It-is-okay-not-to-have-wifi-in-SystemUI-on-FDE-lock.patch
@@ -1,4 +1,4 @@
-From bfa2cabcbae2e6b67acda5fad79e98104f66b915 Mon Sep 17 00:00:00 2001
+From c067a061d00b431fbbde02554799b717e7320579 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Mon, 20 Aug 2018 22:27:02 +0200
 Subject: [PATCH 19/24] It is okay not to have wifi in SystemUI (on FDE lock)
diff --git a/patches/platform_frameworks_base/0020-Don-t-wake-IR-HAL-to-the-infinity-and-beyond.patch b/patches/platform_frameworks_base/0020-Don-t-wake-IR-HAL-to-the-infinity-and-beyond.patch
index 1291a85..b4d200e 100644
--- a/patches/platform_frameworks_base/0020-Don-t-wake-IR-HAL-to-the-infinity-and-beyond.patch
+++ b/patches/platform_frameworks_base/0020-Don-t-wake-IR-HAL-to-the-infinity-and-beyond.patch
@@ -1,4 +1,4 @@
-From 99be786b380a2e4507f6b223471b7f28bb1018c8 Mon Sep 17 00:00:00 2001
+From f6788c953965426afd217766d2ede33c97c5dd67 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 21 Aug 2018 22:24:02 +0200
 Subject: [PATCH 20/24] Don't wake IR HAL to the infinity and beyond
diff --git a/patches/platform_frameworks_base/0021-Switch-samsung-light-fingerprint-match-to-regexp-to-.patch b/patches/platform_frameworks_base/0021-Switch-samsung-light-fingerprint-match-to-regexp-to-.patch
index 2d73712..5e3d484 100644
--- a/patches/platform_frameworks_base/0021-Switch-samsung-light-fingerprint-match-to-regexp-to-.patch
+++ b/patches/platform_frameworks_base/0021-Switch-samsung-light-fingerprint-match-to-regexp-to-.patch
@@ -1,4 +1,4 @@
-From 046af562d6bfc3789043f1aed68333234f9b6688 Mon Sep 17 00:00:00 2001
+From ba5c04c7d327ce8a9646d5b173995945b0832e54 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Thu, 23 Aug 2018 23:39:16 +0200
 Subject: [PATCH 21/24] Switch samsung light fingerprint match to regexp, to
diff --git a/patches/platform_frameworks_base/0022-Add-a-property-toggle-to-enable-high-brightness-rang.patch b/patches/platform_frameworks_base/0022-Add-a-property-toggle-to-enable-high-brightness-rang.patch
index ffc1c23..c7eb72f 100644
--- a/patches/platform_frameworks_base/0022-Add-a-property-toggle-to-enable-high-brightness-rang.patch
+++ b/patches/platform_frameworks_base/0022-Add-a-property-toggle-to-enable-high-brightness-rang.patch
@@ -1,4 +1,4 @@
-From b7771cbdcc0cc8772ea01746a9756bf8a4d7baa5 Mon Sep 17 00:00:00 2001
+From 4b60b371437ec34c65a63d5efe7b272b292ca7cf Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Mon, 27 Aug 2018 00:47:13 +0200
 Subject: [PATCH 22/24] Add a property toggle to enable high brightness range
diff --git a/patches/platform_frameworks_base/0023-Add-a-property-to-override-pre-o-max-aspect-ratio.patch b/patches/platform_frameworks_base/0023-Add-a-property-to-override-pre-o-max-aspect-ratio.patch
index 9081427..2080b3b 100644
--- a/patches/platform_frameworks_base/0023-Add-a-property-to-override-pre-o-max-aspect-ratio.patch
+++ b/patches/platform_frameworks_base/0023-Add-a-property-to-override-pre-o-max-aspect-ratio.patch
@@ -1,4 +1,4 @@
-From c5614e24c92589437b8737b3ac39f7d43e4bd61e Mon Sep 17 00:00:00 2001
+From 534afa02094b03917bd90202ff9cd05b51d6bfa6 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Wed, 29 Aug 2018 11:05:54 +0200
 Subject: [PATCH 23/24] Add a property to override pre-o max aspect ratio
diff --git a/patches/platform_frameworks_base/0024-Add-japanese-S9.patch b/patches/platform_frameworks_base/0024-Add-japanese-S9.patch
index d7daf53..5dbc426 100644
--- a/patches/platform_frameworks_base/0024-Add-japanese-S9.patch
+++ b/patches/platform_frameworks_base/0024-Add-japanese-S9.patch
@@ -1,4 +1,4 @@
-From 5f1745c4b1754a6bc9117d7586ea7672c51af5b6 Mon Sep 17 00:00:00 2001
+From 83f60d615b7e653b0b74c74f55efa71fff0cf952 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 28 Aug 2018 20:39:26 +0200
 Subject: [PATCH 24/24] Add japanese S9
diff --git a/patches/platform_frameworks_native/0001-AOSP-8.0-8.1-didn-t-use-presentOrValidate-so-it-s-br.patch b/patches/platform_frameworks_native/0001-AOSP-8.0-8.1-didn-t-use-presentOrValidate-so-it-s-br.patch
index 4c90fec..d76395f 100644
--- a/patches/platform_frameworks_native/0001-AOSP-8.0-8.1-didn-t-use-presentOrValidate-so-it-s-br.patch
+++ b/patches/platform_frameworks_native/0001-AOSP-8.0-8.1-didn-t-use-presentOrValidate-so-it-s-br.patch
@@ -1,7 +1,7 @@
 From 3861d57b5dc895c08e15808d72235540d62bcd4a Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 14 Aug 2018 21:01:35 +0200
-Subject: [PATCH 1/4] AOSP 8.0/8.1 didn't use presentOrValidate, so it's
+Subject: [PATCH 1/2] AOSP 8.0/8.1 didn't use presentOrValidate, so it's
  broken. Don't use it
 
 ---
diff --git a/patches/platform_frameworks_native/0002-Ignore-usage-bits-verification.patch b/patches/platform_frameworks_native/0002-Ignore-usage-bits-verification.patch
index af1c83b..775b423 100644
--- a/patches/platform_frameworks_native/0002-Ignore-usage-bits-verification.patch
+++ b/patches/platform_frameworks_native/0002-Ignore-usage-bits-verification.patch
@@ -1,7 +1,7 @@
 From f82e1419c8006bd9a6d40d5c6f59829858b88507 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sun, 19 Aug 2018 23:07:24 +0200
-Subject: [PATCH 2/4] Ignore usage bits verification
+Subject: [PATCH 2/2] Ignore usage bits verification
 
 This didn't ignore as of 8.1, so we're ""safe""
 ---
diff --git a/patches/platform_frameworks_native/0003-device-Huawei-HWC-doesn-t-understand-0-0-0-0-fullscr.patch b/patches/platform_frameworks_native/0003-device-Huawei-HWC-doesn-t-understand-0-0-0-0-fullscr.patch
deleted file mode 100644
index 31390aa..0000000
--- a/patches/platform_frameworks_native/0003-device-Huawei-HWC-doesn-t-understand-0-0-0-0-fullscr.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7a4b9b1613ee04fd71f3ed83e45ba0a5fd040dfb Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson <phh@phh.me>
-Date: Fri, 5 Jan 2018 00:26:38 +0100
-Subject: [PATCH 3/4] [device] ::Huawei:: HWC doesn't understand 0,0,0,0 ==
- fullscreen damage. Set it to the whole visible surface
-
-::Huawei:: Fix damage for Huawei compositor
-
-For Huawei compositor, the damage area is a region on the screen.
-But for SurfaceFlinger, this is a region on the source surface.
-On Huawei devices, do the plane conversion.
-
-This fixes several UI glitches, most notably GBoard.
----
- services/surfaceflinger/BufferLayer.cpp    | 8 +++++++-
- services/surfaceflinger/SurfaceFlinger.cpp | 8 ++++++++
- services/surfaceflinger/SurfaceFlinger.h   | 3 +++
- 3 files changed, 18 insertions(+), 1 deletion(-)
-
-diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
-index fda7906..80c72d9 100644
---- a/services/surfaceflinger/BufferLayer.cpp
-+++ b/services/surfaceflinger/BufferLayer.cpp
-@@ -631,7 +631,13 @@ void BufferLayer::setPerFrameData(const sp<const DisplayDevice>& displayDevice)
-         visible.dump(LOG_TAG);
-     }
- 
--    error = hwcLayer->setSurfaceDamage(surfaceDamageRegion);
-+    if(mFlinger->mDamageUsesScreenReference) {
-+        const auto& frame = hwcInfo.displayFrame;
-+        auto fullSource = Region(Rect(frame.left, frame.top, frame.right, frame.bottom));
-+        error = hwcLayer->setSurfaceDamage(fullSource);
-+    } else {
-+        error = hwcLayer->setSurfaceDamage(surfaceDamageRegion);
-+    }
-     if (error != HWC2::Error::None) {
-         ALOGE("[%s] Failed to set surface damage: %s (%d)", mName.string(),
-               to_string(error).c_str(), static_cast<int32_t>(error));
-diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
-index 87baf8c..729671d 100644
---- a/services/surfaceflinger/SurfaceFlinger.cpp
-+++ b/services/surfaceflinger/SurfaceFlinger.cpp
-@@ -350,6 +350,14 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) {
-         // for production purposes later on.
-         setenv("TREBLE_TESTING_OVERRIDE", "true", true);
-     }
-+
-+    property_get("ro.hardware", value, "");
-+    if(strstr(value, "hi3660")||
-+            strstr(value, "hi6250") ||
-+            strstr(value, "hi3670") ||
-+            strstr(value, "kirin970")) {
-+        mDamageUsesScreenReference = true;
-+    }
- }
- 
- void SurfaceFlinger::onFirstRef()
-diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
-index 8566b03..9b29bef 100644
---- a/services/surfaceflinger/SurfaceFlinger.h
-+++ b/services/surfaceflinger/SurfaceFlinger.h
-@@ -841,6 +841,9 @@ private:
-     // Restrict layers to use two buffers in their bufferqueues.
-     bool mLayerTripleBufferingDisabled = false;
- 
-+    bool mDamageUsesScreenReference;
-+
-+
-     // these are thread safe
-     mutable std::unique_ptr<MessageQueue> mEventQueue{std::make_unique<impl::MessageQueue>()};
-     FrameTracker mAnimFrameTracker;
--- 
-2.7.4
-
diff --git a/patches/platform_frameworks_native/0004-Enable-fallback-to-old-ro.sf.hwrotation-property.patch b/patches/platform_frameworks_native/0004-Enable-fallback-to-old-ro.sf.hwrotation-property.patch
deleted file mode 100644
index 658e08a..0000000
--- a/patches/platform_frameworks_native/0004-Enable-fallback-to-old-ro.sf.hwrotation-property.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From c1d5c4623ee96cc37299a7da3034b8e8a1e62e9d Mon Sep 17 00:00:00 2001
-From: phh <phh@phh.me>
-Date: Wed, 22 Aug 2018 08:57:52 +0000
-Subject: [PATCH 4/4] Enable fallback to old ro.sf.hwrotation property
-
----
- services/surfaceflinger/SurfaceFlinger.cpp | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
-diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
-index 729671d..f5bbae7 100644
---- a/services/surfaceflinger/SurfaceFlinger.cpp
-+++ b/services/surfaceflinger/SurfaceFlinger.cpp
-@@ -291,6 +291,24 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) {
-             mPrimaryDisplayOrientation = DisplayState::eOrientationDefault;
-             break;
-     }
-+
-+    if(primaryDisplayOrientation == V1_1::DisplayOrientation::ORIENTATION_0) {
-+        int sfRotation = property_get_int32("ro.sf.hwrotation", -1);
-+        switch(sfRotation) {
-+            case 0:
-+                mPrimaryDisplayOrientation = DisplayState::eOrientationDefault;
-+                break;
-+            case 90:
-+                mPrimaryDisplayOrientation = DisplayState::eOrientation90;
-+                break;
-+            case 180:
-+                mPrimaryDisplayOrientation = DisplayState::eOrientation180;
-+                break;
-+            case 270:
-+                mPrimaryDisplayOrientation = DisplayState::eOrientation270;
-+                break;
-+        }
-+    }
-     ALOGV("Primary Display Orientation is set to %2d.", mPrimaryDisplayOrientation);
- 
-     mPrimaryDispSync.init(SurfaceFlinger::hasSyncFramework, SurfaceFlinger::dispSyncPresentTimeOffset);
--- 
-2.7.4
-
diff --git a/patches/platform_system_bt/0001-Make-BTM_BYPASS_EXTRA_ACL_SETUP-dynamic.patch b/patches/platform_system_bt/0001-Make-BTM_BYPASS_EXTRA_ACL_SETUP-dynamic.patch
index 74d2277..b49e70a 100644
--- a/patches/platform_system_bt/0001-Make-BTM_BYPASS_EXTRA_ACL_SETUP-dynamic.patch
+++ b/patches/platform_system_bt/0001-Make-BTM_BYPASS_EXTRA_ACL_SETUP-dynamic.patch
@@ -1,4 +1,4 @@
-From c55023b50ae531a72fc644aa9a752fdc1cf3a1df Mon Sep 17 00:00:00 2001
+From 6db5219010250efed52f7a7c4330ca14f23477c7 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 20 Feb 2018 23:04:50 +0100
 Subject: [PATCH] Make BTM_BYPASS_EXTRA_ACL_SETUP dynamic
diff --git a/patches/platform_system_core/0001-Revert-logd-add-passcred-for-logdw-socket.patch b/patches/platform_system_core/0001-Revert-logd-add-passcred-for-logdw-socket.patch
index 232e5ae..01e630b 100644
--- a/patches/platform_system_core/0001-Revert-logd-add-passcred-for-logdw-socket.patch
+++ b/patches/platform_system_core/0001-Revert-logd-add-passcred-for-logdw-socket.patch
@@ -1,7 +1,7 @@
 From 7cb501499404c54c5600d321521b271d462443db Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Sun, 10 Dec 2017 00:26:21 +0100
-Subject: [PATCH 1/4] Revert "logd: add "+passcred" for logdw socket"
+Subject: [PATCH 1/5] Revert "logd: add "+passcred" for logdw socket"
 
 This reverts commit 54d8ff1121440d0ef4565ce0ab3751f82fdb393c.
 
diff --git a/patches/platform_system_core/0002-Some-kernel-crashes-when-using-too-recent-sdcardfs-o.patch b/patches/platform_system_core/0002-Some-kernel-crashes-when-using-too-recent-sdcardfs-o.patch
index cc777a4..a4b8c3a 100644
--- a/patches/platform_system_core/0002-Some-kernel-crashes-when-using-too-recent-sdcardfs-o.patch
+++ b/patches/platform_system_core/0002-Some-kernel-crashes-when-using-too-recent-sdcardfs-o.patch
@@ -1,7 +1,7 @@
 From bc1052bfd8747bbba7a6a903ebfcff07d88cb313 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 14 Aug 2018 19:33:03 +0200
-Subject: [PATCH 2/4] Some kernel crashes when using too recent sdcardfs
+Subject: [PATCH 2/5] Some kernel crashes when using too recent sdcardfs
  options. Force everyone to old options
 
 Change-Id: Ia5cf1aa8dc07a0f4a78b4d8f760ca0944dabaa89
diff --git a/patches/platform_system_core/0003-First-drop_privs-which-may-fail-and-only-run-thread-.patch b/patches/platform_system_core/0003-First-drop_privs-which-may-fail-and-only-run-thread-.patch
index 2c2f137..d42f9e1 100644
--- a/patches/platform_system_core/0003-First-drop_privs-which-may-fail-and-only-run-thread-.patch
+++ b/patches/platform_system_core/0003-First-drop_privs-which-may-fail-and-only-run-thread-.patch
@@ -1,7 +1,7 @@
 From 1d3c779b764c497a88c3b8652519a12ed5a70da1 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 14 Aug 2018 19:33:23 +0200
-Subject: [PATCH 3/4] First drop_privs (which may fail) and only run thread
+Subject: [PATCH 3/5] First drop_privs (which may fail) and only run thread
  that might be scheduled before us
 
 Change-Id: I118fb2d4beedbeecf5d3a8d255929d3be480b923
diff --git a/patches/platform_system_core/0004-Fix-Samsung-TS-suspend-by-reseting-it-when-waking-up.patch b/patches/platform_system_core/0004-Fix-Samsung-TS-suspend-by-reseting-it-when-waking-up.patch
index fc51951..c2c172e 100644
--- a/patches/platform_system_core/0004-Fix-Samsung-TS-suspend-by-reseting-it-when-waking-up.patch
+++ b/patches/platform_system_core/0004-Fix-Samsung-TS-suspend-by-reseting-it-when-waking-up.patch
@@ -1,7 +1,7 @@
 From 954a67616bd63aac1cb094117edbdfb2f04a405d Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Thu, 16 Aug 2018 22:29:11 +0200
-Subject: [PATCH 4/4] Fix Samsung TS suspend by reseting it when waking up
+Subject: [PATCH 4/5] Fix Samsung TS suspend by reseting it when waking up
 
 Change-Id: I5ee289dcb2347bedc96573bf16bc4c3d1f1b9de3
 ---
diff --git a/patches/platform_system_core/0005-Disable-Samsung-TS-on-sleep-not-reset.patch b/patches/platform_system_core/0005-Disable-Samsung-TS-on-sleep-not-reset.patch
new file mode 100644
index 0000000..8c86dad
--- /dev/null
+++ b/patches/platform_system_core/0005-Disable-Samsung-TS-on-sleep-not-reset.patch
@@ -0,0 +1,47 @@
+From 18233a42292c2c35c67ab080707a7f0afb70efe5 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson <phh@phh.me>
+Date: Tue, 4 Sep 2018 00:23:05 +0200
+Subject: [PATCH 5/5] Disable Samsung TS on sleep, not reset
+
+Change-Id: I10ba2ab437396de92535517e856e52bc7196b860
+---
+ libsuspend/autosuspend_wakeup_count.cpp | 15 +++++----------
+ 1 file changed, 5 insertions(+), 10 deletions(-)
+
+diff --git a/libsuspend/autosuspend_wakeup_count.cpp b/libsuspend/autosuspend_wakeup_count.cpp
+index 1624866..890bb1a 100644
+--- a/libsuspend/autosuspend_wakeup_count.cpp
++++ b/libsuspend/autosuspend_wakeup_count.cpp
+@@ -70,7 +70,7 @@ static std::string samsung_touchscreen_enabled() {
+ }
+ 
+ static bool samsung_touchscreen_set(const std::string& path, bool enable) {
+-	LOG(INFO) << "Setting samsung to path " << path;
++	LOG(INFO) << "Setting samsung to path " << path << ":" << enable;
+ 	return android::base::WriteStringToFile(enable ? "1" : "0", path);
+ }
+ 
+@@ -116,16 +116,11 @@ static void* suspend_thread_func(void* arg __attribute__((unused))) {
+         LOG(VERBOSE) << "write " << wakeup_count << " to wakeup_count";
+         if (WriteStringToFd(wakeup_count, wakeup_count_fd)) {
+             LOG(VERBOSE) << "write " << sleep_state << " to " << sys_power_state;
++            if(samsungTs != "")
++                samsung_touchscreen_set(samsungTs, 0);
+             success = WriteStringToFd(sleep_state, state_fd);
+-
+-            if(success) {
+-                if(samsungTs != "") {
+-                    LOG(INFO) << "Resetting Samsung TS";
+-                    samsung_touchscreen_set(samsungTs, 0);
+-                    for(int i=0; i<10 && !samsung_touchscreen_set(samsungTs, 1); i++)
+-                        LOG(INFO) << "Resetting Samsung TS: try " << i;
+-                }
+-            }
++            if(samsungTs != "")
++                samsung_touchscreen_set(samsungTs, 1);
+ 
+             void (*func)(bool success) = wakeup_func;
+             if (func != NULL) {
+-- 
+2.7.4
+
diff --git a/patches/platform_system_sepolicy/0001-Don-t-set-esdfs-or-exfat-genfscon.-Assume-OEM-does.patch b/patches/platform_system_sepolicy/0001-Don-t-set-esdfs-or-exfat-genfscon.-Assume-OEM-does.patch
index 184afe4..d08d064 100644
--- a/patches/platform_system_sepolicy/0001-Don-t-set-esdfs-or-exfat-genfscon.-Assume-OEM-does.patch
+++ b/patches/platform_system_sepolicy/0001-Don-t-set-esdfs-or-exfat-genfscon.-Assume-OEM-does.patch
@@ -1,4 +1,4 @@
-From 46578b3b71aeb1de3a1d98177a8ead86a194afc5 Mon Sep 17 00:00:00 2001
+From 9b286a251bca055033092aa93bab1ad025469478 Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Tue, 14 Aug 2018 20:56:54 +0200
 Subject: [PATCH 1/2] Don't set esdfs or exfat genfscon. Assume OEM does
diff --git a/patches/platform_system_sepolicy/0002-Relax-proc-read-from-ueventd-huawei-needs-it.patch b/patches/platform_system_sepolicy/0002-Relax-proc-read-from-ueventd-huawei-needs-it.patch
index 077b878..7e59b2e 100644
--- a/patches/platform_system_sepolicy/0002-Relax-proc-read-from-ueventd-huawei-needs-it.patch
+++ b/patches/platform_system_sepolicy/0002-Relax-proc-read-from-ueventd-huawei-needs-it.patch
@@ -1,4 +1,4 @@
-From ba947f13165df3081572a680009157bfb0827752 Mon Sep 17 00:00:00 2001
+From d47f885779df648b149d2b061603c56bf4a50c2c Mon Sep 17 00:00:00 2001
 From: Pierre-Hugues Husson <phh@phh.me>
 Date: Wed, 15 Aug 2018 12:27:21 +0200
 Subject: [PATCH 2/2] Relax /proc read from ueventd, huawei needs it