Compare commits

..

12 commits
sc ... sc-v2

Author SHA1 Message Date
216e24536a build OpenEUICC package 2022-08-01 15:45:10 -04:00
f7df65f03b sepolicy: Address qmipriod denials on Xperia 5 II 2022-06-04 09:34:39 -04:00
1ea8d32986 device.mk: Include our UnifiedNlp v2 app
This should be added as a prebuilt in vendor/foss.
2022-06-02 22:59:49 -04:00
ceedb72c33 init_gsi: Disable A2DP offload on qcom 2022-06-01 23:01:17 -04:00
fededa5f79 init_gsi: Add qcom caf audio quirks
Force-disabling A2DP offloading is not implemented yet.
2022-06-01 22:40:48 -04:00
6229eb6fea init_gsi: implement phh's qemu.hw.keys persistent prop 2022-05-30 16:39:55 -04:00
aec3bfb881 init_gsi: run SPL prop spoofing on late-init instead of post-fs
This fixes a potential race between starting init_gsi and vold / vdc /
keystore / keymaster... which could cause havoc if the TEE
implementation is stringent on SPL.
2022-05-30 15:59:47 -04:00
fa8948b1aa Enable eSIM capability by default 2022-05-02 15:56:52 -04:00
993b44722a Remove space reservation
This does not work properly. Let's use the overlayfs-based `adb
remount`.
2022-04-28 21:06:39 -04:00
b6e10d232d Expand system image again along with inode count 2022-04-28 20:52:07 -04:00
ef16ca5e23 reserve 100MB of unused space in system image 2022-04-28 18:31:56 -04:00
3aa8526acc unset PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT 2022-04-16 16:03:18 -04:00
9 changed files with 79 additions and 9 deletions

View file

@ -13,6 +13,9 @@ $(call inherit-product, device/generic/common/gsi_product.mk)
# Special settings for GSI releasing
$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
# This is whitelisted by product name -- unset it
PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT :=
# Enable dynamically-sized images
PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
@ -35,6 +38,17 @@ PRODUCT_PACKAGES += \
# Quirks
include device/peter/gsi/quirks/quirks.mk
# Euicc -- enabled by default, won't work without eSIM slot definition anyway
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.telephony.euicc.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.telephony.euicc.xml
PRODUCT_PACKAGES += \
OpenEUICC
# vendor/foss
PRODUCT_PACKAGES += \
UnifiedNlp
# Enable ro.adb.secure on userdebug and user
ifeq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
PRODUCT_SYSTEM_EXT_PROPERTIES += \

View file

@ -7,6 +7,7 @@ cc_binary {
// SoC-specific quirks
"quirks/soc/mtk_ril.cpp",
"quirks/soc/caf_audio.cpp",
// Device-specific quirks
"quirks/device/unihertz_keylayout.cpp",

View file

@ -58,8 +58,13 @@ void handle_device_model_props() {
override_ro_prop("ro", "", "build.version.real_security_patch", spl_orig);
}
int main() {
handle_device_model_props();
Quirks::Run();
int main(int argc, char **argv) {
if (argc >= 2 && strcmp(argv[1], "--late-init") == 0) {
// Reset SPL / device model related props during late init
// so that they are set before keystore / vold is started.
handle_device_model_props();
} else {
Quirks::Run();
}
return 0;
}

View file

@ -1,2 +1,8 @@
on late-init
exec u:r:init_gsi:s0 root -- /system_ext/bin/init_gsi --late-init
on post-fs
exec u:r:init_gsi:s0 root -- /system_ext/bin/init_gsi
on property:persist.sys.gsi.hw.mainkeys=*
setprop qemu.hw.mainkeys ${persist.sys.gsi.hw.mainkeys}

View file

@ -87,6 +87,16 @@ void Quirks::CopyFileKeepPerms(filesystem::path src, filesystem::path dst) {
RestoreFilePermissions(src, dst);
}
int Quirks::OverrideWithBindMount(filesystem::path src, filesystem::path dst) {
int err = mount(src.c_str(), dst.c_str(), nullptr, MS_BIND, nullptr);
if (err < 0) {
ALOGE("bind mount %s on %s err = %d\n", src.c_str(), dst.c_str(), errno);
}
return err;
}
void Quirks::OverrideFileWith(filesystem::path p, function<void(istream&, ostream&)> proc) {
if (!filesystem::is_regular_file(p)) return;
@ -108,10 +118,9 @@ void Quirks::OverrideFileWith(filesystem::path p, function<void(istream&, ostrea
RestoreFilePermissions(p, tmp_path);
// Bind mount and override the file
int err = mount(tmp_path.c_str(), p.c_str(), nullptr, MS_BIND, nullptr);
int err = OverrideWithBindMount(tmp_path, p);
if (err < 0) {
ALOGE("bind mount %s on %s err = %d\n", tmp_path.c_str(), p.c_str(), errno);
return;
}
@ -149,10 +158,9 @@ void Quirks::OverrideFolderWith(filesystem::path p, function<void(filesystem::pa
proc(tmp_path);
int err = mount(tmp_path.c_str(), p.c_str(), nullptr, MS_BIND, nullptr);
int err = OverrideWithBindMount(tmp_path, p);
if (err < 0) {
ALOGE("bind mount %s on %s err = %d\n", tmp_path.c_str(), p.c_str(), errno);
return;
}

View file

@ -39,7 +39,9 @@ public:
namespace Quirks {
void Add(DeviceQuirk* quirk);
void Run();
int OverrideWithBindMount(filesystem::path src, filesystem::path dst);
void OverrideFileWith(filesystem::path p, function<void(istream&, ostream&)> proc);
void OverrideFileReplaceSubstr(filesystem::path p, string pattern, string replacement);

View file

@ -0,0 +1,27 @@
#include "../../quirks.h"
#include <android-base/properties.h>
#include <filesystem>
using namespace std;
class CafAudioQuirk : DeviceQuirk {
public:
bool ShouldRun() {
return filesystem::exists("/vendor/etc/audio/audio_policy_configuration.xml");
}
void Run() {
Quirks::OverrideWithBindMount("/vendor/etc/audio/audio_policy_configuration.xml", "/vendor/etc/audio_policy_configuration.xml");
if (filesystem::exists("/vendor/etc/a2dp_audio_policy_configuration.xml")) {
Quirks::OverrideFileReplaceSubstr("/vendor/etc/a2dp_audio_policy_configuration.xml", "bluetooth_qti", "a2dp");
}
// Disable A2DP offload on qcom
android::base::SetProperty("persist.bluetooth.a2dp_offload.disabled", "true");
android::base::SetProperty("persist.bluetooth.bluetooth_audio_hal.disabled", "true");
}
};
LOAD_QUIRK(CafAudioQuirk);

View file

@ -0,0 +1,5 @@
type vendor_qmipriod, domain;
type vendor_qmipriod_data_file, file_type, data_file_type;
r_dir_file(vendor_qmipriod, vendor_qmipriod_data_file);
allow vendor_qmipriod vendor_qmipriod_data_file:file w_file_perms;

View file

@ -10,3 +10,5 @@ persist.dbg.volte_avail_ovr=1
persist.dbg.vt_avail_ovr=1
persist.dbg.wfc_avail_ovr=1
persist.dbg.allow_ims_off=1
# Enable hw keys by default (unless overridden by user)
persist.sys.gsi.hw.mainkeys=0