package com.worklight.location.internal.deviceContextPiggybacker;

import com.worklight.location.api.geo.WLCoordinate;
import com.worklight.location.api.geo.WLGeoPosition;

final class GeoPositionSensorEncoder
  implements SensorEncoder<WLGeoPosition>
{
  private final DeviceContextPiggybacker deviceContextPiggybacker;

  GeoPositionSensorEncoder(DeviceContextPiggybacker paramDeviceContextPiggybacker)
  {
    this.deviceContextPiggybacker = paramDeviceContextPiggybacker;
  }

  public void encode(WLGeoPosition paramWLGeoPosition)
  {
    WLCoordinate localWLCoordinate = paramWLGeoPosition.getCoordinate();
    boolean bool1;
    boolean bool2;
    label21: boolean bool3;
    boolean bool4;
    boolean bool5;
    boolean bool6;
    label48: boolean bool7;
    label63: boolean bool8;
    label78: boolean bool9;
    if (paramWLGeoPosition.getTimestamp() != null)
    {
      bool1 = true;
      if (localWLCoordinate == null)
        break label353;
      bool2 = true;
      bool3 = bool2;
      bool4 = bool2;
      bool5 = bool2;
      if ((!bool2) || (localWLCoordinate.getSpeed() == null))
        break label359;
      bool6 = true;
      if ((!bool2) || (localWLCoordinate.getHeading() == null))
        break label365;
      bool7 = true;
      if ((!bool2) || (localWLCoordinate.getAltitude() == null))
        break label371;
      bool8 = true;
      if ((!bool2) || (localWLCoordinate.getAltitudeAccuracy() == null))
        break label377;
      bool9 = true;
      label93: if ((!bool1) || (!bool3) || (!bool4) || (!bool5) || (!bool6) || (!bool7) || (!bool8) || (!bool9))
        break label383;
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.writeNumber(1L, 1));
    }
    while (true)
    {
      if (bool1)
        this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeNonNegativeNumber(paramWLGeoPosition.getTimestamp().longValue()));
      String str = "";
      if (bool3)
        str = this.deviceContextPiggybacker.encodeCoordsValue(Double.valueOf(localWLCoordinate.getLongitude()), str);
      if (bool3)
        str = this.deviceContextPiggybacker.encodeCoordsValue(Double.valueOf(localWLCoordinate.getLatitude()), str);
      if (bool5)
        str = this.deviceContextPiggybacker.encodeCoordsValue(Double.valueOf(localWLCoordinate.getAccuracy()), str);
      if (bool6)
        str = this.deviceContextPiggybacker.encodeCoordsValue(localWLCoordinate.getSpeed(), str);
      if (bool7)
        str = this.deviceContextPiggybacker.encodeCoordsValue(localWLCoordinate.getHeading(), str);
      if (bool8)
        str = this.deviceContextPiggybacker.encodeCoordsValue(localWLCoordinate.getAltitude(), str);
      if (bool9)
        str = this.deviceContextPiggybacker.encodeCoordsValue(localWLCoordinate.getAltitudeAccuracy(), str);
      this.deviceContextPiggybacker.textData.append(str);
      return;
      bool1 = false;
      break;
      label353: bool2 = false;
      break label21;
      label359: bool6 = false;
      break label48;
      label365: bool7 = false;
      break label63;
      label371: bool8 = false;
      break label78;
      label377: bool9 = false;
      break label93;
      label383: this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.writeNumber(0L, 1));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool1));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool3));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool4));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool5));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool6));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool7));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool8));
      this.deviceContextPiggybacker.sensorInfo.append(this.deviceContextPiggybacker.encodeBoolean(bool9));
    }
  }
}

/* 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.deviceContextPiggybacker.GeoPositionSensorEncoder
 * JD-Core Version:    0.6.2
 */