Skip to content

Use CUSTOM_APNS_FILE to avoid duplicate copy #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Flamefire opened this issue May 23, 2021 · 2 comments
Open

Use CUSTOM_APNS_FILE to avoid duplicate copy #46

Flamefire opened this issue May 23, 2021 · 2 comments

Comments

@Flamefire
Copy link
Contributor

Flamefire commented May 23, 2021

2800669
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
Copy link
Contributor Author

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 referenced this issue in linckandrea/android_device_sony_yoshino-common Jun 9, 2021
 * this fix the following 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'

thanks to @Flamefire for pointing it out
@Flamefire
Copy link
Contributor Author

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:

  • If the line contains(!) ANY of the carrier names from above, it is NOT written
  • Instead it writes ALL lines from the custom file that contain(!) that carrier name
  • It then removes that carrier name from the list
  • At the end it writes all lines containing(!) not-yet written carrier names from the custom file to the merged file

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant