alexandroid/decompiled/jadx/sources/rx/subscriptions/BooleanSubscription.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

48 lines
1.4 KiB
Java

package rx.subscriptions;
import java.util.concurrent.atomic.AtomicReference;
import rx.Subscription;
import rx.functions.Action0;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes12.dex */
public final class BooleanSubscription implements Subscription {
static final Action0 EMPTY_ACTION = new Action0() { // from class: rx.subscriptions.BooleanSubscription.1
@Override // rx.functions.Action0
public void call() {
}
};
final AtomicReference<Action0> actionRef;
public BooleanSubscription() {
this.actionRef = new AtomicReference<>();
}
public static BooleanSubscription create() {
return new BooleanSubscription();
}
@Override // rx.Subscription
public boolean isUnsubscribed() {
return this.actionRef.get() == EMPTY_ACTION;
}
@Override // rx.Subscription
public void unsubscribe() {
Action0 andSet;
Action0 action0 = this.actionRef.get();
Action0 action02 = EMPTY_ACTION;
if (action0 == action02 || (andSet = this.actionRef.getAndSet(action02)) == null || andSet == action02) {
return;
}
andSet.call();
}
public static BooleanSubscription create(Action0 action0) {
return new BooleanSubscription(action0);
}
private BooleanSubscription(Action0 action0) {
this.actionRef = new AtomicReference<>(action0);
}
}