package androidx.browser.trusted;

import android.app.Notification;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcelable;
import android.support.customtabs.trusted.ITrustedWebActivityService;
import xyz.stream.utils.j0;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ TrustedWebActivityService f909a;

    public j(TrustedWebActivityService trustedWebActivityService) {
        this.f909a = trustedWebActivityService;
    }

    public final void G() {
        TrustedWebActivityService trustedWebActivityService = this.f909a;
        int i10 = trustedWebActivityService.mVerifiedUid;
        if (i10 != -1) {
            if (i10 != Binder.getCallingUid()) {
                throw new SecurityException("Caller is not verified as Trusted Web Activity provider.");
            }
        } else {
            trustedWebActivityService.getPackageManager().getPackagesForUid(Binder.getCallingUid());
            trustedWebActivityService.getTokenStore();
            throw null;
        }
    }

    @Override // android.support.customtabs.trusted.ITrustedWebActivityService
    public final Bundle areNotificationsEnabled(Bundle bundle) {
        G();
        m.a(bundle, "android.support.customtabs.trusted.CHANNEL_NAME");
        l lVar = new l(this.f909a.onAreNotificationsEnabled(bundle.getString("android.support.customtabs.trusted.CHANNEL_NAME")), 0);
        Bundle bundle2 = new Bundle();
        bundle2.putBoolean("android.support.customtabs.trusted.NOTIFICATION_SUCCESS", lVar.f916b);
        return bundle2;
    }

    @Override // android.support.customtabs.trusted.ITrustedWebActivityService
    public final void cancelNotification(Bundle bundle) {
        G();
        m.a(bundle, "android.support.customtabs.trusted.PLATFORM_TAG");
        m.a(bundle, "android.support.customtabs.trusted.PLATFORM_ID");
        this.f909a.onCancelNotification(bundle.getString("android.support.customtabs.trusted.PLATFORM_TAG"), bundle.getInt("android.support.customtabs.trusted.PLATFORM_ID"));
    }

    @Override // android.support.customtabs.trusted.ITrustedWebActivityService
    public final Bundle extraCommand(String str, Bundle bundle, IBinder iBinder) {
        G();
        return this.f909a.onExtraCommand(str, bundle, e.fromBinder(iBinder));
    }

    @Override // android.support.customtabs.trusted.ITrustedWebActivityService
    public final Bundle getActiveNotifications() {
        G();
        j0 j0Var = new j0(this.f909a.onGetActiveNotifications(), 3);
        Bundle bundle = new Bundle();
        bundle.putParcelableArray("android.support.customtabs.trusted.ACTIVE_NOTIFICATIONS", (Parcelable[]) j0Var.f36154b);
        return bundle;
    }

    @Override // android.support.customtabs.trusted.ITrustedWebActivityService
    public final Bundle getSmallIconBitmap() {
        G();
        return this.f909a.onGetSmallIconBitmap();
    }

    @Override // android.support.customtabs.trusted.ITrustedWebActivityService
    public final int getSmallIconId() {
        G();
        return this.f909a.onGetSmallIconId();
    }

    @Override // android.support.customtabs.trusted.ITrustedWebActivityService
    public final Bundle notifyNotificationWithChannel(Bundle bundle) {
        G();
        m.a(bundle, "android.support.customtabs.trusted.PLATFORM_TAG");
        m.a(bundle, "android.support.customtabs.trusted.PLATFORM_ID");
        m.a(bundle, "android.support.customtabs.trusted.NOTIFICATION");
        m.a(bundle, "android.support.customtabs.trusted.CHANNEL_NAME");
        k kVar = new k(bundle.getString("android.support.customtabs.trusted.PLATFORM_TAG"), bundle.getInt("android.support.customtabs.trusted.PLATFORM_ID"), (Notification) bundle.getParcelable("android.support.customtabs.trusted.NOTIFICATION"), bundle.getString("android.support.customtabs.trusted.CHANNEL_NAME"));
        l lVar = new l(this.f909a.onNotifyNotificationWithChannel((String) kVar.f912c, kVar.f911b, (Notification) kVar.f914e, (String) kVar.f913d), 0);
        Bundle bundle2 = new Bundle();
        bundle2.putBoolean("android.support.customtabs.trusted.NOTIFICATION_SUCCESS", lVar.f916b);
        return bundle2;
    }
}
