From df5d63896daf23ec037f1120dcf52adb76826f89 Mon Sep 17 00:00:00 2001 From: George Lee Date: Mon, 14 Nov 2022 10:14:16 -0800 Subject: [PATCH 1/3] battery_mitigation: Add BrownoutDetection app [DO NOT MERGE] This app files bugreport for user-debug build with reboot reason = ocp or uvlo. Removed the dependency on BetterBug. Bug: 237287659 Test: Ensure bugreport is generated under user-debug build with reboot reason = ocp or uvlo. Signed-off-by: George Lee Change-Id: I267f077e9c6c856b038b008397c0b465d209d9c3 (cherry picked from commit d0d71a7ce810683d17df144b64c8848412b6de79) Merged-In: I267f077e9c6c856b038b008397c0b465d209d9c3 --- battery_mitigation/battery_mitigation.rc | 56 ++++++++++++------------ device.mk | 3 +- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/battery_mitigation/battery_mitigation.rc b/battery_mitigation/battery_mitigation.rc index 4c4e2c1b..c0c76fb5 100644 --- a/battery_mitigation/battery_mitigation.rc +++ b/battery_mitigation/battery_mitigation.rc @@ -4,88 +4,88 @@ on property:vendor.thermal.link_ready=1 start vendor.battery_mitigation on property:ro.boot.bootreason=reboot,uvlo,pmic,if - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "uvlo,pmic,if" on property:ro.boot.bootreason=reboot,ocp,pmic,if - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,pmic,if" on property:ro.boot.bootreason=reboot,uvlo,pmic,main - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "uvlo,pmic,main" on property:ro.boot.bootreason=reboot,uvlo,pmic,sub - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "uvlo,pmic,sub" on property:ro.boot.bootreason=reboot,ocp,buck1m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck1m" on property:ro.boot.bootreason=reboot,ocp,buck2m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck2m" on property:ro.boot.bootreason=reboot,ocp,buck3m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck3m" on property:ro.boot.bootreason=reboot,ocp,buck4m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck4m" on property:ro.boot.bootreason=reboot,ocp,buck5m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck5m" on property:ro.boot.bootreason=reboot,ocp,buck6m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck6m" on property:ro.boot.bootreason=reboot,ocp,buck7m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck7m" on property:ro.boot.bootreason=reboot,ocp,buck8m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck8m" on property:ro.boot.bootreason=reboot,ocp,buck9m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck9m" on property:ro.boot.bootreason=reboot,ocp,buck10m - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck10m" on property:ro.boot.bootreason=reboot,ocp,buck1s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck1s" on property:ro.boot.bootreason=reboot,ocp,buck2s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck2s" on property:ro.boot.bootreason=reboot,ocp,buck3s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck3s" on property:ro.boot.bootreason=reboot,ocp,buck4s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck4s" on property:ro.boot.bootreason=reboot,ocp,buck5s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck5s" on property:ro.boot.bootreason=reboot,ocp,buck6s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck6s" on property:ro.boot.bootreason=reboot,ocp,buck7s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck7s" on property:ro.boot.bootreason=reboot,ocp,buck8s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck8s" on property:ro.boot.bootreason=reboot,ocp,buck9s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck9s" on property:ro.boot.bootreason=reboot,ocp,buck10s - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buck10s" on property:ro.boot.bootreason=reboot,ocp,buckds - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buckds" on property:ro.boot.bootreason=reboot,ocp,buckas - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buckas" on property:ro.boot.bootreason=reboot,ocp,buckcs - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buckcs" on property:ro.boot.bootreason=reboot,ocp,buckbs - setprop vendor.startup_bugreport_requested 1 + setprop vendor.brownout_reason "ocp,buckbs" service vendor.battery_mitigation /vendor/bin/hw/battery_mitigation user system diff --git a/device.mk b/device.mk index 44ac8470..5707092b 100644 --- a/device.mk +++ b/device.mk @@ -551,7 +551,8 @@ PRODUCT_PACKAGES += \ # Battery Mitigation PRODUCT_PACKAGES += \ - battery_mitigation + battery_mitigation \ + BrownoutDetection PRODUCT_PACKAGES_DEBUG += \ sg_write_buffer \ From f9c809ee9cae97850d86842e84dbd64795fd57f8 Mon Sep 17 00:00:00 2001 From: Junyu Lai Date: Thu, 2 Feb 2023 16:03:32 +0800 Subject: [PATCH 2/3] Set activelyPreferBadwifi config to 1 globally for gs201 devices This flag will not take effect if the system is configured to avoid bad wifis. Set it to 1 globally. Then it will sprint into effect for all mcc/mncs where config_networkAvoidBadWifi is 0. For carriers that don't need this behavior change but config_networkAvoidBadWifi is 0, set activelyPreferBadwifi to 0 for their mccmncs. Test: manual Bug: 267489867 Change-Id: I4b6fe4964e8fd5d61978f1433dcbbd9e9b10ffc3 Merged-In: I4b6fe4964e8fd5d61978f1433dcbbd9e9b10ffc3 (cherry picked from commit 3357b8cf949b9e632d10759ba8bc700b72ac2242) (cherry picked from commit 2a3281dc867bd322c5307281e112c4874c5b032d) Merged-In: I4b6fe4964e8fd5d61978f1433dcbbd9e9b10ffc3 --- .../res/values-mcc204-mnc04/config.xml | 28 +++++++++++++++++++ .../ConnectivityOverlay/res/values/config.xml | 4 +++ 2 files changed, 32 insertions(+) create mode 100644 rro_overlays/ConnectivityOverlay/res/values-mcc204-mnc04/config.xml diff --git a/rro_overlays/ConnectivityOverlay/res/values-mcc204-mnc04/config.xml b/rro_overlays/ConnectivityOverlay/res/values-mcc204-mnc04/config.xml new file mode 100644 index 00000000..2a6d2e5c --- /dev/null +++ b/rro_overlays/ConnectivityOverlay/res/values-mcc204-mnc04/config.xml @@ -0,0 +1,28 @@ + + + + + 0 + + + 0 + diff --git a/rro_overlays/ConnectivityOverlay/res/values/config.xml b/rro_overlays/ConnectivityOverlay/res/values/config.xml index d9a29b07..d9e9b583 100644 --- a/rro_overlays/ConnectivityOverlay/res/values/config.xml +++ b/rro_overlays/ConnectivityOverlay/res/values/config.xml @@ -23,4 +23,8 @@ 0x80000000 + + + 1 From 5cab7ffe1bc022b359a4f72000f3516c13cbe7fc Mon Sep 17 00:00:00 2001 From: Junyu Lai Date: Thu, 2 Feb 2023 17:34:57 +0800 Subject: [PATCH 3/3] Set config_networkAvoidBadWifi overlay on gs201 devices for Verizon Currently, config_networkAvoidBadWifi is customized in aosp for only 2 Verizon mccmncs: 310-004 and 311-480. However, from TAM feedback, there are few mccmncs which are not customized yet. Explicitly add them for gs201 devices. Test: manual Bug: 267489867 Change-Id: I46ec45354ae72a6a758aba2c2a31af92f1da4038 Merged-In: I46ec45354ae72a6a758aba2c2a31af92f1da4038 (cherry picked from commit cc270214edfe849dc71314455aa28994a7939150) (cherry picked from commit b6ad359353576d79dd12cdfbaa43951f29621a4e) Merged-In: I46ec45354ae72a6a758aba2c2a31af92f1da4038 --- .../res/values-mcc310-mnc004/config.xml | 24 +++++++++++++++++++ .../res/values-mcc310-mnc590/config.xml | 24 +++++++++++++++++++ .../res/values-mcc310-mnc599/config.xml | 24 +++++++++++++++++++ .../res/values-mcc311-mnc270/config.xml | 24 +++++++++++++++++++ .../res/values-mcc311-mnc280/config.xml | 24 +++++++++++++++++++ .../res/values-mcc311-mnc480/config.xml | 24 +++++++++++++++++++ 6 files changed, 144 insertions(+) create mode 100644 rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc004/config.xml create mode 100644 rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc590/config.xml create mode 100644 rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc599/config.xml create mode 100644 rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc270/config.xml create mode 100644 rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc280/config.xml create mode 100644 rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc480/config.xml diff --git a/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc004/config.xml b/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc004/config.xml new file mode 100644 index 00000000..3cc7253a --- /dev/null +++ b/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc004/config.xml @@ -0,0 +1,24 @@ + + + + + 0 + diff --git a/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc590/config.xml b/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc590/config.xml new file mode 100644 index 00000000..3cc7253a --- /dev/null +++ b/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc590/config.xml @@ -0,0 +1,24 @@ + + + + + 0 + diff --git a/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc599/config.xml b/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc599/config.xml new file mode 100644 index 00000000..3cc7253a --- /dev/null +++ b/rro_overlays/ConnectivityOverlay/res/values-mcc310-mnc599/config.xml @@ -0,0 +1,24 @@ + + + + + 0 + diff --git a/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc270/config.xml b/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc270/config.xml new file mode 100644 index 00000000..3cc7253a --- /dev/null +++ b/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc270/config.xml @@ -0,0 +1,24 @@ + + + + + 0 + diff --git a/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc280/config.xml b/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc280/config.xml new file mode 100644 index 00000000..3cc7253a --- /dev/null +++ b/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc280/config.xml @@ -0,0 +1,24 @@ + + + + + 0 + diff --git a/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc480/config.xml b/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc480/config.xml new file mode 100644 index 00000000..3cc7253a --- /dev/null +++ b/rro_overlays/ConnectivityOverlay/res/values-mcc311-mnc480/config.xml @@ -0,0 +1,24 @@ + + + + + 0 +