CancellationSignal.java 4.43 KB
package android.support.v4.os;

import android.os.Build.VERSION;

public final class CancellationSignal
{
  private boolean a;
  private OnCancelListener b;
  private Object c;
  private boolean d;
  
  /* Error */
  public final void cancel()
  {
    // Byte code:
    //   0: aload_0
    //   1: monitorenter
    //   2: aload_0
    //   3: getfield 22	android/support/v4/os/CancellationSignal:a	Z
    //   6: ifeq +6 -> 12
    //   9: aload_0
    //   10: monitorexit
    //   11: return
    //   12: aload_0
    //   13: iconst_1
    //   14: putfield 22	android/support/v4/os/CancellationSignal:a	Z
    //   17: aload_0
    //   18: iconst_1
    //   19: putfield 24	android/support/v4/os/CancellationSignal:d	Z
    //   22: aload_0
    //   23: getfield 26	android/support/v4/os/CancellationSignal:b	Landroid/support/v4/os/CancellationSignal$OnCancelListener;
    //   26: astore_1
    //   27: aload_0
    //   28: getfield 28	android/support/v4/os/CancellationSignal:c	Ljava/lang/Object;
    //   31: astore_2
    //   32: aload_0
    //   33: monitorexit
    //   34: aload_1
    //   35: ifnull +9 -> 44
    //   38: aload_1
    //   39: invokeinterface 31 1 0
    //   44: aload_2
    //   45: ifnull +10 -> 55
    //   48: aload_2
    //   49: checkcast 33	android/os/CancellationSignal
    //   52: invokevirtual 35	android/os/CancellationSignal:cancel	()V
    //   55: aload_0
    //   56: monitorenter
    //   57: aload_0
    //   58: iconst_0
    //   59: putfield 24	android/support/v4/os/CancellationSignal:d	Z
    //   62: aload_0
    //   63: invokevirtual 38	java/lang/Object:notifyAll	()V
    //   66: aload_0
    //   67: monitorexit
    //   68: return
    //   69: astore_1
    //   70: aload_0
    //   71: monitorexit
    //   72: aload_1
    //   73: athrow
    //   74: astore_1
    //   75: aload_0
    //   76: monitorexit
    //   77: aload_1
    //   78: athrow
    //   79: astore_1
    //   80: aload_0
    //   81: monitorenter
    //   82: aload_0
    //   83: iconst_0
    //   84: putfield 24	android/support/v4/os/CancellationSignal:d	Z
    //   87: aload_0
    //   88: invokevirtual 38	java/lang/Object:notifyAll	()V
    //   91: aload_0
    //   92: monitorexit
    //   93: aload_1
    //   94: athrow
    //   95: astore_1
    //   96: aload_0
    //   97: monitorexit
    //   98: aload_1
    //   99: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	100	0	this	CancellationSignal
    //   26	13	1	localOnCancelListener	OnCancelListener
    //   69	4	1	localObject1	Object
    //   74	4	1	localObject2	Object
    //   79	15	1	localObject3	Object
    //   95	4	1	localObject4	Object
    //   31	18	2	localObject5	Object
    // Exception table:
    //   from	to	target	type
    //   57	68	69	finally
    //   70	72	69	finally
    //   2	11	74	finally
    //   12	34	74	finally
    //   75	77	74	finally
    //   38	44	79	finally
    //   48	55	79	finally
    //   82	93	95	finally
    //   96	98	95	finally
  }
  
  public final Object getCancellationSignalObject()
  {
    if (Build.VERSION.SDK_INT < 16) {
      return null;
    }
    try
    {
      if (this.c == null)
      {
        this.c = new android.os.CancellationSignal();
        if (this.a) {
          ((android.os.CancellationSignal)this.c).cancel();
        }
      }
      Object localObject1 = this.c;
      return localObject1;
    }
    finally {}
  }
  
  public final boolean isCanceled()
  {
    try
    {
      boolean bool = this.a;
      return bool;
    }
    finally {}
  }
  
  public final void setOnCancelListener(OnCancelListener paramOnCancelListener)
  {
    try
    {
      for (;;)
      {
        boolean bool = this.d;
        if (!bool) {
          break;
        }
        try
        {
          wait();
        }
        catch (InterruptedException localInterruptedException) {}
      }
      if (this.b == paramOnCancelListener) {
        return;
      }
      this.b = paramOnCancelListener;
      if ((!this.a) || (paramOnCancelListener == null)) {
        return;
      }
    }
    finally {}
    paramOnCancelListener.onCancel();
  }
  
  public final void throwIfCanceled()
  {
    if (isCanceled()) {
      throw new OperationCanceledException();
    }
  }
  
  public static abstract interface OnCancelListener
  {
    public abstract void onCancel();
  }
}


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