init.class_main.sh 3.6 KB

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