38 lines
1.8 KiB
Java
38 lines
1.8 KiB
Java
package com.discord.utilities.device;
|
|
|
|
import android.content.Context;
|
|
import androidx.annotation.AnyThread;
|
|
import com.discord.models.experiments.domain.Experiment;
|
|
import com.discord.stores.StoreExperiments;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt$filterNull$1;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt$filterNull$2;
|
|
import d0.z.d.m;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import rx.Observable;
|
|
/* compiled from: RtcCameraConfig.kt */
|
|
public final class RtcCameraConfig {
|
|
public static final RtcCameraConfig INSTANCE = new RtcCameraConfig();
|
|
private static final AtomicBoolean initialized = new AtomicBoolean();
|
|
|
|
private RtcCameraConfig() {
|
|
}
|
|
|
|
private final Observable<Experiment> observeExperiment(StoreExperiments storeExperiments) {
|
|
Observable<R> G = storeExperiments.observeUserExperiment("2021-02_android_webrtc_camera2", true).y(ObservableExtensionsKt$filterNull$1.INSTANCE).G(ObservableExtensionsKt$filterNull$2.INSTANCE);
|
|
m.checkNotNullExpressionValue(G, "filter { it != null }.map { it!! }");
|
|
Observable a02 = G.a0(1);
|
|
m.checkNotNullExpressionValue(a02, "storeExperiments.observe…Null()\n .take(1)");
|
|
return ObservableExtensionsKt.computationLatest(a02);
|
|
}
|
|
|
|
@AnyThread
|
|
public final void init() {
|
|
if (initialized.compareAndSet(false, true)) {
|
|
ObservableExtensionsKt.appSubscribe$default(observeExperiment(StoreStream.Companion.getExperiments()), RtcCameraConfig.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, RtcCameraConfig$init$1.INSTANCE, 62, (Object) null);
|
|
}
|
|
}
|
|
}
|