patches: Bliss GSI v11.4 Release

Signed-off-by: Jackeagle <jackeagle102@gmail.com>
Change-Id: I372e872292ed19dde130635da2882309751f59dd
diff --git a/patches/frameworks/av/0001-FIH-devices-Fix-Earpiece-audio-output.patch b/patches/frameworks/av/0001-FIH-devices-Fix-Earpiece-audio-output.patch
deleted file mode 100644
index 469972e..0000000
--- a/patches/frameworks/av/0001-FIH-devices-Fix-Earpiece-audio-output.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From bbfa6e68621509f98286a857d1c843157906b104 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
-
-On some FIH devices (confirmed on Razer, and probably on Aquos SS2),
-Earpiece is not listed in attachedDevices, and devicePort's profile
-mentions it is AUDIO_CHANNEL_IN_MONO, instead of AUDIO_CHANNEL_OUT_MONO.
-
-Detect such cases (output device, but got only AUDIO_CHANNEL_IN_MONO),
-and fix both channelMasks and attachedDevices
-
-Change-Id: I4a88ba6d34d0fcd346eeea2ca903772f0271040a
----
- .../managerdefinitions/src/Serializer.cpp     | 25 ++++++++++++++++---
- 1 file changed, 22 insertions(+), 3 deletions(-)
-
-diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-index a2531131d5..380e2f82bc 100644
---- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-@@ -191,16 +191,25 @@ const char AudioProfileTraits::Attributes::name[] = "name";
- const char AudioProfileTraits::Attributes::samplingRates[] = "samplingRates";
- const char AudioProfileTraits::Attributes::format[] = "format";
- const char AudioProfileTraits::Attributes::channelMasks[] = "channelMasks";
-+static bool fixedEarpieceChannels = false;
- 
- status_t AudioProfileTraits::deserialize(_xmlDoc */*doc*/, const _xmlNode *root, PtrElement &profile,
--                                         PtrSerializingCtx /*serializingContext*/)
-+                                         PtrSerializingCtx serializingContext)
- {
-+    bool isOutput = serializingContext != nullptr;
-     string samplingRates = getXmlAttribute(root, Attributes::samplingRates);
-     string format = getXmlAttribute(root, Attributes::format);
-     string channels = getXmlAttribute(root, Attributes::channelMasks);
-+    ChannelTraits::Collection channelsMask = channelMasksFromString(channels, ",");
-+
-+    //Some Foxconn devices have wrong earpiece channel mask, leading to no channel mask
-+    if(channelsMask.size() == 1 && channelsMask[0] == AUDIO_CHANNEL_IN_MONO && isOutput) {
-+        fixedEarpieceChannels = true;
-+        channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
-+    }
- 
-     profile = new Element(formatFromString(format, gDynamicFormat),
--                          channelMasksFromString(channels, ","),
-+                          channelsMask,
-                           samplingRatesFromString(samplingRates, ","));
- 
-     profile->setDynamicFormat(profile->getFormat() == gDynamicFormat);
-@@ -326,7 +335,10 @@ status_t DevicePortTraits::deserialize(_xmlDoc *doc, const _xmlNode *root, PtrEl
-     }
- 
-     AudioProfileTraits::Collection profiles;
--    deserializeCollection<AudioProfileTraits>(doc, root, profiles, NULL);
-+    if(audio_is_output_devices(type))
-+        deserializeCollection<AudioProfileTraits>(doc, root, profiles, (PtrSerializingCtx)1);
-+    else
-+        deserializeCollection<AudioProfileTraits>(doc, root, profiles, NULL);
-     if (profiles.isEmpty()) {
-         sp <AudioProfile> dynamicProfile = new AudioProfile(gDynamicFormat,
-                                                             ChannelsVector(), SampleRateVector());
-@@ -491,6 +503,13 @@ status_t ModuleTraits::deserialize(xmlDocPtr doc, const xmlNode *root, PtrElemen
-         }
-         children = children->next;
-     }
-+    if(fixedEarpieceChannels) {
-+        sp<DeviceDescriptor> device =
-+            module->getDeclaredDevices().getDeviceFromTagName(String8("Earpiece"));
-+	if(device != 0)
-+		ctx->addAvailableDevice(device);
-+	fixedEarpieceChannels = false;
-+    }
-     return NO_ERROR;
- }
- 
--- 
-2.17.1
-
diff --git a/patches/frameworks/av/0002-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch b/patches/frameworks/av/0001-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
similarity index 86%
rename from patches/frameworks/av/0002-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
rename to patches/frameworks/av/0001-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
index 45141ae..7956f31 100644
--- a/patches/frameworks/av/0002-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
+++ b/patches/frameworks/av/0001-Fix-WiFi-Display-on-Huawei-devices-EMUI-8.0.patch
@@ -1,7 +1,7 @@
-From f4a99cd7019aeb212011c6245069964291fadc21 Mon Sep 17 00:00:00 2001
+From b9e258cfe892a47a55d8055896c4ce1729188674 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)
+Subject: [PATCH 1/3] Fix WiFi-Display on Huawei devices (EMUI 8.0)
 
 Huaweis media stack doesn't handle intra-refresh-mode, so skip the error instead.
 
