From 24ea961dc7494474ba0972c18677239724c36496 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Tue, 9 May 2023 00:45:03 +0000 Subject: [PATCH 1/2] Support CICPs in AImageDecoder CICPs will be supported in SkAndroidCodec, but AImageDecoder uses ImageDecoder::getDefaultColorSpace instead, which has subtly different handling for wide color ICC profiles. So make AImageDecoder use SkAndroidCodec::computeOutputColorSpace directly when there is CICP data. Bug: 279811818 Test: AImageDecoderTests Change-Id: I3a720e391cb19872c9e3e9182a86322b1c0e7ad1 --- libs/hwui/hwui/ImageDecoder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/hwui/hwui/ImageDecoder.cpp b/libs/hwui/hwui/ImageDecoder.cpp index 9a06be006dca4..701a87f0cce42 100644 --- a/libs/hwui/hwui/ImageDecoder.cpp +++ b/libs/hwui/hwui/ImageDecoder.cpp @@ -51,6 +51,9 @@ using namespace android; sk_sp ImageDecoder::getDefaultColorSpace() const { const skcms_ICCProfile* encodedProfile = mCodec->getICCProfile(); if (encodedProfile) { + if (encodedProfile->has_CICP) { + return mCodec->computeOutputColorSpace(kN32_SkColorType); + } // If the profile maps directly to an SkColorSpace, that SkColorSpace // will be returned. Otherwise, nullptr will be returned. In either // case, using this SkColorSpace results in doing no color correction. From 5b97250dca543c2126a08f33b027898705dab1eb Mon Sep 17 00:00:00 2001 From: chiachangwang Date: Thu, 11 May 2023 02:42:59 +0000 Subject: [PATCH 2/2] Change default IP protocol preference from AUTO to IPV4 By default, PREFERRED_IKE_PROTOCOL_IPV4_UDP is used for safety. This is because some carriers' networks do not support IPv6 very well, and using IPv4 can help to prevent problems. Carrierconfig customization on the device should override the value if V6 are known to work well. Bug: 269714970 Test: atest FrameworksNetTests (cherry picked from https://android-review.googlesource.com/q/commit:4a3406799000e8f81b4b54cd8ba43bd8f8bd029b) Merged-In: Ia0a6bd11d25fd67edb0a301e81626ec4f174155a Change-Id: Ia0a6bd11d25fd67edb0a301e81626ec4f174155a --- .../core/java/com/android/server/connectivity/Vpn.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index c678a92af13af..4208a12f91d4b 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -3677,8 +3677,11 @@ public class Vpn { encapType = IkeSessionParams.ESP_ENCAP_TYPE_NONE; break; default: - ipVersion = IkeSessionParams.ESP_IP_VERSION_AUTO; - encapType = IkeSessionParams.ESP_ENCAP_TYPE_AUTO; + // By default, PREFERRED_IKE_PROTOCOL_IPV4_UDP is used for safety. This is + // because some carriers' networks do not support IPv6 very well, and using + // IPv4 can help to prevent problems. + ipVersion = IkeSessionParams.ESP_IP_VERSION_IPV4; + encapType = IkeSessionParams.ESP_ENCAP_TYPE_UDP; break; } return new CarrierConfigInfo(mccMnc, natKeepalive, encapType, ipVersion);