mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-16 19:07:17 +01:00
87 lines
3.6 KiB
Java
87 lines
3.6 KiB
Java
package androidx.webkit.internal;
|
|
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.webkit.TracingConfig;
|
|
import androidx.webkit.TracingController;
|
|
import androidx.webkit.internal.ApiFeature;
|
|
import java.io.OutputStream;
|
|
import java.util.concurrent.Executor;
|
|
import org.chromium.support_lib_boundary.TracingControllerBoundaryInterface;
|
|
import rx.Single$$ExternalSyntheticBUOutline0;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes14.dex */
|
|
public class TracingControllerImpl extends TracingController {
|
|
private TracingControllerBoundaryInterface mBoundaryInterface;
|
|
private android.webkit.TracingController mFrameworksImpl;
|
|
|
|
public TracingControllerImpl() {
|
|
ApiFeature.P p = WebViewFeatureInternal.TRACING_CONTROLLER_BASIC_USAGE;
|
|
if (p.isSupportedByFramework()) {
|
|
this.mFrameworksImpl = ApiHelperForP.getTracingControllerInstance();
|
|
this.mBoundaryInterface = null;
|
|
} else {
|
|
if (!p.isSupportedByWebView()) {
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
this.mFrameworksImpl = null;
|
|
this.mBoundaryInterface = WebViewGlueCommunicator.getFactory().getTracingController();
|
|
}
|
|
}
|
|
|
|
private TracingControllerBoundaryInterface getBoundaryInterface() {
|
|
if (this.mBoundaryInterface == null) {
|
|
this.mBoundaryInterface = WebViewGlueCommunicator.getFactory().getTracingController();
|
|
}
|
|
return this.mBoundaryInterface;
|
|
}
|
|
|
|
@RequiresApi(28)
|
|
private android.webkit.TracingController getFrameworksImpl() {
|
|
if (this.mFrameworksImpl == null) {
|
|
this.mFrameworksImpl = ApiHelperForP.getTracingControllerInstance();
|
|
}
|
|
return this.mFrameworksImpl;
|
|
}
|
|
|
|
@Override // androidx.webkit.TracingController
|
|
public boolean isTracing() {
|
|
ApiFeature.P p = WebViewFeatureInternal.TRACING_CONTROLLER_BASIC_USAGE;
|
|
if (p.isSupportedByFramework()) {
|
|
return ApiHelperForP.isTracing(getFrameworksImpl());
|
|
}
|
|
if (p.isSupportedByWebView()) {
|
|
return getBoundaryInterface().isTracing();
|
|
}
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
|
|
@Override // androidx.webkit.TracingController
|
|
public void start(TracingConfig tracingConfig) {
|
|
if (tracingConfig == null) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("Tracing config must be non null");
|
|
return;
|
|
}
|
|
ApiFeature.P p = WebViewFeatureInternal.TRACING_CONTROLLER_BASIC_USAGE;
|
|
if (p.isSupportedByFramework()) {
|
|
ApiHelperForP.start(getFrameworksImpl(), tracingConfig);
|
|
} else {
|
|
if (!p.isSupportedByWebView()) {
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
getBoundaryInterface().start(tracingConfig.getPredefinedCategories(), tracingConfig.getCustomIncludedCategories(), tracingConfig.getTracingMode());
|
|
}
|
|
}
|
|
|
|
@Override // androidx.webkit.TracingController
|
|
public boolean stop(OutputStream outputStream, Executor executor) {
|
|
ApiFeature.P p = WebViewFeatureInternal.TRACING_CONTROLLER_BASIC_USAGE;
|
|
if (p.isSupportedByFramework()) {
|
|
return ApiHelperForP.stop(getFrameworksImpl(), outputStream, executor);
|
|
}
|
|
if (p.isSupportedByWebView()) {
|
|
return getBoundaryInterface().stop(outputStream, executor);
|
|
}
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
}
|