lz.java 2.4 KB
import android.support.annotation.NonNull;
import com.google.android.gms.tasks.Continuation;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.RuntimeExecutionException;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskExecutors;
import java.util.concurrent.Executor;

final class lz<TResult, TContinuationResult>
  implements OnFailureListener, OnSuccessListener<TContinuationResult>, md<TResult>
{
  private final Executor a;
  private final Continuation<TResult, Task<TContinuationResult>> b;
  private final mf<TContinuationResult> c;
  
  public lz(@NonNull Executor paramExecutor, @NonNull Continuation<TResult, Task<TContinuationResult>> paramContinuation, @NonNull mf<TContinuationResult> parammf)
  {
    this.a = paramExecutor;
    this.b = paramContinuation;
    this.c = parammf;
  }
  
  public final void a()
  {
    throw new UnsupportedOperationException();
  }
  
  public final void a(@NonNull final Task<TResult> paramTask)
  {
    this.a.execute(new Runnable()
    {
      public final void run()
      {
        try
        {
          Task localTask = (Task)lz.a(lz.this).then(paramTask);
          if (localTask == null)
          {
            lz.this.onFailure(new NullPointerException("Continuation returned null"));
            return;
          }
        }
        catch (RuntimeExecutionException localRuntimeExecutionException)
        {
          if ((localRuntimeExecutionException.getCause() instanceof Exception))
          {
            lz.b(lz.this).a((Exception)localRuntimeExecutionException.getCause());
            return;
          }
          lz.b(lz.this).a(localRuntimeExecutionException);
          return;
        }
        catch (Exception localException)
        {
          lz.b(lz.this).a(localException);
          return;
        }
        localException.addOnSuccessListener(TaskExecutors.a, lz.this);
        localException.addOnFailureListener(TaskExecutors.a, lz.this);
      }
    });
  }
  
  public final void onFailure(@NonNull Exception paramException)
  {
    this.c.a(paramException);
  }
  
  public final void onSuccess(TContinuationResult paramTContinuationResult)
  {
    this.c.a(paramTContinuationResult);
  }
}


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