package com.google.android.m4b.maps.ao;

import android.content.res.Resources;
import com.google.android.m4b.maps.aw.f;
import com.google.android.m4b.maps.aw.g;
import com.google.android.m4b.maps.aw.h;
import com.google.android.m4b.maps.bc.af;
import com.google.android.m4b.maps.bc.ba;
import com.google.android.m4b.maps.bc.bf;
import com.google.android.m4b.maps.bc.bg;
import com.google.android.m4b.maps.bl.aj;
import com.google.android.m4b.maps.bl.al;
import com.google.android.m4b.maps.bl.j;
import com.google.android.m4b.maps.bn.b;
import com.google.android.m4b.maps.bo.e;
import com.google.android.m4b.maps.bq.q;
import com.google.android.m4b.maps.bu.ca;
import com.google.android.m4b.maps.bu.ca.a;
import com.google.android.m4b.maps.model.TileOverlayOptions;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;

public final class u
  implements m, t.a, ca.a
{
  private static final h n = new g();
  private final int a;
  private final int b;
  private final boolean c;
  private final t d;
  private final ArrayList<q> e = Lists.newArrayList();
  private final a f = new a();
  private f g;
  private volatile aj h;
  private boolean i;
  private volatile boolean j;
  private boolean k;
  private volatile boolean l = false;
  private final h m;
  private final Set<q> o = Sets.newIdentityHashSet();
  private final bf p;
  private WeakReference<e> q;
  private float r;
  private final n s;
  private final ca t;

  static
  {
    new TileOverlayOptions();
  }

  private u(n paramn, ca paramca, t paramt, h paramh, int paramInt1, int paramInt2, boolean paramBoolean)
  {
    this.s = paramn;
    this.t = paramca;
    this.d = paramt;
    this.m = paramh;
    this.a = paramInt1;
    this.b = 332;
    this.c = false;
    this.p = new bf();
    a(-1);
  }

  public static u a(ca paramca, Resources paramResources, n paramn, ScheduledExecutorService paramScheduledExecutorService)
  {
    int i1 = al.a(paramResources, 332);
    if (paramca.b() != null);
    for (boolean bool = true; ; bool = false)
    {
      Preconditions.checkArgument(bool, "TileOverlay.Options must specify a TileProvider");
      t localt = new t(paramca.b(), paramca.getId(), paramScheduledExecutorService);
      u localu = new u(paramn, paramca, localt, n, i1, 332, false);
      localt.a(localu);
      return localu;
    }
  }

  public final void a()
  {
    synchronized (this.s)
    {
      this.s.a(this);
      this.s.b_();
      return;
    }
  }

  public final void a(int paramInt)
  {
    if ((paramInt & 0x2) != 0);
    synchronized (this.s)
    {
      this.r = this.t.c();
      this.s.c_();
      if ((paramInt & 0x4) != 0)
        this.s.b_();
      return;
    }
  }

  public final void a(long paramLong)
  {
  }

  public final void a(b paramb, e parame)
  {
    this.l = false;
    if (!this.t.d())
      return;
    this.k = true;
    List localList = this.g.a(paramb);
    if (localList.size() > 1)
    {
      this.f.a(paramb.c());
      Collections.sort(localList, this.f);
    }
    this.o.addAll(this.e);
    this.e.clear();
    this.d.a();
    boolean bool1 = this.i;
    Iterator localIterator1 = localList.iterator();
    if (localIterator1.hasNext())
    {
      ba localba = (ba)localIterator1.next();
      if (bool1);
      for (q localq = this.d.a(localba); ; localq = this.d.b(localba))
      {
        if (localq != null)
        {
          this.e.add(localq);
          this.q.get();
          if (!this.o.remove(localq))
            localq.a(true);
          this.e.size();
          if (this.e.size() == this.a)
            break label232;
        }
        this.d.b();
        break;
      }
    }
    label232: if (this.e.size() == localList.size());
    for (boolean bool2 = true; ; bool2 = false)
    {
      this.l = bool2;
      this.j = this.i;
      Iterator localIterator2 = this.o.iterator();
      while (localIterator2.hasNext())
        ((q)localIterator2.next()).a(false);
    }
    this.o.clear();
  }

  public final void a(e parame)
  {
    this.q = null;
    this.h = null;
    this.d.c();
    t localt = this.d;
    synchronized (localt.a)
    {
      Iterator localIterator = localt.a.iterator();
      if (localIterator.hasNext())
        ((t.b)localIterator.next()).a();
    }
    localt.a.clear();
    this.j = true;
  }

  public final void a(e parame, aj paramaj)
  {
    this.q = new WeakReference(parame);
    this.d.a(parame);
    this.h = paramaj;
    if (this.g == null)
      this.g = this.m.a(bg.d, this.b, this.c, this.p);
  }

  public final void a(e parame, b paramb, j paramj)
  {
    if (!this.t.d());
    do
    {
      do
        return;
      while (paramj.b() > 0);
      j localj = new j(paramj);
      if ((this.j) && (!this.i))
        a(paramb, parame);
      if (this.k)
        this.d.a(this.e);
      if (this.e.size() > 0)
      {
        parame.z();
        localj.a(1);
        ((q)this.e.get(0)).b(parame, paramb, localj);
        Iterator localIterator = this.e.iterator();
        while (localIterator.hasNext())
        {
          q localq = (q)localIterator.next();
          if (!this.t.e())
            localq.d();
          localq.a(parame, paramb, localj);
        }
        parame.A();
      }
    }
    while (!this.k);
    this.d.b(this.e);
    this.k = false;
  }

  public final void a(boolean paramBoolean)
  {
    this.d.b(paramBoolean);
    this.j = true;
  }

  public final boolean a(float paramFloat1, float paramFloat2, af paramaf, b paramb)
  {
    return false;
  }

  public final void b()
  {
    this.d.d();
    this.j = true;
  }

  public final void b(int paramInt)
  {
    if ((paramInt & 0x2) != 0);
    for (boolean bool = true; ; bool = false)
    {
      this.i = bool;
      return;
    }
  }

  public final void b(boolean paramBoolean)
  {
    aj localaj = this.h;
    if ((localaj != null) && (paramBoolean))
      localaj.a(true, false);
  }

  public final boolean c()
  {
    try
    {
      if (this.t.d())
      {
        boolean bool2 = this.l;
        if (!bool2);
      }
      else
      {
        bool1 = true;
        return bool1;
      }
      boolean bool1 = false;
    }
    finally
    {
    }
  }

  public final void d()
  {
    try
    {
      this.h = null;
      this.d.c();
      this.d.a(null);
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final String e()
  {
    return this.t.getId();
  }

  public final float f()
  {
    return this.r;
  }

  public final void g()
  {
    this.d.a(false);
    this.s.b_();
  }

  public final String toString()
  {
    return Objects.toStringHelper(this).add("id", this.t.getId()).toString();
  }

  public static final class a
    implements Comparator<ba>
  {
    private int a;
    private int b;

    public final void a(af paramaf)
    {
      this.a = paramaf.f();
      this.b = paramaf.g();
    }
  }
}

/* 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.ao.u
 * JD-Core Version:    0.6.2
 */