diff --git a/device-comet.mk b/device-comet.mk index e533c64..1de3f68 100644 --- a/device-comet.mk +++ b/device-comet.mk @@ -126,6 +126,10 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml \ device/google/comet/nfc/libse-gto-hal.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal.conf +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Thermal Config ifeq (,$(TARGET_VENDOR_THERMAL_CONFIG_PATH)) TARGET_VENDOR_THERMAL_CONFIG_PATH := device/google/comet/thermal @@ -135,6 +139,7 @@ PRODUCT_COPY_FILES += \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_charge_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_backup_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_backup.json \ + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_comet.tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite \ PRODUCT_PACKAGES += \ init_thermal_config diff --git a/thermal/thermal_info_config_comet.json b/thermal/thermal_info_config_comet.json index 285c5ee..cc23ca7 100644 --- a/thermal/thermal_info_config_comet.json +++ b/thermal/thermal_info_config_comet.json @@ -221,15 +221,64 @@ "Multiplier": 0.001 }, { - "Name": "VIRTUAL-SKIN", - "Type": "SKIN", + "Name": "VIRTUAL-SKIN-LEGACY", + "Type": "UNKNOWN", "Version": "2.0", "VirtualSensor": true, - "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Hidden": true, "Formula": "WEIGHTED_AVG", "Combination": ["VIRTUAL-SKIN-OPEN", "VIRTUAL-SKIN-CLOSE"], "Coefficient": ["OPEN_WEIGHT", "CLOSE_WEIGHT"], "CoefficientType": ["SENSOR", "SENSOR"], + "Multiplier": 0.001 + }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "Version": "1.0", + "VirtualSensor":true, + "Hidden": true, + "ModelPath":"vt_estimation_model.tflite", + "Formula": "USE_ML_MODEL", + "Combination":["soc_therm", "rffe_therm", "charger_therm", "usb_conn_therm", "modem_therm", "inner_display_therm", "display_therm", "gnss_tcxo_therm", "maxfg_base", "maxfg_secondary", "inner_brightness"], + "Multiplier":0.001, + "PreviousSampleCount": 3, + "BackupSensor": "VIRTUAL-SKIN-LEGACY", + "ValidateInput": true + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Hidden": true, + "Formula": "WEIGHTED_AVG", + "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0, -1.0], + "Multiplier": 1 + }, + { + "Name": "STATS-UPDATOR", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Hidden": true, + "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Formula": "WEIGHTED_AVG", + "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF"], + "Coefficient": [0.0, 0.0, 0.0], + "Multiplier": 1, + "SendPowerHint": true, + "PollingDelay": 300000, + "PassiveDelay": 7000 + }, + { + "Name": "VIRTUAL-SKIN", + "Type": "SKIN", + "Version": "2.1", + "VirtualSensor": true, + "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Formula": "MAXIMUM", + "Combination": ["VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0], "HotThreshold": ["NAN", 39.0, 43.0, 45.0, 46.5, 53.0, 57.0], "HotHysteresis": [0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], "Multiplier": 0.001, @@ -1056,6 +1105,26 @@ "Name": "VIRTUAL-SKIN", "Thresholds": [31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 55] }, + { + "Name": "VIRTUAL-SKIN-MODEL", + "Thresholds": [31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 55] + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "LoggingName": "MODEL-LEGACY-0.5", + "Thresholds": [ + -4500, -4000, -3500, -3000, -2500, -2000, -1500, -1000, -500, 0, + 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500 + ] + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "LoggingName": "MODEL-LEGACY-1", + "Thresholds": [ + -13000, -12000, -11000, -10000, -9000, -8000, -7000, -6000, -5000, + -4000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000 + ] + }, { "Name": "VIRTUAL-SKIN-SPEAKER", "Thresholds": [35, 37] @@ -1065,8 +1134,16 @@ "Outlier": { "Configs": [ { - "Monitor": ["VIRTUAL-SKIN"], - "TempRange": [0.0, 55.0] + "Monitor": ["VIRTUAL-SKIN-LEGACY"], + "TempRange": [0.0, 57.0] + }, + { + "Monitor": ["VIRTUAL-SKIN-MODEL"], + "TempRange": [0.0, 57.0] + }, + { + "Monitor": ["VIRTUAL-SKIN-MODEL-LEGACY-DIFF"], + "TempRange": [-12000, 12000] } ] }, diff --git a/thermal/vt_estimation_model_comet.tflite b/thermal/vt_estimation_model_comet.tflite new file mode 100644 index 0000000..4283a30 Binary files /dev/null and b/thermal/vt_estimation_model_comet.tflite differ