Exemplo n.º 1
0
 /**
  * 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();
 }
Exemplo n.º 2
0
  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);
  }