Changes for February 2023

This commit is contained in:
Andy CrossGate Yan
2023-02-14 13:48:39 +00:00
parent 291d57d10a
commit 4bc5076d1c
29 changed files with 1147 additions and 343 deletions

View File

@@ -1,57 +0,0 @@
From a1d10cb31ae386c01a66c8bf0a028b8f33e5bd32 Mon Sep 17 00:00:00 2001
From: "tzu-hsien.huang" <tzu-hsien.huang@mediatek.com>
Date: Wed, 20 Jul 2022 15:12:01 +0800
Subject: [PATCH 1/3] Additionally check le_set_event_mask command resturn
status with UNSUPPORTED_LMP_OR_LL_PARAMETER
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In GD BT stack, stack will check each return status of HCI Commands. E.g. reset , le_set_event_mask, set_event_mask …etc.
In BT spec 5.2, SIG add some parameters for le_set_event_mask for le audio, like LE Terminate BIG Complete event: Supported.
However, some legacy chips do not support LE Audio feature, and controller will return Status: Unsupported LMP Parameter Value when it receives this HCI Command
When it checks the return value and find the status is not SUCCESS, it will cause FAIL and cannot be compatible with old legacy chip.
After brushing GSI, Bluetooth will turn off automatically when it is turned on.
So all CTS test will always fail.
Check le_set_event_mask command return status with SUCCESS or UNSUPPORTED_LMP_OR_LL_PARAMETER
Bug: 239662211
Test: CtsBluetoothTestCases
Change-Id: I2b0cede7f47eecd2124a386e958773289eb6f11c
---
system/gd/hci/controller.cc | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
index da5986fcb7..8be21a20a3 100644
--- a/system/gd/hci/controller.cc
+++ b/system/gd/hci/controller.cc
@@ -540,7 +540,7 @@ struct Controller::impl {
void le_set_event_mask(uint64_t le_event_mask) {
std::unique_ptr<LeSetEventMaskBuilder> packet = LeSetEventMaskBuilder::Create(le_event_mask);
hci_->EnqueueCommand(std::move(packet), module_.GetHandler()->BindOnceOn(
- this, &Controller::impl::check_status<LeSetEventMaskCompleteView>));
+ this, &Controller::impl::check_event_mask_status<LeSetEventMaskCompleteView>));
}
template <class T>
@@ -551,6 +551,15 @@ struct Controller::impl {
ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS);
}
+ template <class T>
+ void check_event_mask_status(CommandCompleteView view) {
+ ASSERT(view.IsValid());
+ auto status_view = T::Create(view);
+ ASSERT(status_view.IsValid());
+ ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS ||
+ status_view.GetStatus() == ErrorCode::UNSUPPORTED_LMP_OR_LL_PARAMETER);
+ }
+
#define OP_CODE_MAPPING(name) \
case OpCode::name: { \
uint16_t index = (uint16_t)OpCodeIndex::name; \
--
2.37.2

View File

@@ -1,7 +1,7 @@
From cad9f7f7aeaf57e5fead759bcc68b75262ba3708 Mon Sep 17 00:00:00 2001
From 6d9740fc670b43077791f3880be05bb81cb1c38e Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 15:45:18 -0400
Subject: [PATCH 3/3] audio_hal_interface: Optionally use sysbta HAL
Subject: [PATCH] audio_hal_interface: Optionally use sysbta HAL
Required to support sysbta, our system-side bt audio implementation.
@@ -13,10 +13,10 @@ Change-Id: I59973e6ec84c5923be8a7c67b36b2e237f000860
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc
index 814c6c7796..a38b6da495 100644
index efdc469de4..3dd65b5394 100644
--- a/system/audio_hal_interface/aidl/client_interface_aidl.cc
+++ b/system/audio_hal_interface/aidl/client_interface_aidl.cc
@@ -55,7 +55,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface(
@@ -56,7 +56,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface(
bool BluetoothAudioClientInterface::is_aidl_available() {
auto service = AServiceManager_checkService(
@@ -25,7 +25,7 @@ index 814c6c7796..a38b6da495 100644
return (service != nullptr);
}
@@ -72,7 +72,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {
@@ -73,7 +73,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {
}
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_getService(
@@ -34,7 +34,7 @@ index 814c6c7796..a38b6da495 100644
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get capability from unknown factory";
@@ -100,7 +100,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
@@ -101,7 +101,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
}
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_getService(
@@ -44,7 +44,7 @@ index 814c6c7796..a38b6da495 100644
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get capability from unknown factory";
diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.h b/system/audio_hal_interface/aidl/client_interface_aidl.h
index 87dd450997..36d5fa5e86 100644
index 17abefe8fe..07dd11266f 100644
--- a/system/audio_hal_interface/aidl/client_interface_aidl.h
+++ b/system/audio_hal_interface/aidl/client_interface_aidl.h
@@ -28,6 +28,7 @@
@@ -55,7 +55,7 @@ index 87dd450997..36d5fa5e86 100644
#define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \
"persist.bluetooth.bluetooth_audio_hal.disabled"
@@ -115,6 +116,12 @@ class BluetoothAudioClientInterface {
@@ -117,6 +118,12 @@ class BluetoothAudioClientInterface {
// "android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default";
static inline const std::string kDefaultAudioProviderFactoryInterface =
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
@@ -103,5 +103,5 @@ index a2c192f37d..c3d1cf35c2 100644
return;
}
--
2.37.2
2.25.1

View File

@@ -1,43 +0,0 @@
From 0e2bf3f3d46efaa7d01d3554b7e5ceeac9664c69 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 10:41:29 -0400
Subject: [PATCH 2/3] gd: hci: Ignore unexpected status events
For some reason, on some old devices, the controller will report a
remote to support SNIFF_SUBRATING even when it does not. Just ignore the
error here (the status event comes from the failure response).
Change-Id: Ifb9a65fd77f21d15a8dc1ced9240194d38218ef6
---
system/gd/hci/hci_layer.cc | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc
index 57d7e55fff..b5a9d065be 100644
--- a/system/gd/hci/hci_layer.cc
+++ b/system/gd/hci/hci_layer.cc
@@ -195,14 +195,13 @@ struct HciLayer::impl {
EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(move(command_complete_view));
} else {
- ASSERT_LOG(
- command_queue_.front().waiting_for_status_ == is_status,
- "0x%02hx (%s) was not expecting %s event",
- op_code,
- OpCodeText(op_code).c_str(),
- logging_id.c_str());
-
- command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
+ if (command_queue_.front().waiting_for_status_ == is_status) {
+ command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
+ } else {
+ CommandCompleteView command_complete_view = CommandCompleteView::Create(
+ EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
+ command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(move(command_complete_view));
+ }
}
command_queue_.pop_front();
--
2.37.2

View File

@@ -1,4 +1,4 @@
From 1614817aa551569818e7d3f09e0ddbc8ac4cf796 Mon Sep 17 00:00:00 2001
From 563510f6f9c387d14055a17673d6812db6843f41 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 21 Sep 2022 13:36:07 +0000
Subject: [PATCH 1/2] Exclude TrebleApp & co.
@@ -9,7 +9,7 @@ Change-Id: Ieb62801a79c6e015634fd58b654c63c1de5aef7e
1 file changed, 3 deletions(-)
diff --git a/overlay.mk b/overlay.mk
index 80b1ff4..10c8855 100644
index 9a7a31e..e71c479 100644
--- a/overlay.mk
+++ b/overlay.mk
@@ -1,7 +1,4 @@

View File

@@ -1,4 +1,4 @@
From 93192b8e62ac4a9ac9dd8241793830ceb063a4b8 Mon Sep 17 00:00:00 2001
From a08b8d0b89937d9ce8c50e339fd089bd2da44075 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 11 Oct 2022 10:53:34 +0000
Subject: [PATCH 2/2] Enable IMS overlays statically on QCOM/MTK devices
@@ -9,13 +9,11 @@ Change-Id: I851cf859328cc431e8bb163297c33837d4270f58
CAF-IMS/res/values/config.xml | 4 ++--
MTK-IMS/AndroidManifest.xml | 8 ++++----
MTK-IMS/res/values/config.xml | 8 +++++---
Telephony/CAF-IMS/Android.mk | 2 ++
Telephony/CAF-IMS/AndroidManifest.xml | 6 ++++--
Telephony/CAF-IMS/res/values/config.xml | 2 +-
Telephony/MTK-IMS/Android.mk | 2 ++
Telephony/MTK-IMS/AndroidManifest.xml | 6 ++++--
Telephony/MTK-IMS/res/values/config.xml | 3 +--
10 files changed, 29 insertions(+), 20 deletions(-)
8 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/CAF-IMS/AndroidManifest.xml b/CAF-IMS/AndroidManifest.xml
index 47236c6..5376fb8 100644
@@ -81,18 +79,6 @@ index f5e0486..2d49a11 100644
+ <bool name="config_device_volte_available">true</bool>
+ <bool name="config_device_wfc_ims_available">true</bool>
</resources>
diff --git a/Telephony/CAF-IMS/Android.mk b/Telephony/CAF-IMS/Android.mk
index 7785cc3..416f501 100644
--- a/Telephony/CAF-IMS/Android.mk
+++ b/Telephony/CAF-IMS/Android.mk
@@ -2,5 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-telephony-caf-ims
+LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/overlay
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_PRIVATE_PLATFORM_APIS := true
include $(BUILD_PACKAGE)
diff --git a/Telephony/CAF-IMS/AndroidManifest.xml b/Telephony/CAF-IMS/AndroidManifest.xml
index 2267406..365525c 100644
--- a/Telephony/CAF-IMS/AndroidManifest.xml
@@ -118,18 +104,6 @@ index 565ee42..ddf685d 100644
- <string name="config_ims_mmtel_package">org.codeaurora.ims</string>
+ <string name="config_ims_mmtel_package">org.codeaurora.ims</string>
</resources>
diff --git a/Telephony/MTK-IMS/Android.mk b/Telephony/MTK-IMS/Android.mk
index 314b1a9..d08cb5a 100644
--- a/Telephony/MTK-IMS/Android.mk
+++ b/Telephony/MTK-IMS/Android.mk
@@ -2,5 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-telephony-mtk-ims
+LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/overlay
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_PRIVATE_PLATFORM_APIS := true
include $(BUILD_PACKAGE)
diff --git a/Telephony/MTK-IMS/AndroidManifest.xml b/Telephony/MTK-IMS/AndroidManifest.xml
index 5afe885..644d06b 100644
--- a/Telephony/MTK-IMS/AndroidManifest.xml