package com.google.android.m4b.maps.bu;

import android.content.Context;
import android.location.Location;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import com.google.android.m4b.maps.d.b.a;
import com.google.android.m4b.maps.e.c;
import com.google.android.m4b.maps.e.c.a;
import com.google.android.m4b.maps.e.c.b;
import com.google.android.m4b.maps.k.e;
import com.google.android.m4b.maps.k.g;
import com.google.android.m4b.maps.model.RuntimeRemoteException;
import com.google.android.m4b.maps.r.j.a;
import com.google.android.m4b.maps.r.q;
import com.google.common.base.Preconditions;

public final class am extends j.a
  implements al, b.a, c.b, com.google.android.m4b.maps.k.d, Runnable
{
  private static final e f = e.a().a(5000L).b(16L).a(100);
  private final Handler a;
  private boolean b;
  private q c;
  private c d;
  private Location e;

  private am(Handler paramHandler)
  {
    this.a = paramHandler;
  }

  public static am a(Context paramContext)
  {
    am localam = new am(new Handler(Looper.getMainLooper()));
    localam.d = new c.a(paramContext.getApplicationContext()).a(g.a).a(localam).a(localam).a();
    return localam;
  }

  private void d()
  {
    this.d.a();
  }

  private void e()
  {
    this.d.b();
    this.a.removeCallbacks(this);
    this.e = null;
  }

  public final void a()
  {
    if (this.c != null);
    for (boolean bool = true; ; bool = false)
    {
      Preconditions.checkState(bool, "already activated");
      this.c = null;
      if (this.b)
        e();
      return;
    }
  }

  public final void a(int paramInt)
  {
  }

  public final void a(Location paramLocation)
  {
    this.e = paramLocation;
    this.a.post(this);
  }

  public final void a(Bundle paramBundle)
  {
    g.b.a(this.d, f, this);
  }

  public final void a(com.google.android.m4b.maps.d.a parama)
  {
  }

  public final void a(q paramq)
  {
    boolean bool1 = true;
    boolean bool2;
    if (this.c == null)
    {
      bool2 = bool1;
      Preconditions.checkState(bool2, "already activated");
      if (paramq == null)
        break label49;
    }
    while (true)
    {
      Preconditions.checkArgument(bool1, "listener cannot be null");
      this.c = paramq;
      if (this.b)
        d();
      return;
      bool2 = false;
      break;
      label49: bool1 = false;
    }
  }

  public final void b()
  {
    this.b = true;
    if (this.c != null)
      d();
  }

  public final void c()
  {
    if (this.c != null)
      e();
    this.b = false;
  }

  public final void run()
  {
    try
    {
      if (this.c != null)
        this.c.a(com.google.android.m4b.maps.j.d.a(this.e));
      return;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bu.am
 * JD-Core Version:    0.6.2
 */