package androidx.browser.customtabs;

import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.support.customtabs.ICustomTabsCallback;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes.dex */
public final class k extends ICustomTabsCallback.Stub {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Handler f875a = new Handler(Looper.getMainLooper());

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ d f876b;

    public k(d dVar) {
        this.f876b = dVar;
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void extraCallback(String str, Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new g(this, str, bundle, 0));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public Bundle extraCallbackWithResult(@NonNull String str, @Nullable Bundle bundle) throws RemoteException {
        d dVar = this.f876b;
        if (dVar == null) {
            return null;
        }
        return dVar.extraCallbackWithResult(str, bundle);
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void onActivityLayout(int i10, int i11, int i12, int i13, int i14, Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new j(this, i10, i11, i12, i13, i14, bundle));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public void onActivityResized(int i10, int i11, @Nullable Bundle bundle) throws RemoteException {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new i(this, i10, i11, bundle));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void onMessageChannelReady(Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new e(1, bundle, this));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void onMinimized(Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new e(3, bundle, this));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void onNavigationEvent(int i10, Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new f(i10, bundle, this));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void onPostMessage(String str, Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new g(this, str, bundle, 1));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public void onRelationshipValidationResult(int i10, Uri uri, boolean z10, @Nullable Bundle bundle) throws RemoteException {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new h(this, i10, uri, z10, bundle));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void onUnminimized(Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new e(0, bundle, this));
    }

    @Override // android.support.customtabs.ICustomTabsCallback
    public final void onWarmupCompleted(Bundle bundle) {
        if (this.f876b == null) {
            return;
        }
        this.f875a.post(new e(2, bundle, this));
    }
}
