/** * Function that calculates the state of the Thermal Zone after reading temperatures of all * sensors in the zone. This function is used when a zone operates in polling mode. */ public boolean isZoneStateChanged() { for (ThermalSensor ts : mThermalSensors) { if (ts.getSensorActiveStatus()) { ts.updateSensorTemp(); } } return updateZoneParams(); }
public void registerUevent() { int indx; if (mThermalSensors == null) return; if (mThermalSensors.size() > 1) { Log.i(TAG, "for zone:" + getZoneName() + " in uevent mode only first sensor used!"); } ThermalSensor sensor = mThermalSensors.get(0); if (sensor == null) return; String path = sensor.getUEventDevPath(); if (path.equalsIgnoreCase("invalid")) return; // first time update of sensor temp and zone temp sensor.updateSensorTemp(); setZoneTemp(sensor.getCurrTemp()); if (updateZoneParams()) { // first intent after initialization sendThermalEvent(); } mUEventObserver.startObserving(path); programThresholds(sensor); }