| ReStranger | 1b85f70 | 2025-09-30 04:05:06 +0300 | [diff] [blame] | 1 | #! /vendor/bin/sh |
| 2 | |
| 3 | # Copyright (c) 2013-2014, 2019 The Linux Foundation. All rights reserved. |
| 4 | # |
| 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions are met: |
| 7 | # * Redistributions of source code must retain the above copyright |
| 8 | # notice, this list of conditions and the following disclaimer. |
| 9 | # * Redistributions in binary form must reproduce the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer in the |
| 11 | # documentation and/or other materials provided with the distribution. |
| 12 | # * Neither the name of The Linux Foundation nor |
| 13 | # the names of its contributors may be used to endorse or promote |
| 14 | # products derived from this software without specific prior written |
| 15 | # permission. |
| 16 | # |
| 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | # |
| 29 | |
| 30 | # |
| 31 | # start ril-daemon only for targets on which radio is present |
| 32 | # |
| 33 | baseband=`getprop ro.baseband` |
| 34 | sgltecsfb=`getprop persist.vendor.radio.sglte_csfb` |
| 35 | datamode=`getprop persist.vendor.data.mode` |
| 36 | low_ram=`getprop ro.config.low_ram` |
| 37 | |
| 38 | case "$baseband" in |
| 39 | "apq" | "sda" | "qcs" ) |
| 40 | setprop ro.vendor.radio.noril yes |
| 41 | stop vendor.ril-daemon |
| 42 | stop vendor.qcrild |
| 43 | stop vendor.qcrild2 |
| 44 | stop vendor.qcrild3 |
| 45 | esac |
| 46 | |
| 47 | case "$baseband" in |
| 48 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6") |
| 49 | |
| 50 | start vendor.qcrild |
| 51 | |
| 52 | case "$baseband" in |
| 53 | "svlte2a" | "csfb") |
| 54 | start qmiproxy |
| 55 | ;; |
| 56 | "sglte" | "sglte2" ) |
| 57 | if [ "x$sgltecsfb" != "xtrue" ]; then |
| 58 | start qmiproxy |
| 59 | else |
| 60 | setprop persist.vendor.radio.voice.modem.index 0 |
| 61 | fi |
| 62 | ;; |
| 63 | esac |
| 64 | |
| 65 | multisim=`getprop persist.radio.multisim.config` |
| 66 | |
| 67 | if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then |
| 68 | start vendor.qcrild2 |
| 69 | elif [ "$multisim" = "tsts" ]; then |
| 70 | start vendor.qcrild2 |
| 71 | start vendor.qcrild3 |
| 72 | fi |
| 73 | |
| 74 | case "$datamode" in |
| 75 | "tethered") |
| 76 | start vendor.dataqti |
| 77 | if [ "$low_ram" != "true" ]; then |
| 78 | start vendor.dataadpl |
| 79 | fi |
| 80 | ;; |
| 81 | "concurrent") |
| 82 | start vendor.dataqti |
| 83 | if [ "$low_ram" != "true" ]; then |
| 84 | start vendor.dataadpl |
| 85 | fi |
| 86 | ;; |
| 87 | *) |
| 88 | ;; |
| 89 | esac |
| 90 | esac |
| 91 | |
| 92 | # |
| 93 | # Allow persistent faking of bms |
| 94 | # User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity |
| 95 | # |
| 96 | fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity` |
| 97 | case "$fake_batt_capacity" in |
| 98 | "") ;; #Do nothing here |
| 99 | * ) |
| 100 | echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity |
| 101 | ;; |
| 102 | esac |