@@ -11,7 +11,7 @@
  1 file changed, 2 insertions(+), 3 deletions(-)
 
 diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
-index 8949daecd3..fbee52b8e7 100644
+index 8949daecd..fbee52b8e 100644
 --- a/media/libstagefright/ACodec.cpp
 +++ b/media/libstagefright/ACodec.cpp
 @@ -4279,9 +4279,8 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) {
diff --git a/patches/frameworks/av/0003-Kirin-Remove-lock-to-prevent-self-lock.patch b/patches/frameworks/av/0002-Kirin-Remove-lock-to-prevent-self-lock.patch
similarity index 87%
rename from patches/frameworks/av/0003-Kirin-Remove-lock-to-prevent-self-lock.patch
rename to patches/frameworks/av/0002-Kirin-Remove-lock-to-prevent-self-lock.patch
index 5b71dd1..145f960 100644
--- a/patches/frameworks/av/0003-Kirin-Remove-lock-to-prevent-self-lock.patch
+++ b/patches/frameworks/av/0002-Kirin-Remove-lock-to-prevent-self-lock.patch
@@ -1,7 +1,7 @@
-From e49a2aaf5937eceff7ab9e220a4840296db766bd Mon Sep 17 00:00:00 2001
+From 3d3c5c2cf4a520aff26537e81f054632629891af 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
+Subject: [PATCH 2/3] Kirin:: Remove lock to prevent self-lock
 
 With Huawei Camera HAL, we get the following call order:
 cameraserver CameraService::enumerateProviders (*)
@@ -17,7 +17,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
-index fb740053e8..b62d22080b 100644
+index 5d3167e4a..1f9e1e28f 100644
 --- a/services/camera/libcameraservice/CameraService.cpp
 +++ b/services/camera/libcameraservice/CameraService.cpp
 @@ -233,7 +233,7 @@ void CameraService::onNewProviderRegistered() {
diff --git a/patches/frameworks/av/0004-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch b/patches/frameworks/av/0003-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
similarity index 83%
rename from patches/frameworks/av/0004-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
rename to patches/frameworks/av/0003-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
index b7b1488..5b7c6a8 100644
--- a/patches/frameworks/av/0004-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
+++ b/patches/frameworks/av/0003-We-might-not-have-a-mFlashlight-at-this-state-but-th.patch
@@ -1,7 +1,7 @@
-From e5c496ab9a64a05809a7149b047c8160395aff2b Mon Sep 17 00:00:00 2001
+From 04f8398627aee21e86629ca26e22736f76c9eeab 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
+Subject: [PATCH 3/3] We might not have a mFlashlight at this state, but that's
  ok
 
 ---
@@ -9,7 +9,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
-index b62d22080b..0f2c4cac70 100644
+index 1f9e1e28f..93a0f55e9 100644
 --- a/services/camera/libcameraservice/CameraService.cpp
 +++ b/services/camera/libcameraservice/CameraService.cpp
 @@ -258,7 +258,7 @@ void CameraService::addStates(const String8 id) {