Compare commits

..

No commits in common. "sc-v2" and "sc" have entirely different histories.
sc-v2 ... sc

9 changed files with 9 additions and 79 deletions

View file

@ -13,9 +13,6 @@ $(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
@ -38,17 +35,6 @@ 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,7 +7,6 @@ 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,13 +58,8 @@ void handle_device_model_props() {
override_ro_prop("ro", "", "build.version.real_security_patch", spl_orig);
}
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();
}
int main() {
handle_device_model_props();
Quirks::Run();
return 0;
}

View file

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

View file

@ -39,9 +39,7 @@ 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

@ -1,27 +0,0 @@
#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

@ -1,5 +0,0 @@
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,5 +10,3 @@ 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