whatawurst / android_device_sony_yoshino-common

This is the Android device configuration for the yoshino platform
10 stars 48 forks source link

Use CUSTOM_APNS_FILE to avoid duplicate copy #46

Open Flamefire opened 3 years ago

Flamefire commented 3 years ago

https://github.com/whatawurst/android_device_sony_yoshino-common/commit/28006690b1bbb09bd517cd0a05bce70521407fc6 leads to a warning:

build/make/core/Makefile:28: warning: overriding commands for target `out/target/product/lilac/system/product/etc/apns-conf.xml'

build/make/core/base_rules.mk:510: warning: ignoring old commands for target `out/target/product/lilac/system/product/etc/apns-conf.xml'

Judging from the code this can be avoided by setting something like: CUSTOM_APNS_FILE := $(PLATFORM_PATH)/configs/telephony/apns-conf.xml in the board config which will make the lineage build scripts handle the copy so we can be sure the right file is taken.

Flamefire commented 3 years ago

Seems the LOS script which merges the LOS apns-conf.xml and the custom one is... quite bad. So ATM this won't work

Flamefire commented 3 years ago

Some more details: Check the script at https://github.com/LineageOS/android_vendor_lineage/blob/7686039f094551f64e37079c56270ee3eb5ec704/tools/custom_apns.py

It basically gathers all carrier attributes from the custom file and then goes over the lineage-carrier file line by line and does:

This would only work if a) the carrier names are unique and b) are not prefixes/suffixes of any other. Both is not true

So this messes stuff up at multiple places. E.g. as a (supposedly) written carrier name is removed from the list, the next line with that carrier from the lineage file will be written as-is and hence overriding the custom configs written before. It may also lead to useless duplicates and more.

I already made a PR to lineage to fix that, but no answer yet.