Commit Graph

19 Commits

Author SHA1 Message Date
SGCMarkus
a14eceeece carriersettings-extractor: ignore threshold arrays with size > 4
These cause com.android.phone to crash:
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: Process: com.android.phone, PID: 4429
E AndroidRuntime: java.lang.IllegalArgumentException: thresholds length must between 1 and 4
E AndroidRuntime: 	at android.telephony.SignalThresholdInfo$Builder.setThresholds(SignalThresholdInfo.java:422)

Change-Id: I1a2721063bc7dae0d3415a59883a5470518c47a1
2023-10-23 16:03:00 +00:00
Michael Bestas
66d64cfdb8 carriersettings-extractor: Ignore motorola specific configs
Change-Id: Ib44ccb252c4e0e2743bf6d9b926f536daff19f6b
2023-06-16 21:40:21 +02:00
Michael Bestas
cfd6e2d601 carriersettings-extractor: Make APNs extract optional
Change-Id: Ic7701d660146a400b5e7ee4ee41a940f6d56c455
2023-06-16 21:40:21 +02:00
Michael Bestas
9a7adaa7c7 carriersettings-extractor: Only include gps elements in vendor_no_sim.xml
Change-Id: Ia40c7f2b69ddfbb8e7f2fce6993ff6471c4ee6ff
2023-06-16 21:40:21 +02:00
Michael Bestas
4075fcbc2f carriersettings-extractor: Generate vendor_no_sim.xml
Change-Id: I87513a6ab8387f55ff7892dcee6f71ad945fec73
2023-06-16 21:40:21 +02:00
Chirayu Desai
e830e8dda2 carriersettings-extractor: Write mcc=0 mnc=0 config as just carrier_config
Change-Id: Ie4325c03c3406cb5c056188c3044f870c9190088
2023-06-16 21:40:21 +02:00
Michael Bestas
d927852310 carriersettings-extractor: Add missing name element in pbundle_as_map
Change-Id: I7346b5cca0fde6fc1957649fe7f463eaffac8c5e
2023-06-16 21:40:21 +02:00
Chirayu Desai
ea8804b723 carriersettings-extractor: Sync tag name
* If you look at the CarrierConfigV2 converter, it reads
  'pbundle_as_map' and not 'bundle' - which isn't handled at all
* All others match parseCarrierConfigToMap

Ref: 2093949: Add support for "double" and "bundle" in pb generating script | https://android-review.googlesource.com/c/platform/tools/carrier_settings/+/2093949
TODO: Figure out how to run the converter as a test somehow
Change-Id: I2197766590625e9f4cd12d30a65204a2ec750515
2023-06-16 21:40:21 +02:00
Chirayu Desai
e0e53fb2d0 carriersettings-extractor: Handle failure gracefully
* Google forgot to add ice_no.pb to Pixel 6 October release

Change-Id: Ie7bad259b9bc818a87279bec836d83107dee93f3
2023-06-16 21:40:21 +02:00
Michael Bestas
8166ecc7b4 carriersettings-extractor: Workaround for skip_464xlat field extraction
TelephonyProvider expects an int, not a string.
One would think bypassing the enum_type check and using the numbers
directly would be enough, but google stores the values in protobuf
different than what TelephonyProvider expects (0,1,2 vs -1,0,1).

References:
https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/refs/tags/android-13.0.0_r3/src/com/android/providers/telephony/TelephonyProvider.java#2473
https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-13.0.0_r3/core/java/android/provider/Telephony.java#3399
https://android.googlesource.com/platform/tools/carrier_settings/+/refs/tags/android-13.0.0_r3/proto/carrier_settings.proto#138
https://android.googlesource.com/platform/tools/carrier_settings/+/refs/tags/android-13.0.0_r3/python/update_apn.py#169

Change-Id: I920f8b9cd2638f40f90e22638b8cb67e11b898a8
2023-06-16 21:40:21 +02:00
Michael Bestas
b6bdac0788 carriersettings-extractor: Update for 13
Import proto files from
tools/carrier_settings 1edea9efa652f3022f1804061f4aebca58ca47ff

Change-Id: I496c11e9a631c6709a15a4e64b354683019150fc
2023-06-16 21:40:21 +02:00
Michael Bestas
0bdaa22666 carriersettings-extractor: Move element extraction to separate function
Prepare for bundle support.

Change-Id: I2f9fe500beee1130b95e526ebd4a84d6fd3f4766
2023-06-16 21:40:21 +02:00
Chirayu Desai
26561a8b67 carriersettings-extractor: Read CarrierSettings protobufs in stages
* Trying to load them all at once resulted in a game of chicken due
  to 'telenor_se' existing in both generic 'others.pb', and it's own
  'telenor_se.pb'
* We tried to work around that in multiple ways, and that did work,
  but let's just re-write this to be more deterministic, and generic.

Change-Id: Iac046b98d4c23667eff306861c902913785e6ca8
2023-06-16 21:40:21 +02:00
Luca Stefani
5b27a24f3e carriersettings-extractor: Update to 12
Import proto files from
tools/carrier_settings 0a2c3b9ec4337283b67391971613cd06690a2d34
packages/providers/TelephonyProvider e9b03419e34ed174e239453f958aac0f042bf072

Change-Id: Ied7c51623dc6d14352fbc30db4632311ba455a0e
2023-06-16 21:40:21 +02:00
Chirayu Desai
33f9e8630b carriersettings-extractor: Always allow modifying APNs
* Users have reported that in some cases they were able to edit
  APNs on stock, but aren't able to do so here.
* We can just allow editing APNs always

Reference:
https: //cs.android.com/android/platform/superproject/+/master:frameworks/base/telephony/java/android/telephony/CarrierConfigManager.java

Issue: calyxos#599
Issue: calyxos#266
Issue: calyxos#636
Change-Id: I967069a7631e7b26ad9970704dfda5583e0b0fbf
2023-06-16 21:40:21 +02:00
Chirayu Desai
b8697e3cb4 carriersettings-extractor: Exclude some values from vendor.xml
* This will make it work with the naked config
* We can have two different XMLs if needed, where one
  could include this config
* Looked for any 'com.google.android.' or Sprint/Verizon
  packages and removed those

Change-Id: I3d68c995f855c13231946a5796091936479906e9
2023-06-16 21:40:21 +02:00
Chirayu Desai
e1499e0324 carriersettings-extractor: Implement argparse, extract files into separate folders
Co-Authored-By: Michael Bestas <mkbestas@gmail.com>
Change-Id: If8d93d832bbd586ae0e06067a4e335aa5a0398c4
2023-06-16 21:40:21 +02:00
Chirayu Desai
ae25298473 carriersettings-extractor: Modify for usage in AOSP
* We already have all the needed protos, just symlink them

Change-Id: Iebdebcad0cecf3a8baf6a9fcc5590e707aacd585
2023-06-16 21:40:21 +02:00
Chirayu Desai
37fa6fe56c Import carriersettings-extractor
Repo: https://github.com/daradib/carriersettings-extractor
Commit: 6e6217b5fc74129b8d1ba6671a48388f5f55e009 "Add license"
Change-Id: Ibbbccedd5e118e66f7e681dd2f8c8d69e6484a87
2023-06-16 21:40:21 +02:00