Compare commits

..

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

11 changed files with 9 additions and 110 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,11 +7,9 @@ cc_binary {
// SoC-specific quirks
"quirks/soc/mtk_ril.cpp",
"quirks/soc/caf_audio.cpp",
// Device-specific quirks
"quirks/device/unihertz_keylayout.cpp",
"quirks/device/ulefone_power_armor_13.cpp",
],
shared_libs: ["libbase", "libdl", "liblog", "libutils"],
static_libs: ["libresetprop", "libc++fs"],

View file

@ -41,7 +41,6 @@ void handle_device_model_props() {
string manufacturer = base::GetProperty("ro.product.vendor.manufacturer", "");
string fingerprint = base::GetProperty("ro.vendor.build.fingerprint", "");
string spl = base::GetProperty("ro.vendor.build.security_patch", "");
string spl_orig = base::GetProperty("ro.build.version.security_patch", "");
for (const auto& source : RO_PROP_SOURCES) {
override_ro_prop("ro.product", source, "device", device);
@ -55,16 +54,10 @@ void handle_device_model_props() {
override_ro_prop("ro", "", "build.flavor", name + "-user");
override_ro_prop("ro", "", "build.tags", "release-keys");
override_ro_prop("ro", "", "build.version.security_patch", spl);
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,22 +0,0 @@
#include "../../quirks.h"
#include <android-base/properties.h>
#include <filesystem>
using namespace std;
class UlefonePowerArmor13Quirks : DeviceQuirk {
public:
bool ShouldRun() {
return FP_STARTS_WITH("Ulefone/Power_Armor_13/");
}
void Run() {
// Set the A2DP offload properties to disabled so legacy policy is loaded
android::base::SetProperty("persist.bluetooth.a2dp_offload.disabled", "true");
android::base::SetProperty("persist.bluetooth.bluetooth_audio_hal.disabled", "true");
}
};
LOAD_QUIRK(UlefonePowerArmor13Quirks);

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,6 +0,0 @@
attribute hal_mms_server;
binder_call({appdomain -isolated_app}, hal_mms_server)
binder_call(hal_mms_server, {appdomain -isolated_app})
type mtk_hal_mms_hwservice, hwservice_manager_type;
allow { appdomain -isolated_app } mtk_hal_mms_hwservice:hwservice_manager find;

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