From 66e4194728da28f4c53bda752e0410dc729b32e6 Mon Sep 17 00:00:00 2001 From: merothh Date: Wed, 2 Mar 2022 11:09:26 +0530 Subject: [PATCH 1/3] Revert "FP4: Add a script to set BT MAC address" This reverts commit 07f65326b8989d22ca6e9ede8b83b81a9f2fce5f. Reason for Revert: * We are restoring Tct Daemon, since it handles light sensor calibration too --- bluetooth-mac/Android.bp | 6 ------ bluetooth-mac/bluetooth-mac_FP4.rc | 7 ------- bluetooth-mac/bluetooth-mac_FP4.sh | 4 ---- device.mk | 4 ---- sepolicy/vendor/bt-mac.te | 10 ---------- sepolicy/vendor/file.te | 1 - sepolicy/vendor/file_contexts | 1 - 7 files changed, 33 deletions(-) delete mode 100644 bluetooth-mac/Android.bp delete mode 100644 bluetooth-mac/bluetooth-mac_FP4.rc delete mode 100644 bluetooth-mac/bluetooth-mac_FP4.sh delete mode 100644 sepolicy/vendor/bt-mac.te diff --git a/bluetooth-mac/Android.bp b/bluetooth-mac/Android.bp deleted file mode 100644 index c2c4865..0000000 --- a/bluetooth-mac/Android.bp +++ /dev/null @@ -1,6 +0,0 @@ -sh_binary { - name: "bluetooth-mac_FP4", - init_rc: ["bluetooth-mac_FP4.rc"], - src: "bluetooth-mac_FP4.sh", - vendor: true, -} diff --git a/bluetooth-mac/bluetooth-mac_FP4.rc b/bluetooth-mac/bluetooth-mac_FP4.rc deleted file mode 100644 index 6951cb3..0000000 --- a/bluetooth-mac/bluetooth-mac_FP4.rc +++ /dev/null @@ -1,7 +0,0 @@ -service vendor.bluetooth-mac_FP4 /vendor/bin/bluetooth-mac_FP4 - class core - group root system - oneshot - -on post-fs - mkdir /mnt/vendor/persist/t2m_param 0777 root system diff --git a/bluetooth-mac/bluetooth-mac_FP4.sh b/bluetooth-mac/bluetooth-mac_FP4.sh deleted file mode 100644 index 39cc602..0000000 --- a/bluetooth-mac/bluetooth-mac_FP4.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/vendor/bin/sh -BT_MACADDR=/mnt/vendor/persist/t2m_param/bt_macaddr - -setprop persist.vendor.service.bdroid.bdaddr $(cat "$BT_MACADDR") diff --git a/device.mk b/device.mk index 0b7b4dd..07a5063 100644 --- a/device.mk +++ b/device.mk @@ -181,10 +181,6 @@ PRODUCT_PACKAGES += \ vendor.qti.hardware.btconfigstore@1.0.vendor \ vendor.qti.hardware.btconfigstore@2.0.vendor -# Bluetooth (MAC) -PRODUCT_PACKAGES += \ - bluetooth-mac_FP4 - # Camera PRODUCT_PACKAGES += \ android.hardware.camera.provider@2.4-impl \ diff --git a/sepolicy/vendor/bt-mac.te b/sepolicy/vendor/bt-mac.te deleted file mode 100644 index bbbb4c4..0000000 --- a/sepolicy/vendor/bt-mac.te +++ /dev/null @@ -1,10 +0,0 @@ -type bluetooth-mac, domain; -type bluetooth-mac_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(bluetooth-mac); - -allow bluetooth-mac vendor_toolbox_exec:file rx_file_perms; - -allow bluetooth-mac mnt_vendor_file:dir search; -r_dir_file(bluetooth-mac, persist_t2m_param_file) - -set_prop(bluetooth-mac, vendor_bluetooth_prop) diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index adcfc83..5e638c5 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -1,3 +1,2 @@ type fpsensor_data_file, file_type, data_file_type, core_data_file_type; -type persist_t2m_param_file, file_type, vendor_persist_type; type tct_mmitest_sysfs, fs_type, sysfs_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index e36e8c4..31ef9d4 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -7,7 +7,6 @@ /dev/fpsensor u:object_r:fpsensor_fp_device:s0 # MAC (Bluetooth) -/vendor/bin/bluetooth-mac_FP4 u:object_r:bluetooth-mac_exec:s0 /mnt/vendor/persist/t2m_param(/.*)? u:object_r:persist_t2m_param_file:s0 # Modem -- GitLab From 2d39c7656fff4c331307811843fa883c6970479e Mon Sep 17 00:00:00 2001 From: merothh Date: Tue, 1 Mar 2022 16:15:57 +0530 Subject: [PATCH 2/3] FP4: Restore Tct daemon * Turns out, in addition to setting BT MAC address, light sensor calibration was being handled by tctd * Without proper calibration, we get junk lux values making auto brightness go crazy --- proprietary-files.txt | 5 +++++ sepolicy/vendor/device.te | 1 + sepolicy/vendor/file.te | 1 + sepolicy/vendor/file_contexts | 10 +++++++--- sepolicy/vendor/hal_sensors_default.te | 1 + sepolicy/vendor/property.te | 1 + sepolicy/vendor/property_contexts | 9 ++++++++- sepolicy/vendor/tctd.te | 16 ++++++++++++++++ sepolicy/vendor/vendor_init.te | 1 + 9 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 sepolicy/vendor/tctd.te create mode 100644 sepolicy/vendor/vendor_init.te diff --git a/proprietary-files.txt b/proprietary-files.txt index 376c35b..356a50e 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1102,6 +1102,11 @@ vendor/etc/init/vendor.qti.hardware.soter@1.0-service.rc vendor/lib64/hw/vendor.qti.hardware.soter@1.0-impl.so vendor/lib64/vendor.qti.hardware.soter@1.0.so +# Tct Daemon +vendor/bin/tctd +vendor/etc/init/tctd.rc +vendor/lib/libQSEEComAPI.so + # Thermal engine vendor/bin/thermal-engine vendor/etc/init/init_thermal-engine.rc diff --git a/sepolicy/vendor/device.te b/sepolicy/vendor/device.te index e178733..59f4c5d 100644 --- a/sepolicy/vendor/device.te +++ b/sepolicy/vendor/device.te @@ -1,2 +1,3 @@ type fpsensor_fp_device, dev_type; +type traceability_block_device, dev_type; type vl53l1_device, dev_type; diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index 5e638c5..adcfc83 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -1,2 +1,3 @@ type fpsensor_data_file, file_type, data_file_type, core_data_file_type; +type persist_t2m_param_file, file_type, vendor_persist_type; type tct_mmitest_sysfs, fs_type, sysfs_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 31ef9d4..136f727 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -9,9 +9,6 @@ # MAC (Bluetooth) /mnt/vendor/persist/t2m_param(/.*)? u:object_r:persist_t2m_param_file:s0 -# Modem -/dev/block/platform/soc/1d84000.ufshc/by-name/tunning u:object_r:vendor_modem_efs_partition_device:s0 - # NFC /dev/st21nfc u:object_r:nfc_device:s0 /vendor/bin/hw/android\.hardware\.nfc@1\.2-service.st u:object_r:hal_nfc_default_exec:s0 @@ -41,6 +38,13 @@ /sys/devices/virtual/misc/msm_wma/wakeup[0-9]+(/.*)? u:object_r:sysfs_wakeup:s0 /sys/devices/virtual/misc/msm_wmapro/wakeup[0-9]+(/.*)? u:object_r:sysfs_wakeup:s0 +# Partitions +/dev/block/platform/soc/1d84000.ufshc/by-name/tunning u:object_r:vendor_modem_efs_partition_device:s0 +/dev/block/platform/soc/1d84000.ufshc/by-name/traceability u:object_r:traceability_block_device:s0 + +# Tct Daemon +/vendor/bin/tctd u:object_r:tctd_exec:s0 + # Vibrator /vendor/bin/hw/vendor\.qti\.hardware\.vibrator\.service\.FP4 u:object_r:hal_vibrator_default_exec:s0 diff --git a/sepolicy/vendor/hal_sensors_default.te b/sepolicy/vendor/hal_sensors_default.te index 8f2a507..5064c42 100644 --- a/sepolicy/vendor/hal_sensors_default.te +++ b/sepolicy/vendor/hal_sensors_default.te @@ -1 +1,2 @@ allow hal_sensors_default sysfs_leds:file r_file_perms; +get_prop(hal_sensors_default, vendor_tct_default_prop) diff --git a/sepolicy/vendor/property.te b/sepolicy/vendor/property.te index ddd57dc..c81b85f 100644 --- a/sepolicy/vendor/property.te +++ b/sepolicy/vendor/property.te @@ -1 +1,2 @@ type vendor_t2m_sys_prop, property_type; +type vendor_tct_default_prop, property_type; diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index 0e67403..132ae19 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -1,5 +1,12 @@ # A2DP -persist.vendor.bluetooth.a2dp. u:object_r:vendor_bluetooth_prop:s0 +persist.vendor.bluetooth.a2dp. u:object_r:vendor_bluetooth_prop:s0 + +# Bluetooth MAC +ro.vendor.t2m.btmac u:object_r:vendor_t2m_sys_prop:s0 + +# Light Sensor Calibration +ro.vendor.tct.backcaldata u:object_r:vendor_tct_default_prop:s0 +ro.vendor.tct.frontcaldata u:object_r:vendor_tct_default_prop:s0 # Serial Nums vendor.t2m.camera_main.sn u:object_r:vendor_t2m_sys_prop:s0 diff --git a/sepolicy/vendor/tctd.te b/sepolicy/vendor/tctd.te new file mode 100644 index 0000000..e34a0c3 --- /dev/null +++ b/sepolicy/vendor/tctd.te @@ -0,0 +1,16 @@ +type tctd, domain; +type tctd_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(tctd); + +# Traceability +allow tctd block_device:dir search; +allow tctd traceability_block_device:blk_file rw_file_perms; + +# Bluetooth MAC +allow tctd mnt_vendor_file:dir search; +r_dir_file(tctd, persist_t2m_param_file) + +set_prop(tctd, vendor_t2m_sys_prop) + +# Light Sensor Calibration +set_prop(tctd, vendor_tct_default_prop) diff --git a/sepolicy/vendor/vendor_init.te b/sepolicy/vendor/vendor_init.te new file mode 100644 index 0000000..714f523 --- /dev/null +++ b/sepolicy/vendor/vendor_init.te @@ -0,0 +1 @@ +get_prop(vendor_init, vendor_t2m_sys_prop) -- GitLab From 786463494286c3283d756bd7cba45f51303ec295 Mon Sep 17 00:00:00 2001 From: Lakshay Date: Sun, 15 Aug 2021 13:20:33 +0530 Subject: [PATCH 3/3] FP4: overlay: Redo brightness overlays Values kanged from bonito. Change-Id: Iaa1f00df34fcc3cf9ad110846fde530d6a81511e --- .../base/core/res/res/values/config.xml | 651 ++++++++++++++++-- 1 file changed, 602 insertions(+), 49 deletions(-) diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 2714d71..b771b10 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -75,78 +75,631 @@ --> true - true - - - 1 - 10 - 50 - 100 - 500 - 1000 - 3000 - + + 29.999996% - 1000 - 1000 + 2000 + 4000 - - 3 + + 128 - 3 - - - 3 - - - + 1 + + + + 1 + 2 + 3 + 4 + 8 + 12 + 20 + 33 + 55 + 90 + 148 + 245 + 403 + 665 + 1097 + 1808 + 2981 + 5000 + + + + + 10.45935 + 29.25559 + 34.240692 + 37.514347 + 40.018696 + 46.885098 + 51.626434 + 58.610405 + 66.890915 + 77.61644 + 90.221886 + 105.80314 + 126.073845 + 154.16931 + 191.83717 + 240.74442 + 294.84857 + 348.05453 + 389.70 + + + + 1 + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 255 + + + 2.2 + 3.7 + 5.34 + 6.98 + 8.63 + 10.27 + 11.91 + 13.55 + 15.2 + 16.84 + 18.48 + 20.12 + 21.76 + 23.41 + 25.05 + 26.69 + 28.33 + 29.98 + 31.62 + 33.26 + 34.9 + 36.54 + 38.19 + 39.83 + 41.47 + 43.11 + 44.76 + 46.4 + 48.04 + 49.68 + 51.32 + 52.97 + 54.61 + 56.25 + 57.89 + 59.54 + 61.18 + 62.82 + 64.46 + 66.1 + 67.75 + 69.39 + 71.03 + 72.67 + 74.32 + 75.96 + 77.6 + 79.24 + 80.88 + 82.53 + 84.17 + 85.81 + 87.45 + 89.1 + 90.74 + 92.38 + 94.02 + 95.66 + 97.31 + 98.95 + 100.59 + 102.23 + 103.88 + 105.52 + 107.16 + 108.8 + 110.44 + 112.09 + 113.73 + 115.37 + 117.01 + 118.66 + 120.3 + 121.94 + 123.58 + 125.22 + 126.87 + 128.51 + 130.15 + 131.79 + 133.44 + 135.08 + 136.72 + 138.36 + 140 + 142.06 + 143.7 + 145.34 + 146.98 + 148.63 + 150.27 + 151.91 + 153.55 + 155.2 + 156.84 + 158.48 + 160.12 + 161.76 + 163.41 + 165.05 + 166.69 + 168.33 + 169.98 + 171.62 + 173.26 + 174.9 + 176.54 + 178.19 + 179.83 + 181.47 + 183.11 + 184.76 + 186.4 + 188.04 + 189.68 + 191.32 + 192.97 + 194.61 + 196.25 + 197.89 + 199.54 + 201.18 + 202.82 + 204.46 + 206.1 + 207.75 + 209.39 + 211.03 + 212.67 + 214.32 + 215.96 + 217.6 + 219.24 + 220.88 + 222.53 + 224.17 + 225.81 + 227.45 + 229.1 + 230.74 + 232.38 + 234.02 + 235.66 + 237.31 + 238.95 + 240.59 + 242.23 + 243.88 + 245.52 + 247.16 + 248.8 + 250.44 + 252.09 + 253.73 + 255.37 + 257.01 + 258.66 + 260.3 + 261.94 + 263.58 + 265.22 + 266.87 + 268.51 + 270.15 + 271.79 + 273.44 + 275.08 + 276.72 + 278.36 + 280 + 282.06 + 283.7 + 285.34 + 286.98 + 288.63 + 290.27 + 291.91 + 293.55 + 295.2 + 296.84 + 298.48 + 300.12 + 301.76 + 303.41 + 305.05 + 306.69 + 308.33 + 309.98 + 311.62 + 313.26 + 314.9 + 316.54 + 318.19 + 319.83 + 321.47 + 323.11 + 324.76 + 326.4 + 328.04 + 329.68 + 331.32 + 332.97 + 334.61 + 336.25 + 337.89 + 339.54 + 341.18 + 342.82 + 344.46 + 346.1 + 347.75 + 349.39 + 351.03 + 352.67 + 354.32 + 355.96 + 357.6 + 359.24 + 360.88 + 362.53 + 364.17 + 365.81 + 367.45 + 369.1 + 370.74 + 372.38 + 374.02 + 375.66 + 377.31 + 378.95 + 380.59 + 382.23 + 383.88 + 385.52 + 387.16 + 388.8 + 390.44 + 392.09 + 393.73 + 395.37 + 397.01 + 398.66 + 400.3 + 401.94 + 403.58 + 405.22 + 406.87 + 408.51 + 410.15 + 411.79 + 413.44 + 415.08 + 416.72 + 418.36 + 420 + + Android-Mms/2.0 @@ -215,7 +768,7 @@ - true + true