fr$2.java 2.27 KB
import android.support.v4.content.ParallelExecutorCompat;
import android.support.v7.util.ThreadUtil.BackgroundCallback;
import android.support.v7.util.TileList.Tile;
import android.util.Log;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;

final class fr$2
  implements ThreadUtil.BackgroundCallback<T>
{
  final fr.a a = new fr.a();
  AtomicBoolean b = new AtomicBoolean(false);
  private final Executor e = ParallelExecutorCompat.getParallelExecutor();
  private Runnable f = new Runnable()
  {
    public final void run()
    {
      for (;;)
      {
        fr.b localb = fr.2.this.a.a();
        if (localb == null) {
          break;
        }
        switch (localb.a)
        {
        default: 
          Log.e("ThreadUtil", "Unsupported message, what=" + localb.a);
          break;
        case 1: 
          fr.2.this.a.a(1);
          fr.2.this.c.refresh(localb.b);
          break;
        case 2: 
          fr.2.this.a.a(2);
          fr.2.this.a.a(3);
          fr.2.this.c.updateRange(localb.b, localb.c, localb.d, localb.e, localb.f);
          break;
        case 3: 
          fr.2.this.c.loadTile(localb.b, localb.c);
          break;
        case 4: 
          fr.2.this.c.recycleTile((TileList.Tile)localb.g);
        }
      }
      fr.2.this.b.set(false);
    }
  };
  
  fr$2(fr paramfr, ThreadUtil.BackgroundCallback paramBackgroundCallback) {}
  
  private void a()
  {
    if (this.b.compareAndSet(false, true)) {
      this.e.execute(this.f);
    }
  }
  
  private void a(fr.b paramb)
  {
    this.a.b(paramb);
    a();
  }
  
  private void b(fr.b paramb)
  {
    this.a.a(paramb);
    a();
  }
  
  public final void loadTile(int paramInt1, int paramInt2)
  {
    a(fr.b.a(3, paramInt1, paramInt2));
  }
  
  public final void recycleTile(TileList.Tile<T> paramTile)
  {
    a(fr.b.a(4, 0, paramTile));
  }
  
  public final void refresh(int paramInt)
  {
    b(fr.b.a(1, paramInt, null));
  }
  
  public final void updateRange(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
  {
    b(fr.b.a(2, paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, null));
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/fr$2.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */