Compare commits

..

2 commits

5 changed files with 48 additions and 49 deletions

View file

@ -1,4 +1,4 @@
From 13537c3a17b60050d431d7d5b9dbfc591ee41762 Mon Sep 17 00:00:00 2001
From 7222eae1b450166edb709164eaa060d50df0284c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 19 Feb 2022 08:20:25 -0500
Subject: [PATCH] Add new mechanism to fake vendor props on a per-process basis
@ -17,7 +17,7 @@ Squashed: Rework property overriding
1 file changed, 79 insertions(+), 2 deletions(-)
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 9dd5e35ce..4524f8410 100644
index e0d38a8..4f54885 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -36,6 +36,8 @@
@ -109,7 +109,7 @@ index 9dd5e35ce..4524f8410 100644
static bool is_dir(const char* pathname) {
struct stat info;
if (stat(pathname, &info) == -1) {
@@ -156,17 +231,19 @@ uint32_t SystemProperties::AreaSerial() {
@@ -160,17 +235,19 @@ uint32_t SystemProperties::AreaSerial() {
}
const prop_info* SystemProperties::Find(const char* name) {
@ -132,5 +132,5 @@ index 9dd5e35ce..4524f8410 100644
static bool is_appcompat_override(const char* name) {
--
2.43.1
2.44.0

View file

@ -1,4 +1,4 @@
From a4c4caca86ecfe7f0dfce67fc479f9777be26410 Mon Sep 17 00:00:00 2001
From e164e6032a9df3bf8814cdb8d6267b1c5663687f Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 10:41:29 -0400
Subject: [PATCH 1/2] gd: hci: Ignore unexpected status events
@ -9,31 +9,30 @@ 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(-)
system/gd/hci/hci_layer.cc | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc
index 5ae661cb75..d91bb1480d 100644
index fe5fa33..9c411fb 100644
--- a/system/gd/hci/hci_layer.cc
+++ b/system/gd/hci/hci_layer.cc
@@ -218,14 +218,13 @@ struct HciLayer::impl {
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(
std::move(command_complete_view));
@@ -230,13 +230,13 @@ struct HciLayer::impl {
command_complete_view.IsValid(), "assert failed: command_complete_view.IsValid()");
(*command_queue_.front().GetCallback<CommandCompleteView>())(command_complete_view);
} else {
- ASSERT_LOG(
- log::assert_that(
- 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());
- "{} was not expecting {} event",
- OpCodeText(op_code),
- logging_id);
-
- command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
- (*command_queue_.front().GetCallback<TResponse>())(std::move(response_view));
+ if (command_queue_.front().waiting_for_status_ == is_status) {
+ command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
+ (*command_queue_.front().GetCallback<TResponse>())(std::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(std::move(command_complete_view));
+ (*command_queue_.front().GetCallback<CommandCompleteView>())(std::move(command_complete_view));
+ }
}

View file

@ -1,4 +1,4 @@
From 16e6571d11f6a2509a496e84e0d08ebae3b39254 Mon Sep 17 00:00:00 2001
From 63b517cc58a937ba43ff7fe2527990b4b532521d Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 15:45:18 -0400
Subject: [PATCH 2/2] audio_hal_interface: Optionally use sysbta HAL
@ -13,10 +13,10 @@ Change-Id: I59973e6ec84c5923be8a7c67b36b2e237f000860
3 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc
index 76e8788d02..a990422993 100644
index f4cfee0..f98032e 100644
--- a/system/audio_hal_interface/aidl/client_interface_aidl.cc
+++ b/system/audio_hal_interface/aidl/client_interface_aidl.cc
@@ -63,7 +63,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface(
@@ -68,7 +68,7 @@ bool BluetoothAudioClientInterface::IsValid() const {
bool BluetoothAudioClientInterface::is_aidl_available() {
return AServiceManager_isDeclared(
@ -25,7 +25,7 @@ index 76e8788d02..a990422993 100644
}
std::vector<AudioCapabilities>
@@ -79,7 +79,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {
@@ -84,7 +84,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {
}
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
@ -33,8 +33,8 @@ index 76e8788d02..a990422993 100644
+ audioProviderFactoryInterface().c_str())));
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get capability from unknown factory";
@@ -108,7 +108,7 @@ BluetoothAudioClientInterface::GetProviderInfo(
log::error("can't get capability from unknown factory");
@@ -112,7 +112,7 @@ BluetoothAudioClientInterface::GetProviderInfo(
if (provider_factory == nullptr) {
provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
@ -43,7 +43,7 @@ index 76e8788d02..a990422993 100644
}
if (provider_factory == nullptr) {
@@ -192,7 +192,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
@@ -193,7 +193,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
}
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
@ -51,20 +51,20 @@ index 76e8788d02..a990422993 100644
+ audioProviderFactoryInterface().c_str())));
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get capability from unknown factory";
log::error("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 c191e4054e..99d5192376 100644
index 9b92319..643507e 100644
--- a/system/audio_hal_interface/aidl/client_interface_aidl.h
+++ b/system/audio_hal_interface/aidl/client_interface_aidl.h
@@ -27,6 +27,7 @@
#include "audio_ctrl_ack.h"
#include "bluetooth_audio_port_impl.h"
@@ -29,6 +29,7 @@
#include "bta/le_audio/broadcaster/broadcaster_types.h"
#include "bta/le_audio/le_audio_types.h"
#include "transport_instance.h"
+#include "osi/include/properties.h"
#define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \
"persist.bluetooth.bluetooth_audio_hal.disabled"
@@ -175,6 +176,12 @@ class BluetoothAudioClientInterface {
@@ -177,6 +178,12 @@ class BluetoothAudioClientInterface {
// "android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default";
static inline const std::string kDefaultAudioProviderFactoryInterface =
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
@ -78,18 +78,18 @@ index c191e4054e..99d5192376 100644
private:
IBluetoothTransportInstance* transport_;
diff --git a/system/audio_hal_interface/hal_version_manager.cc b/system/audio_hal_interface/hal_version_manager.cc
index 36672cb32c..d2b75e7891 100644
index c4e01bc..55ef87b 100644
--- a/system/audio_hal_interface/hal_version_manager.cc
+++ b/system/audio_hal_interface/hal_version_manager.cc
@@ -26,6 +26,7 @@
#include "aidl/audio_aidl_interfaces.h"
#include "include/check.h"
#include "os/log.h"
@@ -20,6 +20,7 @@
#include <android/hidl/manager/1.2/IServiceManager.h>
#include <bluetooth/log.h>
#include <hidl/ServiceManagement.h>
+#include "osi/include/properties.h"
namespace bluetooth {
namespace audio {
@@ -35,6 +36,12 @@ using ::aidl::android::hardware::bluetooth::audio::
#include <memory>
@@ -34,6 +35,12 @@ using ::aidl::android::hardware::bluetooth::audio::
static const std::string kDefaultAudioProviderFactoryInterface =
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
@ -102,7 +102,7 @@ index 36672cb32c..d2b75e7891 100644
std::string toString(BluetoothAudioHalTransport transport) {
switch (transport) {
@@ -76,7 +83,7 @@ BluetoothAudioHalVersion GetAidlInterfaceVersion() {
@@ -75,7 +82,7 @@ BluetoothAudioHalVersion GetAidlInterfaceVersion() {
int version = 0;
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
@ -110,8 +110,8 @@ index 36672cb32c..d2b75e7891 100644
+ audioProviderFactoryInterface().c_str())));
if (provider_factory == nullptr) {
LOG_ERROR(
@@ -146,7 +153,7 @@ HalVersionManager::GetProvidersFactory_2_0() {
log::error(
@@ -147,7 +154,7 @@ HalVersionManager::GetProvidersFactory_2_0() {
HalVersionManager::HalVersionManager() {
hal_transport_ = BluetoothAudioHalTransport::UNKNOWN;
if (AServiceManager_checkService(

View file

@ -1,4 +1,4 @@
From 5452f9228873c2e00897aeb74e8b453d939d2e4c Mon Sep 17 00:00:00 2001
From 54428255201c9f02f4827961ad077c74ff126860 Mon Sep 17 00:00:00 2001
From: Isaac Chen <tingyi364@gmail.com>
Date: Wed, 23 Jun 2021 13:07:30 +0800
Subject: [PATCH 1/2] init: Do not start console service when debuggable
@ -13,10 +13,10 @@ Change-Id: I34cfd6b42d3b9aee4b3e63181480cfb8b1255f29
1 file changed, 3 deletions(-)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 8a2ed9fac..960534805 100644
index 2443b7c..06cb386 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -1306,9 +1306,6 @@ on property:ro.debuggable=1
@@ -1317,9 +1317,6 @@ on property:ro.debuggable=1
# Give reads to anyone for the accessibility trace folder on debug builds.
chmod 0775 /data/misc/a11ytrace

View file

@ -1,4 +1,4 @@
From ddaa66e3cdc62f065143b1a8eb3f06bec65ff651 Mon Sep 17 00:00:00 2001
From 18b70443969bec36e1f8551b6f67a762df5fc210 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 23 Feb 2022 17:37:47 -0500
Subject: [PATCH 2/2] init: Override select system properties
@ -11,10 +11,10 @@ Change-Id: I94efa3f108ae97711026f099f367b6bea325629f
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 157fc709c..7ec3c0b10 100644
index 0d6eb15..16e0448 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -797,13 +797,20 @@ static void LoadProperties(char* data, const char* filter, const char* filename,
@@ -801,13 +801,20 @@ static void LoadProperties(char* data, const char* filter, const char* filename,
std::string error;
if (CheckPermissions(key, value, context, cr, &error) == PROP_SUCCESS) {
auto it = properties->find(key);