Files
rr3-apk/decompiled-community/sources/androidx/core/os/CancellationSignal.java
Daniel Elliott c080f0d97f Add Discord community version (64-bit only)
- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
2026-02-18 15:48:36 -08:00

109 lines
3.1 KiB
Java

package androidx.core.os;
import androidx.annotation.Nullable;
@Deprecated
/* loaded from: classes.dex */
public final class CancellationSignal {
private boolean mCancelInProgress;
private Object mCancellationSignalObj;
private boolean mIsCanceled;
private OnCancelListener mOnCancelListener;
public interface OnCancelListener {
void onCancel();
}
public boolean isCanceled() {
boolean z;
synchronized (this) {
z = this.mIsCanceled;
}
return z;
}
public void throwIfCanceled() {
if (isCanceled()) {
throw new OperationCanceledException();
}
}
public void cancel() {
synchronized (this) {
try {
if (this.mIsCanceled) {
return;
}
this.mIsCanceled = true;
this.mCancelInProgress = true;
OnCancelListener onCancelListener = this.mOnCancelListener;
Object obj = this.mCancellationSignalObj;
if (onCancelListener != null) {
try {
onCancelListener.onCancel();
} catch (Throwable th) {
synchronized (this) {
this.mCancelInProgress = false;
notifyAll();
throw th;
}
}
}
if (obj != null) {
((android.os.CancellationSignal) obj).cancel();
}
synchronized (this) {
this.mCancelInProgress = false;
notifyAll();
}
} finally {
}
}
}
public void setOnCancelListener(@Nullable OnCancelListener onCancelListener) {
synchronized (this) {
try {
waitForCancelFinishedLocked();
if (this.mOnCancelListener == onCancelListener) {
return;
}
this.mOnCancelListener = onCancelListener;
if (this.mIsCanceled && onCancelListener != null) {
onCancelListener.onCancel();
}
} finally {
}
}
}
@Nullable
public Object getCancellationSignalObject() {
Object obj;
synchronized (this) {
try {
if (this.mCancellationSignalObj == null) {
android.os.CancellationSignal cancellationSignal = new android.os.CancellationSignal();
this.mCancellationSignalObj = cancellationSignal;
if (this.mIsCanceled) {
cancellationSignal.cancel();
}
}
obj = this.mCancellationSignalObj;
} catch (Throwable th) {
throw th;
}
}
return obj;
}
private void waitForCancelFinishedLocked() {
while (this.mCancelInProgress) {
try {
wait();
} catch (InterruptedException unused) {
}
}
}
}