public void programThresholds(ThermalSensor s) { if (s == null) return; int zoneState = getZoneState(); if (zoneState == ThermalManager.THERMAL_STATE_OFF) return; int lowerTripPoint = ThermalUtils.getLowerThresholdTemp(zoneState, getZoneTempThreshold()); int upperTripPoint = ThermalUtils.getUpperThresholdTemp(zoneState, getZoneTempThreshold()); if (lowerTripPoint != ThermalManager.INVALID_TEMP && upperTripPoint != ThermalManager.INVALID_TEMP) { if (ThermalUtils.writeSysfs(s.getSensorLowTempPath(), lowerTripPoint) == -1) { Log.i( TAG, "error while programming lower trip point:" + lowerTripPoint + "for sensor:" + s.getSensorName()); } if (ThermalUtils.writeSysfs(s.getSensorHighTempPath(), upperTripPoint) == -1) { Log.i( TAG, "error while programming upper trip point:" + upperTripPoint + "for sensor:" + s.getSensorName()); } } }