package com.worklight.location.internal.wifi.triggerEvaluators;

import com.worklight.location.internal.wifi.triggers.AbstractWifiDwellTrigger;

public abstract class WifiDwellingTrigger extends WifiAreaTriggerEvaluator
{
  private boolean alreadyEvaluatedAsDwelling = false;
  private final boolean shouldBeInside;
  private Long startDwellingTime = null;

  protected WifiDwellingTrigger(AbstractWifiDwellTrigger paramAbstractWifiDwellTrigger, boolean paramBoolean1, boolean paramBoolean2)
  {
    super(paramAbstractWifiDwellTrigger, paramBoolean2);
    this.shouldBeInside = paramBoolean1;
  }

  public boolean evaluate(WifiInternalLocation paramWifiInternalLocation)
  {
    updatePosition(paramWifiInternalLocation);
    if (this.startDwellingTime == null)
    {
      boolean bool1 = isInside();
      boolean bool2 = this.shouldBeInside;
      Long localLong = null;
      if (bool1 == bool2)
        localLong = paramWifiInternalLocation.getTimestamp();
      this.startDwellingTime = localLong;
      this.alreadyEvaluatedAsDwelling = false;
    }
    do
      while (true)
      {
        return false;
        if (isInside() == this.shouldBeInside)
          break;
        this.startDwellingTime = null;
      }
    while ((this.alreadyEvaluatedAsDwelling) || (isInside() != this.shouldBeInside) || (paramWifiInternalLocation.getTimestamp().longValue() - this.startDwellingTime.longValue() < getTriggerDefinition().getDwellingTime()));
    this.alreadyEvaluatedAsDwelling = true;
    return true;
  }

  public AbstractWifiDwellTrigger getTriggerDefinition()
  {
    return (AbstractWifiDwellTrigger)super.getTriggerDefinition();
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.worklight.location.internal.wifi.triggerEvaluators.WifiDwellingTrigger
 * JD-Core Version:    0.6.2
 */