granularity level: instruction

		.class public final Landroidx/core/os/CancellationSignal;
.super Ljava/lang/Object;
.source "CancellationSignal.java"

.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/core/os/CancellationSignal$OnCancelListener;
}
.end annotation

.field private mCancelInProgress:Z
.field private mCancellationSignalObj:Ljava/lang/Object;
.field private mIsCanceled:Z
.field private mOnCancelListener:Landroidx/core/os/CancellationSignal$OnCancelListener;


.method public constructor <init>()V
	.locals 0

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	return-void
.end method

.method private waitForCancelFinishedLocked()V
	.locals 1

	:goto_0
	iget-boolean v0, p0, Landroidx/core/os/CancellationSignal;->mCancelInProgress:Z
	if-eqz v0, :cond_0
	:try_start_0
	invoke-virtual {p0}, Ljava/lang/Object;->wait()V
	:try_end_0
	.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
	goto :goto_0
	:catch_0
	nop
	goto :goto_0
	:cond_0
	return-void
.end method

.method public cancel()V
	.locals 4

	monitor-enter p0
	:try_start_0
	iget-boolean v0, p0, Landroidx/core/os/CancellationSignal;->mIsCanceled:Z
	if-eqz v0, :cond_0
	monitor-exit p0
	return-void
	:cond_0
	const/4 v0, 0x1
	iput-boolean v0, p0, Landroidx/core/os/CancellationSignal;->mIsCanceled:Z
	iput-boolean v0, p0, Landroidx/core/os/CancellationSignal;->mCancelInProgress:Z
	iget-object v0, p0, Landroidx/core/os/CancellationSignal;->mOnCancelListener:Landroidx/core/os/CancellationSignal$OnCancelListener;
	iget-object v1, p0, Landroidx/core/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
	monitor-exit p0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_3
	const/4 v2, 0x0
	if-eqz v0, :cond_1
	:try_start_1
	invoke-interface {v0}, Landroidx/core/os/CancellationSignal$OnCancelListener;->onCancel()V
	goto :goto_0
	:catchall_0
	move-exception v0
	goto :goto_1
	:goto_0
	:cond_1
	if-eqz v1, :cond_2
	sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
	const/16 v3, 0x10
	if-lt v0, v3, :cond_2
	check-cast v1, Landroid/os/CancellationSignal;
	invoke-virtual {v1}, Landroid/os/CancellationSignal;->cancel()V
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_0
	goto :goto_2
	:goto_1
	monitor-enter p0
	:try_start_2
	iput-boolean v2, p0, Landroidx/core/os/CancellationSignal;->mCancelInProgress:Z
	invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
	monitor-exit p0
	:try_end_2
	.catchall {:try_start_2 .. :try_end_2} :catchall_1
	throw v0
	:catchall_1
	move-exception v0
	:try_start_3
	monitor-exit p0
	:try_end_3
	.catchall {:try_start_3 .. :try_end_3} :catchall_1
	throw v0
	:goto_2
	:cond_2
	monitor-enter p0
	:try_start_4
	iput-boolean v2, p0, Landroidx/core/os/CancellationSignal;->mCancelInProgress:Z
	invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
	monitor-exit p0
	return-void
	:catchall_2
	move-exception v0
	monitor-exit p0
	:try_end_4
	.catchall {:try_start_4 .. :try_end_4} :catchall_2
	throw v0
	:catchall_3
	move-exception v0
	:try_start_5
	monitor-exit p0
	:try_end_5
	.catchall {:try_start_5 .. :try_end_5} :catchall_3
	throw v0
.end method

.method public getCancellationSignalObject()Ljava/lang/Object;
	.locals 2

	sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
	const/16 v1, 0x10
	if-ge v0, v1, :cond_0
	const/4 v0, 0x0
	return-object v0
	:cond_0
	monitor-enter p0
	:try_start_0
	iget-object v0, p0, Landroidx/core/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
	if-nez v0, :cond_1
	new-instance v0, Landroid/os/CancellationSignal;
	invoke-direct {v0}, Landroid/os/CancellationSignal;-><init>()V
	iput-object v0, p0, Landroidx/core/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
	iget-boolean v1, p0, Landroidx/core/os/CancellationSignal;->mIsCanceled:Z
	if-eqz v1, :cond_1
	move-object v1, v0
	check-cast v1, Landroid/os/CancellationSignal;
	invoke-virtual {v0}, Landroid/os/CancellationSignal;->cancel()V
	:cond_1
	iget-object v0, p0, Landroidx/core/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
	monitor-exit p0
	return-object v0
	:catchall_0
	move-exception v0
	monitor-exit p0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	throw v0
.end method

.method public isCanceled()Z
	.locals 1

	monitor-enter p0
	:try_start_0
	iget-boolean v0, p0, Landroidx/core/os/CancellationSignal;->mIsCanceled:Z
	monitor-exit p0
	return v0
	:catchall_0
	move-exception v0
	monitor-exit p0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	throw v0
.end method

.method public setOnCancelListener(Landroidx/core/os/CancellationSignal$OnCancelListener;)V
	.locals 1

	monitor-enter p0
	:try_start_0
	invoke-direct {p0}, Landroidx/core/os/CancellationSignal;->waitForCancelFinishedLocked()V
	iget-object v0, p0, Landroidx/core/os/CancellationSignal;->mOnCancelListener:Landroidx/core/os/CancellationSignal$OnCancelListener;
	if-ne v0, p1, :cond_0
	monitor-exit p0
	return-void
	:cond_0
	iput-object p1, p0, Landroidx/core/os/CancellationSignal;->mOnCancelListener:Landroidx/core/os/CancellationSignal$OnCancelListener;
	iget-boolean v0, p0, Landroidx/core/os/CancellationSignal;->mIsCanceled:Z
	if-eqz v0, :cond_2
	if-nez p1, :cond_1
	goto :goto_0
	:cond_1
	monitor-exit p0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	invoke-interface {p1}, Landroidx/core/os/CancellationSignal$OnCancelListener;->onCancel()V
	return-void
	:goto_0
	:try_start_1
	:cond_2
	monitor-exit p0
	return-void
	:catchall_0
	move-exception p1
	monitor-exit p0
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_0
	throw p1
.end method

.method public throwIfCanceled()V
	.locals 1

	invoke-virtual {p0}, Landroidx/core/os/CancellationSignal;->isCanceled()Z
	move-result v0
	if-nez v0, :cond_0
	return-void
	:cond_0
	new-instance v0, Landroidx/core/os/OperationCanceledException;
	invoke-direct {v0}, Landroidx/core/os/OperationCanceledException;-><init>()V
	throw v0
.end method